Mounting a network filesystem into schroot
I'm using a network file system (AFS) and I would like to also mount it into my schroot. Adding a line to /etc/schroot/mount-defaults, with bind
or rbind
in the options didn't help: schroot always mounts the directory with bind
, and it remains empty in the chroot.
My current solution is a script that remounts the /afs directory with rbind
after the schroot has been set up.
Is there a way to make schroot use rbind directly?
# means run with root or sudo
1. Create a mountpoint
# mkdir /mount/point
2. Mount /proc /sys /dev to chroot
# mount -o bind /proc /mount/point/proc
# mount -o bind /dev /mount/point/dev
# mount -o bind /dev/pts /mount/point/dev/pts
# mount -o bind /sys /mount/point/sys
3. Copy resolv.conf to networking
# cp /etc/resolv.conf /mount/point/etc/resolv.conf
4.Open bash in chroot
# chroot /mount/point /bin/bash
5. Do what you have to do and then exit chroot
exit
Also see: http://fermilinux.fnal.gov/documentation/tips/mount-bind-chroot