You don't.

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.

***** details *****

To get /etc unmounted, you need to make /etc/mtab a sym-link to
something outside of that filesystem.  Sym-linking /proc/mounts as
/etc/mtab is the most common way to do this.  'umount' needs to be
able to do its work without the deadlock of "mtab" being open when it
makes the system call.  So good practice is to replace /etc/mtab as a
stand alone file with a sym-link to /proc/mounts.

There's a bigger picture: avoid open files in /etc altogether (when
trying to unmount it).  (Your points #2 and #3 in your "nevermind"
post also sugggest this.)  To that end, while FHS and LSB say that
your init scripts should go under /etc/init.d, there's nothing
stopping you from making that be a sym-link to /sbin/init.d.  (Or any
other directory outside of /etc, but there is historical precedent for
that one.)  YOU MAY NEED to change things like /etc/inittab to point
to the "real" location for some things.  For example, if you're really
running /sbin/init.d/halt instead of /etc/init.d/halt during shutdown,
things may go better.

LVM really has no problem with RO root.  What it has a problem with is
not being able to write lock files (because the FS where it wants to
put its locks is RO).  Look in /etc/lvm/lvm.conf and make a suitable
change.

If you're going to hack your own tiny RW root, you might want to redux
a little and craft your own INITRD instead.  Maint gets to be a
problem.  (From my perspective, reconciling /etc with maint is less of
a pain; but not all agree.)  CONVERSLY, for virtual environments, the
current INITRD use ... well ... it seems inelegant or at least
inconsistent.  (Virtual systems and embedded systems have some common
attributes.  INITRD is not the only way to get bootstrapped.)

-- R;   <><





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)
>
> I've been tinkering around with this and everything works well except
> that it won't unmount /etc during shutdown since it's in use by the "rc"
> script(s) when boot.localfs runs.  And since /etc is a read/write mount,
> I'd rather not pull the rug out from under it.
>
> Well, I'm actually fibbing just a little since I did find a way to do it
> cleanly, but it's not pretty.  So I was hoping to either find out I was
> doing something wrong or if it's just the way it is.
>
> Thanks,
>
> Leland
>
> ----------------------------------------------------------------------
> 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/
>

----------------------------------------------------------------------
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/

Reply via email to