Find the answer to your Linux question:
Results 1 to 4 of 4
I'm trying to run xfs_repair on my filesystem: Firstly to unmount the fs Quote: umount /myfs umount: /myfs: device is busy umount: /myfs: device is busy Quote: lsof /dev/sda -show ...
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    58

    Question umount fails with device is busy

    I'm trying to run xfs_repair on my filesystem:
    Firstly to unmount the fs

    Quote:
    umount /myfs
    umount: /myfs: device is busy
    umount: /myfs: device is busy

    Quote:
    lsof /dev/sda

    -show none ie nothing seems to be 'touching' the disk.
    confused why its still showing device is busy

    i did a force unmount then

    Quote:
    #umount -l /dev/sda

    but then when I try to run xfs_repair

    Quote:
    xfs_repair -n /dev/sda, it
    xfs_repair: /dev/sda contains a mounted and writable filesystem

    fatal error -- couldn't initialize XFS library

    lsof /dev/sda
    shows nothing ie nothing seems to be 'touching' the disk.

    Any thoughts???

    Thanks
    David

  2. #2
    Just Joined!
    Join Date
    Feb 2009
    Posts
    9
    Sorry for stating the basics but are you inside the mount at the time you try to umount?

    Have you also tried the fuser command?
    Code:
    fuser -vm /myfs

  3. #3
    Just Joined!
    Join Date
    Nov 2007
    Location
    San Diego
    Posts
    17
    You can also check for running processes:

    Code:
     ps -ef |grep myfs
    but as chrisstevens mentioned

    Code:
       fuser -vm myfs
    should show you if any files are in use.

    Also make your any other terminal sessions are not in any directory on that volume.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    There are two main reasons why umount will fail with a busy device error.

    1. A file is open on the device.
    2. A directory is open on the device - this can be due to a shell having cd'd to a directory on the device.

    Anyway, this happens to me from time to time because of these two reasons.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...