MHR
2010-May-21 00:38 UTC
[CentOS] Can't umount flash drive because an application has it locked
This occasionally happens to me when I've been editing an OOo document that resides on a flash drive I use with one of my laptops. I've tried poking around in ps to find out which process has the drive locked, and I can't figure it out. Nothing directly refers to the flash drive except one of the hald processes, and it's just scanning the drive (I tried killing that and it made no difference). My usual sequence of events is as follows: 1. Plug in the flash drive. 2. Wait for it to appear on the desktop. 3. Start up a terminal window (which recognizes the flash drive and runs sudo to allow execute permissions on the drive). 4. Run the script that unzips the files I want. 5. Open the file with the OO writer, edit it for a while, then save and close it. 6. Update the zip archive (on the flash drive). 7. Close the terminal window. 8. Umount the drive, which fails. I've tried waiting for as much as five minutes, running sync - nothing. The last three times this happened, I had to shut down the laptop (which I was going to do anyway) in order to free the flash drive. This takes several minutes, which can be precious when I need to bag the laptop in a hurry. There's nothing in any of the syslogs. The laptop was just updates to the L&G CentOS 5.5. What am I missing? Thanks. mhr
Todd Denniston
2010-May-21 00:56 UTC
[CentOS] Can't umount flash drive because an application has it locked
MHR wrote, On 05/20/2010 08:38 PM:> This occasionally happens to me when I've been editing an OOo document > that resides on a flash drive I use with one of my laptops. I've > tried poking around in ps to find out which process has the drive > locked, and I can't figure it out. Nothing directly refers to the > flash drive except one of the hald processes, and it's just scanning > the drive (I tried killing that and it made no difference). ><SNIP>> > What am I missing? >when next it happens, you might try (note, you are playing with a root tool, it may or may not work as a normal user): /sbin/fuser -m /media/myFlashDrive/ or /usr/sbin/lsof /media/myFlashDrive/ What can be *really* frustrating, is when those commands (with any options) don't give any info, and you cant get it unmounted (granted I have not seen that since using Fedora 1 machines with DRBD as an NFS server). man fuser "-m ... All processes accessing files on that file system are listed. ..." man lsof -- Todd Denniston Crane Division, Naval Surface Warfare Center (NSWC Crane) Harnessing the Power of Technology for the Warfighter
Steven Vishoot
2010-May-21 01:34 UTC
[CentOS] Can't umount flash drive because an application has it locked
----- Original Message ----> From: MHR <mhullrich at gmail.com> > To: CentOS mailing list <centos at centos.org> > Sent: Thu, May 20, 2010 7:38:19 PM > Subject: [CentOS] Can't umount flash drive because an application has it locked > > This occasionally happens to me when I've been editing an OOo documentthat> resides on a flash drive I use with one of my laptops. I'vetried> poking around in ps to find out which process has the drivelocked, and I> can't figure it out. Nothing directly refers to theflash drive except> one of the hald processes, and it's just scanningthe drive (I tried killing> that and it made no difference).My usual sequence of events is as> follows:1. Plug in the flash drive. 2. Wait for it to appear on the> desktop.3. Start up a terminal window (which recognizes the flash drive> andruns sudo to allow execute permissions on the drive). 4. Run the> script that unzips the files I want.5. Open the file with the OO writer,> edit it for a while, then saveand close it. 6. Update the zip archive (on> the flash drive).7. Close the terminal window. 8. Umount the drive, which> fails.I've tried waiting for as much as five minutes, running sync> -nothing. The last three times this happened, I had to shut down> thelaptop (which I was going to do anyway) in order to free the> flashdrive. This takes several minutes, which can be precious when I> needto bag the laptop in a hurry. There's nothing in any of the> syslogs. The laptop was just updates tothe L&G CentOS> 5.5.What am I> missing?Thanks. mhr to me it sounds like the zip program is culprit since it might still holding onto the flash file system. did you try fuser -l on the flash drive and see what has a hold on it. just a thought.