Unable to umount union-parts after umounting unionfs

From: Philip Paeps (philip_at_freebsd.org)
Date: 06/22/05

  • Next message: Philip Paeps: "Re: acpi_fujitsu not working"
    Date: Wed, 22 Jun 2005 08:53:57 +0200
    To: freebsd-current@freebsd.org
    
    

    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
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Philip Paeps: "Re: acpi_fujitsu not working"

    Relevant Pages

    • Re: Weird behaviour umount on NFS disk
      ... For the mounting I use this script: ... > just three times an 'umount': ... I could mount and unmount the ... The same thing happens when I try to unmount them manually. ...
      (freebsd-questions)
    • Re: Cannot umount any device, Mounting works ok
      ... and actually cdrom works like it should - it mount on clicking ... but still no change: umount: only root can unmount... ... But let's focus on floppy and nfs, cuz with CD I can hadle it the way it ...
      (comp.os.linux.misc)
    • [SLE] Cant unmount anything
      ... It seems with Suse 9.1 that anytime I mount something I cannot ... umount: /mnt: device is busy ... and won't unmount. ...
      (SuSE)
    • Weird behaviour umount on NFS disk
      ... I could mount and unmount the directories without any problems. ... The umount command hangs when trying to unmount a disk but when I cancel the umount df shows that the disk is unmounted. ...
      (freebsd-questions)
    • Re: Disk sync at shutdown and fusefs filesystems
      ... The point in synch umount is that you don't need to wait for an ad hoc ... (Implementing the appropriate synchronization ... but also never unmounted at shutdown before. ... unmount), is capable of making the unmount stuck (which is easy to ...
      (freebsd-hackers)