How can I boot the rootfs readonly?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How can I boot the rootfs readonly?

跳至解决方案
7,723 次查看
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!

标记 (3)
0 项奖励
回复
1 解答
5,366 次查看
blangero_wang
Contributor I

I got it resolved.

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

在原帖中查看解决方案

5 回复数
5,366 次查看
katherrafi
Contributor II

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

/dev/root         /      auto      remount,ro      1    1

5,366 次查看
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 项奖励
回复
5,367 次查看
blangero_wang
Contributor I

I got it resolved.

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

5,366 次查看
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 项奖励
回复
4,461 次查看
shaoxiao_guo_dn
Contributor I

Do you know why now?

0 项奖励
回复