Discussion:
Conditional mounting from fstab
(too old to reply)
Micha Feigin
2008-12-24 01:50:09 UTC
Permalink
Is it possible to get conditional mounting from fstab?

I'm trying to setup an nfs server that exports it's root as read only for
nfsroot to other systems. For that to work I mount var,tmp,home etc from each
machines local disk by mounting the local disk to /local and then mounting them
using mount --bind (using the bind fstab option). This works, only it makes the
server do some circles by mounting /dev/sda1 as root, as /local and then again
double mounting home, etc, tmp,var etc.

Is there a simple way to avoid this on the server, and/or is there any overhead
to this (if there is no access overhead then I guess that there is also no
damage)

thanks
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Boyd Stephen Smith Jr.
2008-12-24 02:10:06 UTC
Permalink
Post by Micha Feigin
Is it possible to get conditional mounting from fstab?
No.
Post by Micha Feigin
I'm trying to setup an nfs server that exports it's root as read only for
nfsroot to other systems. For that to work I mount var,tmp,home etc from
each machines local disk by mounting the local disk to /local and then
mounting them using mount --bind (using the bind fstab option). This works,
only it makes the server do some circles by mounting /dev/sda1 as root, as
/local and then again double mounting home, etc, tmp,var etc.
Is there a simple way to avoid this on the server, and/or is there any
overhead to this (if there is no access overhead then I guess that there is
also no damage)
Try like this in fstab:
/dev/sda1 /.local-storage
/.local-storage/var /var (w/ bind option, later pass)
/.local-storage/tmp /tmp (w/ bind option, later pass)
/.local-storage/home /home (w/ bind option, later pass)
/.local-storage/etc /etc (w/ bind option, later pass)

I think that should do what you want.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
***@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
Loading...