xebian
September 12th, 2009, 06:12 AM
I'm using the following script but I'm having trouble using umount.
#!/bin/sh
## Directory /mnt/karmic already exists
sudo mount /dev/sdb1 /mnt/karmic/
sudo mount -o bind /proc /mnt/karmic/proc
sudo mount -o bind /dev /mnt/karmic/dev
sudo mount -o bind /dev/pts /mnt/karmic/dev/pts
sudo mount -o bind /sys /mnt/karmic/sys
sudo cp /etc/resolv.conf /mnt/karmic/etc/resolve.conf
sudo chroot /mnt/karmic /bin/bash
fi
After the script I'm using this with errors.
sudo umount /dev/sdb1
umount: /mnt/karmic: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
You have to un-mount first the points under it. While /mnt/karmic/proc is mounted you can not un-mount /mnt/karmic.
BTW it's preferred to un-mount point not the dev.
http://ubuntuforums.org/archive/index.php/t-1264003.html
#!/bin/sh
## Directory /mnt/karmic already exists
sudo mount /dev/sdb1 /mnt/karmic/
sudo mount -o bind /proc /mnt/karmic/proc
sudo mount -o bind /dev /mnt/karmic/dev
sudo mount -o bind /dev/pts /mnt/karmic/dev/pts
sudo mount -o bind /sys /mnt/karmic/sys
sudo cp /etc/resolv.conf /mnt/karmic/etc/resolve.conf
sudo chroot /mnt/karmic /bin/bash
fi
After the script I'm using this with errors.
sudo umount /dev/sdb1
umount: /mnt/karmic: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
You have to un-mount first the points under it. While /mnt/karmic/proc is mounted you can not un-mount /mnt/karmic.
BTW it's preferred to un-mount point not the dev.
http://ubuntuforums.org/archive/index.php/t-1264003.html
| |||
as usual, the solution seems trivial. Is there an explanation why the mount and umount are not "symmetrical" with respect to the chroot. ? in script: mount -t proc none /mnt/gentoo/proc chroot . /bin/bash -c "/root/myscript.sh; umount /proc; exit 0" #### |
http://www.unix.com/gentoo/66464-automating-chroot-mount-unmount.html