Linux – How to check if unmount of USB device is completed

linuxusb device

I once unmounted an USB device using Ubuntu or Debian file manager, and when the icon next to the drive that shows it is mounted disappeared I immediately pulled the USB device out. Turns out that Linux was still writing some data on the USB device on the time I pulled it out.

Is this a file manager specific question? Can this happen when you unmount via command-line, too, or does the shell block until the device is save to pull out?

Best Answer

You can always check if data is being written to unmounted device using iostat for example:

iostat -p /dev/sde1 1

where you specify device (/dev/sde1 in the example), and statistics refresh interval.

Related Question