25

I have a question about ejecting USB flash drives in Ubuntu Xenial 16.04.

When there is still some I/O going on upon clicking the eject button, I get the message:

Writing data to (...). Don't unplug until finished.

I get the message, but what is unclear to me: How will I get notified when the writing is finished? This message seems to stick around until it is dismissed. There is no additional message that notifies me I can unplug the drive.

And it is not possible to click "eject" again to check the status, because the drive has already disappeared in the explorer.

How is the user supposed to know when the drive can be ejected? Is there a terminal command I can use? More importantly, this seems like a shortcoming of the UI.

Yaron
  • 13,453

2 Answers2

12

I have had this in the past and found a solution that works for me.

The command sync will ensure everything is written to all attached disks.

You should not need sudo sync for this unless the disk has some log files owned by root for example that also need writing.

If the sync command ends with no errors I've found it is safe to remove the drive.

Noki
  • 942
3

If the drive is already disappeared in the explorer it means it is already unmounted. Then you are safe to extract the drive whenever you want. If the warning message is still hanging around then that is a (minor) bug. Just forget it. If you want to double check, open a terminal and type "df -h" to see if it is still mounted. If I'm right it should not.

ciampix
  • 614