Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I've set up debian to run in a read only envoirement. /var and /etc are ram drives. The way I do this is to run a boot script right after the usual boot mounting that mounts a ram disk(tmpfs specifically) on /etc and /var. I then mount the root partition a second time on /mnt/sda1 and copy over the contents from /mnt/sda1/etc to /etc and the contents from /mnt/sda1/var to /var. My problem is that mounting the same device twice has unpredictable results. Sometimes it works, sometimes it returns "mount: /dev/sda1 already mounted or /dev/sda1 busy"
I'm thinking the best way of fixing this issue is to not mount the root filesystem a second time, it's an ugly solution anyway. Is there anyway to access /etc on the device /dev/sda1 after a ram disk has been mounted on /etc?
Unfortunatly I haven't found a way to get /etc off the root partition. this is because the debian boot sequence reads /etc/fstab to know where specific mounts are located. It can't read in /etc/fstab if the location of /etc isn't known yet.
So my full debian install is on one giant root partition all together, some directories are then replaced by ramdrives and filled by the files that were in those directories.
But after mounting a ramdrive on /var I can't find a way to get to the original files that are on the harddrive in /var without unmounting the ramdrive first, which would destroy the ramdrive.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.