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

Re: trying to umount a chroot /dev



On Wed, Aug 22, 2012 at 01:00:22AM -0700, Ross Boylan wrote:
> On Wed, 2012-08-22 at 08:40 +0100, Roger Leigh wrote:
> > On Tue, Aug 21, 2012 at 06:46:35PM -0700, Ross Boylan wrote:
> > > I setup a chroot on a snapshot.  Part of the setup was
> > > mount --rbind /dev /mnt/chrtest/dev
> > > 
> > > I have exited the chroot and, I believe, ended the processes I started.
> > > umount /mnt/chrtest/dev
> > > gives umount: /mnt/chrtest/dev: device is busy
> > > 
> > > How can I get this to work?
> > 
> > All the answers have been good ones.
> > 
> > I just wanted to mention that if you want to do this regularly,
> > the schroot program can automatically snapshot your chroot with
> > LVM and mount the /dev (and other) filesystems.  It then
> > subsequently umounts the filesystems and deletes the snapshot.
> > 
> That sounds a lot like what I'm trying to do, including the snapshot.
> Does schroot do any special tricks to umount dev?

No.  It just recursively umounts every filesystem in the chroot,
depth-first.  For mounting, it just uses a regular fstab, so you
can mount whatever you like.  The only difference is that the
mountpoint has the chroot path prefixed to it, so you can mount
filesystems outside the chroot (like /home) inside it.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800


Reply to: