Ubuntu – Safely removing USB 3.0 drive freezes the system – why and how to fix

16.04diskkernelusbusb-drive

I'm running Ubuntu 16.04.5 LTS amd64 with 4.4.0-140-generic Linux kernel.

After one of recent upgrades I got new unexpected behavior – when I

  • select Safely remove drive in Caja
  • click Power off the disk button in GNOME Disks

for my USB 3.0 external drive – the Ubuntu system freezes without any error messages. I can loose unsaved documents and other personal data.

Why this happens? How should I fix this problem?

Best Answer

This is known problem with latest 4.4.0-139-generic, 4.4.0-140-generic and 4.4.0-141-generic Linux kernels.
On launchpad it is known as bug 1803929 (currently confirmed by 17 users).

The temporary solution is to use 138 ( 4.4.0-138-generic ) kernel.

So I have deleted 139, 140 and 141 kernels by:

sudo apt-get purge linux-image-4.4.0-139-generic linux-headers-4.4.0-139-generic \
linux-image-4.4.0-140-generic linux-headers-4.4.0-140-generic \
linux-image-4.4.0-141-generic linux-headers-4.4.0-141-generic
sudo apt-get install amd64-microcode intel-microcode thermald
sudo apt-get autoremove

and wait for 142+ kernel with the fix.

Warning: do not upgrade kernel to 4.4.0-139-generic, 4.4.0-140-generic or 4.4.0-141-generic if you need to keep your data safe on USB 3.0 external disks. Subscribe to the bug 1803929 and after the confirmation of the fix - install newest kernel back with sudo apt-get install linux-image-generic linux-headers-generic .