Yesterday, I had my external USB hard drive (NTFS) connected to a client's laptop running Ubuntu 18 because I wanted to get some data off of it.
When I was done, I would normally type umount /media/dtweed/Seagate-4TB
at the command prompt and then unplug the drive once the command prompt came back. But in this case, I had already closed all of my terminal windows, so I right-clicked on the drive icon on the desktop and selected "Safely remove hardware", and when the icon disappeared, I unplugged the USB cable. This has always worked fine on my own systems (up through Ubuntu 16), but apparently not here. I immediately got a pop-up saying "unable to stop /dev/sdd", and now the filesystem is corrupted.
Needless to say, I'm rather upset about this. It's almost a terabyte of data — not irreplaceable, but it's going to cost me several days to collect it all together in one place again if I can't repair the filesystem.
So, what is the correct way to initiate disconnecting an external drive and be sure that the system is finished updating it?
Use Safely Remove Drive via Nautilus (aka Files)
I did some tests with Ubuntu 18.04 LTS using the default Natilus app. I copied a 10GB file from the internal drive to an external drive. As soon as the file copy operation was completed I safely removed the external drive either from the desktop icon or from within Nautilus.
Unmounting the drive by pressing the eject icon on the Nautilus gives similar results as above. The desktop icon vanishes. The icon on the left panel of Nautilus remains. There is one notification: Unmounting XXXX. Disconnecting from filesystem. However, there is no notification when it is safe to remove the drive.
Right clicking the name of the external drive in the left panel of Nautilus and selecting "Safely Remove Drive" gives better results:
First, even though the desktop icon for the external drive vanishes immediately, the icon in Nautlus does not.
Second, there is a notification that says: Writing data to XXXX. Device should not be unplugged.
Third, When it is safe to remove the drive the icon from the Nautilus also goes away. Plus, there is a second notification: XXXX can be safely unplugged. Device can be removed
If there is not a whole lot of data to be written to the external drive, then you don't get the first notification.
Hope this helps