[CS-FSLUG] Things that bug me about Linux...

Bradly McConnell bradly.mcconnell at gmail.com
Sun Mar 6 22:49:04 CST 2005


On Sun, 06 Mar 2005 22:35:52 -0600, Tim Young <Tim.Young at lightsys.org> wrote:
> A process is still locking something on the mount.  From a command-line run
> the following command to determine which process is locking the directory: 
> 
> (assuming /dev/hdb3 was mounted on /mnt/hdb3) 
> # fuser /mnt/hdb3 
> 
> Then you can do a: 
> # pstree -p | grep [number returned from command above] 
> 
> For example, I might do: 
> # fuser /mnt/hdb3 
>   5682 
> # pstree -p | grep 5682This should give you some information as to what is
> still using the mounted partition.  Quite likely you just have a widow up
> that is looking at the files or something like that. 
> 
>     - Tim Young 

Another option is to run "lsof" to see what files are still being
accessed.  Since most Unix derivatives don't actually write the file
at the exact time when it tells you it was written, unmounting the
drive is very important.  That is the point when the final "bits" (for
lack of a better term) are written to the disk.  With a journaling
filesystem, your chances of recovery are better, but it's still risky
to simply remove the disk.  The files are basically queued to be
written, and then written as the kernel allocates the time slots. 
Take for example a simple cp from one drive to another.  Rather
quickly the system tells you it's complete, but depending on the file
size, you can take a look with lsof, and see that the file is still
being transfered.  You can also watch the filesize change over a
period of time, and see that the file is actually being copied in the
background, and not just when the command is executed.

> timbrown at ichristian.com wrote: 
> Here's  a question I've been meaning to ask for some time... 
> 
> Say I put a second drive in the computer to move data over. Let's assume 
> it's  /dev/hdb3 for a name. 
> 
> I configure it through Yast partitioner, then create an icon on my desktop. 
> It works fine. THEN when I'm done with it, I try to unmount it..."Only root 
> can unmount /dev/hdb3" Ok, I understand that. 
> 
> But I go to terminal and type umount /dev/hdb3 AS SU and it returns "can't 
> unmount, drive is busy". BUSY. BUSY??? How is it busy??? I'm not using it!!!
> 
> So, I just power down, unplug the thing, boot up, get the inevitable console
> prompt, run yast, then pico fstab to remove the ref to the drive. 

Bad idea - see above.




More information about the Christiansource mailing list