Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jun 2005 08:53:57 +0200
From:      Philip Paeps <philip@freebsd.org>
To:        freebsd-current@freebsd.org
Subject:   Unable to umount union-parts after umounting unionfs
Message-ID:  <20050622065357.GA694@loge.nixsys.be>

next in thread | raw e-mail | index | archive | help
When playing with union filesystems this morning, I noticed that it's not
possible to unmount the directory mounted on union cleanly, even after the
union has been cleanly unmounted, once you've read from the union:

Setup:

# touch fs1 fs2
# mkdir tstfs
# mdconfig -a -t vnode -f fs1 -s 16M
# mdconfig -a -t vnode -f fs2 -s 16M
# newfs /dev/md0
# newfs /dev/md1
# mount /dev/md0 tstfs/
# mount /dev/md1 /mnt
# mount -t unionfs /mnt tstfs/

Trying to umount /mnt now fails as expected:

# umount /mnt
umount: unmount of /mnt failed: Device busy

Unmounting after the union has been unmounted without anything having been
read from it or written to it, is no problem either:

# umount tstfs/
# umount /mnt

When something has been written to the union, but nothing has been read from
it, there's not problem either:

# touch tstfs/foo
# umount tstfs/
# umount /mnt

When something has been read, however:

# ls tstfs/
.snap/ foo
# umount tstfs/
# umount /mnt
umount: unmount of /mnt failed: Device busy

Strangely, when an 'empty' union is read from, there's no problem unmounting
it.  It's only when it's read when there's something on it.  In other words,
from a clean setup:

# ls tstfs/
.snap/
# umount tstfs/
# umount /mnt

But (continuing on the clean setup):

# mount /dev/md1 /mnt
# mount -t unionfs /mnt tstfs/
# touch tstfs/foo
# umount tstfs/
# umount /mnt
# mount /dev/md1 /mnt
# mount -t unionfs /mnt tstfs/
# ls tstfs/
.snap/ foo
# umount tstfs/
# umount /mnt
umount: unmount of /mnt failed: Device busy

Is anyone else seeing this? :-)

 - Philip

-- 
Philip Paeps                                    Please don't Cc me, I am
philip@freebsd.org                               subscribed to the list.

  BOFH Excuse #237:
    Plate voltage too low on demodulator tube



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050622065357.GA694>