Recovering from "uncleanly unmounted" loop devices

knighttof3_at_yahoo.com
Date: 07/21/05

  • Next message: noi: "Any repair rar file programs for Linux"
    Date: 21 Jul 2005 14:27:32 -0700
    
    

    Hi,
      I had mounted ccd1 and cd2.iso files onto cd1_dir and cd2_dir
    directories manually, using -o loop option. While doing 'umount' I did
    not give the -d option. (I did this twice!)
      How can I clean them up and reclaim the /dev/loop* devices?

    myhost /dev % foreach i ( 0 1 6 7 )
    > sudo losetup -d /dev/loop$i
    > end
    ioctl: LOOP_CLR_FD: Device or resource busy
    ioctl: LOOP_CLR_FD: Device or resource busy
    ioctl: LOOP_CLR_FD: Device or resource busy
    ioctl: LOOP_CLR_FD: Device or resource busy
    myhost ~ % ps -ef | grep loop
    root 16340 1 0 Jul19 ? 00:00:03 [loop0]
    root 16342 1 0 Jul19 ? 00:00:03 [loop1]
    root 3606 1 0 12:13 ? 00:00:00 [loop6]
    root 3608 1 0 12:13 ? 00:00:00 [loop7]
    naren 9375 4082 0 13:58 pts/7 00:00:00 grep loop
    myhost ~ % foreach i (0 1 6 7)
    > sudo losetup /dev/loop$i
    > end
    /dev/loop0: [0010]:116752640 (cd1.iso) offset 0, no encryption
    /dev/loop1: [0010]:116752641 (cd2.iso) offset 0, no encryption
    /dev/loop6: [0010]:116752640 (cd1.iso) offset 0, no encryption
    /dev/loop7: [0010]:116752641 (cd2.iso) offset 0, no encryption
    myhost ~ % mount | grep cd1
    myhost ~ % mount | grep cd2
    myhost ~ % cd dir
    myhost ~/dir % sudo umount -f -d cd1_dir
    umount2: Invalid argument
    umount: cd1_dir: not mounted
    myhost ~/dir % sudo umount -f -d cd2_dir
    umount2: Invalid argument
    umount: cd2_dir: not mounted
    myhost ~/dir % sudo kill -9 16340 16342 3606 3608 # does not work!!!
    myhost ~/dir % ps -ef | grep loop
    root 16340 1 0 Jul19 ? 00:00:03 [loop0]
    root 16342 1 0 Jul19 ? 00:00:03 [loop1]
    root 3606 1 0 12:13 ? 00:00:00 [loop6]
    root 3608 1 0 12:13 ? 00:00:00 [loop7]
    naren 9405 4082 0 14:00 pts/7 00:00:00 grep loop


  • Next message: noi: "Any repair rar file programs for Linux"

    Relevant Pages

    • Recovering from "uncleanly unmounted" loop devices
      ... directories manually, using -o loop option. ... While doing 'umount' I did ... ioctl: LOOP_CLR_FD: Device or resource busy ...
      (comp.os.linux.misc)
    • Recovering from "uncleanly unmounted" loop devices
      ... directories manually, using -o loop option. ... While doing 'umount' I did ... ioctl: LOOP_CLR_FD: Device or resource busy ...
      (comp.os.linux.misc)
    • Re: rsync 10 times slower in Etch than in Sarge!
      ... `umount' completes and the device often got corrupted. ... heard that "umount" had a side effect of flushing dirty buffers to disk ... There are some intriguing references to a BLKFLSBUF ioctl that's ... (and IIRC usb devices go through the sg layer). ...
      (Debian-User)
    • Re: umount question : can i force umount ???
      ... umount2: Device or resource busy ... but i can't stop my nfs server. ... yourself on a different desktop or terminal it will be reported busy and refuse to umount? ... in retrospect we know both governments wanted the war but the people did ...
      (linux.redhat)
    • nautilus locking on cdrom w/ large file count
      ... I tried to mount it using both ide interface and ide-scsi interface (its ... After opening it with nautilus I can't umount it with a message that the ... umount2: Device or resource busy ...
      (Debian-User)