cubieplayer / Cubian

Debian for Cubieboard
http://cubian.org
269 stars 49 forks source link

mounts the filesystem read only on startup #149

Open michalliu opened 11 years ago

michalliu commented 11 years ago

I also have a feature request for Cubian. As I mentioned before, I have some experience with Raspberry Pi and the great Raspbian distribution. Raspbian works really great, but if the power fails you can easily destroy the sd card (permanently). At first, I did the same thing as above and mounted the root filesystem read only. If I had to install some software, I remounted the system with 'sudo mount / -o remount,rw' as read/write, installed the software and then remounted it back to read only. However, there was one major drawback. After mounting the filesystem read write, it was impossible for me to remount it as read only. I always got the error: "mount: / is busy". The only way to change the filesystem back to read only was to reboot the system.

Then, I stumbled across IPE (another great distribution for the Raspberry). [1] IPE mounts the filesystem as read only at startup. If you need to install some software, you remount the filesystem as read write with the command 'sudo ipe-rw'. After that, you can change the filesystem back to read only with 'sudo ipe-ro'. The great thing is, that the 'mount: / is busy" error doesn't occur. Maybe you like this feature...I think it would be really great for Cubian if there exists something like this.

[1] http://riscpi.co.uk/nutcom-services-ltd/

Kind Regards Bernhard

adaspl commented 11 years ago

You can do

echo "u" >/proc/sysrq-trigger

to remount partitions to RO. IMHO good to use when mounting partition on nand,cf (and similar) are noatime,nodiratime,noacl options. You sholud read about discard too.

ghost commented 11 years ago

It seems to me, that

echo "u" >/proc/sysrq-trigger

is not working for me. I tried the command with and without sudo, but I always get:

cubie@Cubian:/proc$ -bash: /proc/sysrq-trigger: Permission denied

Kind Regards Bernhard

adaspl commented 11 years ago

Try: sudo su then echo "u" >/proc/sysrq-trigger

shinemoon commented 10 years ago

Now I am also seeking possible way to protect the cubian from unexpected power cut... and mentioned way here is to set all filesystem to RO, but is there any way to make specified folder into rw after that ? (e..g typically, user folder?)

Updated, in my cubieboard (A10), is it possible to make some small /dev/nandc from /dev/nandb side? I tried nand-part, but failed in regression bootup with filesystem issue. (bootloader ~1M, linux ~3G, user rest part)...

5d00 3891200 nand [ 17.039023] 5d00 3891200 nand (driver?) (driver?) 5d01 1024 nanda 00000000-0000-0000-0000-000000000000[ 17.055276] 5d01 1024 nanda 00000000-0000-0000-0000-000000000000 5d02 3194880 nandb 00000000-0000-0000-0000-000000000000[ 17.073326] 5d02 3194880 nandb 00000000-0000-0000-0000-000000000000 5d03 695288 nandc 00000000-0000-0000-0000-000000000000[ 17.091283] 5d03 695288 nandc 00000000-0000-0000-0000-000000000000 No filesystem could mount root, tried: [ 17.106717] No filesystem could mount root, tried: reiserfs reiserfs ext3 ext3 ext2 ext2 ext4 ext4 vfat vfat msdos msdos iso9660 iso96s

<0>Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(93,2)