Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Normally I can right-click on the desktop icon for this external drive and unmount it, and all is good. Today when I try that, I get the message "can not unmount, an application is preventing it". When I try to unmount with the command line I get message the the device is busy.
There are no applications open, and I can see nothing running when I open my system monitor. I know from past experience if I turn off the PC without unmounting properly, I will end up with broken links I have made on this drive, which leads to much work redoing all that.
Any ideas what I can do to safely unmount this drive?
First thing, make sure you aren't using a directory on that disk as a current working directory. (If so, cd out of it.)
Otherwise try a "lazy" unmount using the -l option. (My guess is you have to do this as root, so put a sudo command in front of it. I think if you then power down the machine normally, everything should be OK.
Lazy unmount. Detach the filesystem from the filesystem hierar-
chy now, and cleanup all references to the filesystem as soon as
it is not busy anymore. This option allows a `busy' filesystem
to be unmounted. (Requires kernel 2.4.11 or later.)
You can also kill whatever is accessing the directory like this (as root, of course):
fuser -k [directory] (for example, fuser -k /home/username)
Of course, this won't work if umounting is failing simply because you are still inside that directory; as pointed out, above, a "cd" will take you out of the external drive and back to your home directory.
This is what I did, and what results I got. The final command, when I typed it correctly, seems to have unmounted the external drive. FYI, I did not have any directories open, so still not sure why I was having the problem.
Thanks for the link to the Man page with the descriptions of umount. Very helpful. I will have to spend some time on that page. This is not the first time someone has referred me to a great page like that on LQ.org that I did not know existed.
Thanks for the help. Now I will reboot, and see if all is OK with that drive.
The lazy umount did the trick for the external, though the PC would not shut down. I had to unplug it, then boot up, but the external drive and links survived, so I am happy.
though the PC would not shut down. I had to unplug it
That sounds like a bug. You might want to report it if nobody else has. The Ubuntu website has info about reporting bugs.
Quote:
Thanks for the link to the Man page with the descriptions of umount.
FYI, you should have a set of man pages on your local machine as well. To view the page for mount (for example) you would open a terminal window and type:
Code:
man mount
Most of the CLI commands should have a man page you can access that way.
Last edited by blackhole54; 07-23-2007 at 01:30 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.