How do you know if it is safe to remove a usb

Walter Lapchynski wxl at ubuntu.com
Mon Jan 12 15:38:43 UTC 2015


On Jan 12, 2015 6:33 AM, "Linda" <haniganwork at earthlink.net> wrote:
> so in PCManFM how do you know when it is done writing the content that
was cached and is actually safe to remove the usb drive?  Is it when the
drive disappears from the file list?

If you use the `mount` command, it should tell you whether or not the drive
is assigned a location in the file system (outside of /dev). If it is, it
is opened for writing (though not necessarily writing). If that's the case
`umount` will either remove it from the file system or it will fail because
something else is using it to it. Use the exit status of the command to
figure it out. There are lower level commands like `lsof` and `atop` to
more specifically answer the questions of whether or not it is being
written to and what is being written. I'll leave that as an exercise for
the reader.

@wxl
Lubuntu Release Manager, Head of QA
Ubuntu PPC Point of Contact
Ubuntu Oregon Team Leader
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/lubuntu-users/attachments/20150112/92718d33/attachment.html>


More information about the Lubuntu-users mailing list