umounting a drive that nothing is using but is busy
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
umounting a drive that nothing is using but is busy
i have a usb thumb drive that i mounted and did stuff with, then when i went to umount it it said it was busy (showed twice) i did lsof and fuser on every file on the drive including the mount point itself and all devices (sdb and sdb1) in /dev related to the device, everything said nothing was using it, so i decided to go into single user mode, and it was still busy, i eventually did a umount -l and that said it umounted it, but i don't think did it the correct way (the man page says that just removes it from the file system without actually umounting it all the way), then i pulled the drive out and haven't seen any problems but was wondering what to do if this happens again, is it right to just umount -l and then putt the drive out, or should i try something else?
You weren't cd'd into the directory it was mounted to were you? Say you mount it to /mnt/usbdrive and nothing was accessing any files on it. But say you cd'd into /mnt/usbdrive so it was your present working directory, you will then get a "drive busy" error when trying to umount it.
yea, i realize that could happen so to verify that i was using fuser right i cd'd to the directory and ran it again, that time i saw 1 PID of bash, i then closed that terminal and fuser once again started reporting that nothing was using anything there
... but was wondering what to do if this happens again, is it right to just umount -l and then putt the drive out, or should i try something else?
If you have an LED on the thumbdrive that indicates it's in use, obviously wait until the LED has gone off. Then you could try forcing write of anything in buffer that hasn't made it to the device yet with the "sync" command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.