Sometimes, hard-disks (HDDs) have hiccups. This post mentions some common steps I use to get out of such situations.

  1. Check if you indeed have a HDD problem. A common symptom is if touch test or simple I/O commands like that hang up and cannot be killed. Such processes show up with a “D” status in htop, and they cannot be interrupted with even with SIGKILL. You will also not be able to umount the disk.

  2. If you reboot the computer at this stage, it will get stuck in an fsck check while booting and never get past that. So the best is to comment out the HDD’s entry from /etc/fstab before rebooting.

  3. If you forgot to do that, Ubuntu will usually put you into a root shell after showing something like “Welcome to emergency mode”. Use this to comment out the fstab entry for the HDD reboot.

  4. Now you should be in a working environment with the HDD plugged in, but not mounted.

  5. Find out the drive device (e.g. /dev/sde1) using sudo fdisk -l.

  6. If it is an ext4 disk, use the fsck tool to fix it.

  7. If it is an NTFS disk, use sudo ntfsfix <device>. Although, as mentioned here, that is only a temporary fix.

  8. The more appropriate fix is to use chkdsk.exe on a Windows computer: chkdsk /r <DRIVE LETTER>:. Note: It seems like chkdsk.exe assumes the entire disk is full while estimating the time for fixing, so don’t be scared if it estimates a crazy long time. Things go much faster for the empty sectors of the HDD.

  9. Uncomment the HDD’s entry in /etc/fstab, and if you fixed it correctly, you should be good to go!

(page source)