Embedded: Need a write partition that survives boot
-
I'm installing pfsense on 4 or 8 gig CF cards. I have plenty of space even after after installing perl, XML::Simple and wget. Good thing since I need a cache for around 6 months some numerical data. Not tons of stuff so wear isn't an issue.
The simple answer would be to mount the / partition as rw all the time, but I fear parts of the OS might start writing and wear out the CF. If I'm wrong about the OS wearing out the CF card, then mounting it rw would be fine. It seems unlikely that it's safe since the partition would be mounted rw if it were safe:)
I'd like to take some of the / partition and divide it so I have a rw area. How do I do this?
http://69.64.6.24/index.php/Resize_Embedded_Flash_Image kind of discusses this, but it also says that it doesn't work post 1.2.3.
I'm quite rusty on my *BSD sysadmin skills so I fear I need a detailed answer:(
Thanks,
Sandra
-
What you are asking really isn't possible, not easily anyhow.
If you want to forego upgrades, you could use the alternate slice to hold data as RW, but I wouldn't recommend that really.
Most bits of the system are tamed in NanoBSD/Embedded so that they won't write willy-nilly to the CF. If something were trying to write and failed, it would toss errors not just silently fail.
Some people have neutered the conf_mount_ro() function to make it a no-op, but again, not something anyone would really recommend.
Keep plenty of backups and an eye on the issues, you can do whatever you want, but it wouldn't be supported :)
-
Thank you for the reply. It sounds like neutering the conf_mount_ro() function is what I need to do. It also sounds like it will probably be ok since all the writes to the CF will be my own.
I need this CF to last for about 1 year. Almost certainly not longer than that. If I'm understanding the reply properly the CF wear will be exclusively from my own processes.
Can you explain how one neuters conf_mount_ro()? Do I just comment out the conf_mount_ro() line in /etc/rc.conf_mount_ro()?
Thanks,
Sandra
-
Can you explain how one neuters conf_mount_ro()? Do I just comment out the conf_mount_ro() line in /etc/rc.conf_mount_ro()?
No, that isn't enough. Lots of places call that function directly, not by executing the rc script. You need to find the actual function definition for that, and disable the parts which actually set the filesystem read-only.
( If it sounds like I'm being vague, I am, as I wouldn't want someone to do this unless they knew enough to figure out the rest :) )