You are not logged in.
Pages: 1
I am trying to do things with a USB memory stick. One purpose is to boot from it and use utilities on it to do various things on a machine.
So far I have got a bootable USB drive, by installing Arch to it.
However I am running into problems.
I have taken the drive out and mounted it in another Arch Linux box to put on some files, but now when I try and umount it I get "device is busy" and the drive will not dismount. I am concerned that the device is still being written too and do not want to leave corrupted files about.
Is there a way to ensure that all files that should have been written to the USB stick have been. Is there a way to make sure no files are cached?
Kind regards
Benedict White
Offline
Have you tried running "sync" and then unmounting?
Happy Hacking!
Twitter: http://twitter.com/bobbyrburden/
Website: http://codebutcher.com/
Offline
I have now, many thanks for the suggestion!
Alas, it did not work
It still reports device busy when I try to umount.
Kind regards
Benedict White
Offline
If you have booted on a USB drive, you cannot unmount it because it is "busy" as the boot device.
Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit! X-ray confirms Iam spineless!
Offline
lilsirecho wrote:
If you have booted on a USB drive, you cannot unmount it because it is "busy" as the boot device.
Yes, I know, in this case it is not the boot device.
That said I do need to make sure any writes are committed before halting the system when it is the boot device.
Kind regards
Benedict White
Offline
lazy and/or forced unmounting (umount -l -f) gets rid of/overrides those warnings, and won't give any more access to it, but if something needs to be written to, too bad for the program.
If it's busy, you can check what's using it with lsof. If you've booted from it, though, lots of critical stuff is going to need access (which won't be happy or stable when you remove access).
edit:
sync
is enough to ensure that all write caches are flushed (so you don't loose written data).
Last edited by vogt (2008-03-10 21:35:18)
Offline
... and be aware that every open shell that is in the mounted dir or a subdirectory of it keeps the device busy. This is also the case if you're in a "su" environment and the user which is logged in in that shell is still in that dir. Sometimes it's that easy.
Haven't been here in a while. Still rocking Arch.
Offline
stupid solution but make sure you're not trying to umount while your still accessing it (cd out of /media/usb/ or whatever)
Offline
vogt, Many thanks for the lsof tip.
I get the Doh! award, I was in a directory on the stick!
Kind regards
Benedict White
Offline
Sigi and czar. I was in a directory on the stick!
Kind regards
Benedict White
Offline
Pages: 1