Bananian

Bananian readonly filesystem?

11 8143
YaniMan  
tkaiser replied at Fri Oct 10, 2014 10:32
Post Last Edited by tkaiser at 2014-10-10 10:33

Reply 1# dutchman

Hi!
I tried your suggestion (thank you), but the root filesystem remains RW this way. Here is my mtab:
  1. rootfs / rootfs rw 0 0
  2. /dev/root / ext4 rw,relatime 0 0
  3. devtmpfs /dev devtmpfs rw,relatime,size=496752k,nr_inodes=124188,mode=755 0 0
  4. sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
  5. tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=99376k,mode=755 0 0
  6. tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
  7. proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
  8. configfs /sys/kernel/config configfs rw,relatime 0 0
  9. tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=198740k 0 0
  10. devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
  11. /dev/root /etc ext4 rw,relatime 0 0
  12. /dev/root /var ext4 rw,relatime 0 0
  13. tmpfs /tmp tmpfs rw,nosuid,nodev,relatime,size=198740k 0 0
Copy the Code
Output of 'mount':
  1. /dev/mmcblk0p2 on / type ext4 (rw,relatime)
  2. devtmpfs on /dev type devtmpfs (rw,relatime,size=496752k,nr_inodes=124188,mode=755)
  3. sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
  4. tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=99376k,mode=755)
  5. tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
  6. proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
  7. configfs on /sys/kernel/config type configfs (rw,relatime)
  8. tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=198740k)
  9. devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
  10. /dev/mmcblk0p2 on /etc type ext4 (rw,relatime)
  11. /dev/mmcblk0p2 on /var type ext4 (rw,relatime)
  12. tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=198740k)
Copy the Code
Fstab:
  1. # UNCONFIGURED FSTAB FOR BASE SYSTEM

  2. # 512 MB swapfile
  3. #/swapfile1 swap swap defaults 0 0

  4. mount_unionfs   /etc            fuse    defaults          0       0
  5. mount_unionfs   /var            fuse    defaults          0       0
  6. r
Copy the Code
/usr/local/bin/mount_unionfs:
  1. #!/bin/sh
  2. DIR=$1
  3. ROOT_MOUNT=$(awk '$2=="/" {print substr($4,1,2)}' < /etc/mtab | head -n1)
  4. if [ $ROOT_MOUNT = "rw" ]
  5. then
  6.     /bin/mount --bind ${DIR}_org ${DIR}
  7. else
  8.     /bin/mount -t tmpfs ramdisk ${DIR}_rw
  9.     /usr/bin/unionfs-fuse -o cow,allow_other,suid,dev,nonempty ${DIR}_rw=RW:${DIR}_org=RO ${DIR}
  10. fi
Copy the Code
I tried to add the root mount point to fstab, but it did not solve the problem. Could you please tell me, what should i do to inform bananian that i don't want it to mount the root as RW?
Thanks again.

YaniMan  
Now i've figured out that i have to modify both boot.cmd and fstab to work correctly. Now the root fs is RO yeeey!
But my mount output is a bit different. Could anyone please check and tell me if this will be good or not?
  1. /dev/mmcblk0p2 on / type ext4 (ro,noatime)
  2. devtmpfs on /dev type devtmpfs (rw,relatime,size=496752k,nr_inodes=124188,mode=755)
  3. sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
  4. tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=99376k,mode=755)
  5. tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
  6. proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
  7. configfs on /sys/kernel/config type configfs (rw,relatime)
  8. tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=198740k)
  9. devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
  10. /dev/mmcblk0p2 on /etc type ext4 (ro,relatime)
  11. ramdisk on /var_rw type tmpfs (rw,relatime)
  12. unionfs-fuse on /var type fuse.unionfs-fuse (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other)
  13. tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=198740k)
Copy the Code

You have to log in before you can reply Login | Sign Up

Points Rules