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

Re: How best to make nfs mounts also available in chroot env?

On Mon, 9 Jan 2006, RParr wrote:

I have installed Debian sid AMD64
and installed an ia32 chroot per instructions at

Now I am trying to restore the chroot bind mounts upon reboot.

I am running into a problem however because some of the bind mounts are to NFS
mounted "shared" directories.

It appears the NFS mounts are not made until after the local and bind mounts
are made.  This means the bind mounts are made to the empty NFS mount points
and not the actual NFS mounted directories.

Before I add my own brute-force solution to /etc/init.d I wanted to inquire if
this is a known problem and/or what the preferred, Debian-way, to fix this
mount ordering problem.

If you search for postings in the debian-amd64 under my name, you will see I
found a similar problem in getting dynamically mounted filesystems (e.g. usb
pens) available in the chroot. The solution for my problem, which ought to
work in your case as well, was: mount the NFS volumes directly inside the
chroot cage and symlink it to its place in the root filesystem, i.e. suppose
that your cage is /mycage and you want to mount a volume as /mynfsvolume and
also have it available as /mycage/mynfsvolume, then you can do:
mount -t nfs mynfsserver:/sharedfilesystem /mycage/mynfsvolume
ln -s /mycage/mynfsvolume /mynfsvolume
To make this permanent, you just need to change the mount point for the NFS
partition in fstab to be the one in the cage.

If you find my postings, you will see that I did essentially this for
dynamically mounted partitions, with the addition that I had to slightly
modify pmount to make it aware of it.



Giacomo Mulas <gmulas@ca.astro.it>

Str. 54, Loc. Poggio dei Pini * 09012 Capoterra (CA)

Tel. (OAC): +39 070 71180 248     Fax : +39 070 71180 222
Tel. (UNICA): +39 070 675 4916

"When the storms are raging around you, stay right where you are"
                          (Freddy Mercury)

Il messaggio e' stato analizzato alla ricerca di virus o
contenuti pericolosi da MailScanner, ed e'
risultato non infetto.

Reply to: