On Tuesday 10 August 2010 06:26, Richard Troth wrote:
>On Mon, Aug 9, 2010 at 02:37, Leland Lucius <[email protected]> wrote:
>> For you "shared root crazies" out there, how did you get /etc to unmount
>> during shutdown? (on SLES10)
>
>Just kidding. Actually, the trick is to get rid of /etc/mtab. Also,
>as you already noted in your followup, remounting RO is sometimes
>sufficient.
Or, change your umount command to use the -n option, so it doesn't attempt to
write to /etc/mtab at all.
I ran into all these problems a few years back when making my Provisioning
Expert product automate all this shared-root stuff. Here's another trick:
put /etc/{fstab,zipl.conf,passwd,shadow} on the root filesystem because these
are often needed before you get to the point of mounting a read-only /etc.
When you do, the R/O /etc hides those file and processes begin to read them
from the new, R/O filesystem. With this trick, the files are there even when
the /etc/filesystem is not, so the boot and shutdown scripts before and after
you've mounted or unmounted /etc.
You can also play games with having /etc/fstab be different on the /etc
filesystem than on the root filesystem, if you want to have different
filesystem layouts on different instances of Linux. But that can get messy
pretty quickly. I ended up controlling that kind of thing with a pre-init
script that runs before /sbin/init to take care of differences between
instances.
BTW: We ended up doing shared-root a bit differently, because we wanted to
have shared filesystems but also wanted / itself to be writable so we could
create mount-points for new filesystems as needed. So we made the filesystem
containing / writable, and put all of /bin, /boot, /lib, /lib64, /sbin on a
read-only filesystem and bind-mounted those directories onto the writable
filesystem. This gives us more flexibility to make changes as user needs
evolve over time. But it's the same basic idea.
- MacK.
-----
Edmund R. MacKenty
Software Architect
Rocket Software
275 Grove Street · Newton, MA 02466-2272 · USA
Tel: +1.617.614.4321
Email: [email protected]
Web: www.rocketsoftware.com
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/