LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mount nightmare (https://www.linuxquestions.org/questions/linux-newbie-8/mount-nightmare-348911/)

baldy3105 08-01-2005 12:41 PM

mount nightmare
 
OK guys, every time I critisize the whole mounting thing it upsets people, but I seem to have more problems with mounting and unmounting than anything else, this really is driving me up the wall.

I type umount /dev/hda3 and its says "device is busy". Busy doing what? how do I find out what its busy doing? Because look as I might I cannot find any open program that is referencing the drive.

I have tried using -f to force the umount but even though I',m root it doesn't let me do it.

Now the command line has just locked up. If I type umount /dev/hda3 at the command line it gives me a new-line and then sits there indefinitely. This really isn't good.

I'm using knoppix 3.9 btw.

Any guidence would be much appreciated - and I apologise if this post sounds pissed off, its not directed at anyone just general frustration. :-)

Thanks

Half_Elf 08-01-2005 01:15 PM

forcing unmountign is the worst thing to do, it's a good way to crash application, or the whole system. If the kernel tell you the device is busy, it most probably is. You can use the command "lsof /dev/hdX " to find the pid of the process locking the disk.

About device is busy message...
If you "are" in the drive (mean, used "cd" to position yourself in a directory that is on the device), you need to get out first --> cd /
If an application was started from the device, you need to close/kill the application before umounting the device. Some application might hang sometime, use "ps -xa" to find out the pid of the process and "kill -9" to kill it.
If your mounted device is shared (as example using samba) and there is user on it, you may get a device busy message as well. Stop the server (/etc/init.d/samba stop as example) then unmount.

...

Mount/umount is wonderful. You have to understand that linux was first made for server. Server sometime use exotic hardwares that support hotswapping, which is really easier to manage in Unix world than in windoze. Even USB support is better in Linux atmo and I don't mention that I was doing hotswapping with "standard" IDE on Linux some time ago... the kind of trick I wouldn't even think to try in a windoze world. Linux is a server OS, not really a desktop one.

baldy3105 08-02-2005 09:45 AM

oops, OK I won't try forcing it again then:o Thats probably why the whole command line started acting up and I had to reboot.

The lsof command is exactly what I was looking for, gives me a fighting chance next time!

I was in the process of partitioning for Gentoo when this problem arose. I know, I know I'm way out of my depth but hey you look stupid drowing in a puddle, might as well do it in the ocean!!

Thank Half_Elf, it never ceases to amaze me how you guys put up with us newbies:D


All times are GMT -5. The time now is 03:23 AM.