[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Conditional mounting from fstab



On Tuesday 2008 December 23 19:48:28 Micha Feigin wrote:
> Is it possible to get conditional mounting from fstab?

No.

> 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.                     ,= ,-_-. =. 
bss@iguanasuicide.net                     ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.net/                      \_/     

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: