How can I boot the rootfs readonly?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I boot the rootfs readonly?

Jump to solution
6,330 Views
blangero_wang
Contributor I

Hi:

     I want to load rootfs readonly on my imx6q, the rootfs is debian_armhf.

     In uboot I set the args as:

     setenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/mmcblk1p1 rootwait ro video=mxcfb0:dev=lcd,1440x900,if=RGB24'

     and I do get verbose in bootup:

    

     EXT3-fs (mmcblk1p1): mounted filesystem with writeback data mode

     VFS: Mounted root (ext3 filesystem) readonly on device 179:25.

     But in the system I still get rw in mtab and the rootfs is still writable.

     How can I solve it?

     Thanks!

Tags (3)
0 Kudos
Reply
1 Solution
3,973 Views
blangero_wang
Contributor I

I got it resolved.

It's the fstab file which defines the readonly, but not uboot args.

View solution in original post

5 Replies
3,973 Views
katherrafi
Contributor II

Hope this may help to make the read only in fstab.

/dev/root         /      auto      remount,ro      1    1

3,973 Views
Raana
Contributor III

Hi Kather Rafi,

 

Even I've tried the same in boot arguments, but failed. So, I've tried with fstab and it's working fine.
May I know, 
Why 'ro' is not working in boot arguments ?
Is this related to NXP or default uboot or something ?
Whether 'fstab' is the only way or fine way to make rootfs as 'ro' ?

 

Thank You.

Best Regards,

J.P.Raja

0 Kudos
Reply
3,974 Views
blangero_wang
Contributor I

I got it resolved.

It's the fstab file which defines the readonly, but not uboot args.

3,973 Views
Raana
Contributor III

Hi Blangero Wang,

Even I've tried the same in boot arguments, but failed. So, I've tried with fstab and it's working fine.
May I know,
Why 'ro' is not working in boot arguments ?
Is this related to NXP or default uboot or something ?
Whether 'fstab' is the only way or fine way to make rootfs as 'ro' ?

Thank You.

Best Regards,

J.P.Raja

0 Kudos
Reply
3,068 Views
shaoxiao_guo_dn
Contributor I

Do you know why now?

0 Kudos
Reply