2

The concern started with whether a portable HDD will be physically damaged or degraded if unplugged when the disk is still spinning. I understand that I can force unmount the device on Linux. However, let us suppose I am using the smartctl command running a self test on the drive. Now, the drive is not mounted, so the system suggests it is safe to be unplugged. So if one forget there is still a test running, one may unplug it accidentally while the disk is still spinning.

Two questions:

  1. Is there a command that stops all reading/writing activities on the portable HDD and let the head park properly?
  2. Will unplug while spinning physically damge or degrade the HDD in use?

1 Answer 1

2

Is there a command that stops all reading/writing activities on the portable HDD and let the head park properly?

# shutdown now

Will unplug while spinning physically damge or degrade the HDD in use?

It can, if the read/write head scratches the drive platter. Usually, it takes a good jolt to cause that to happen, which is why some modern include sensors to protect against this. It's also why a lot of portable drives are SSDs, which don't have moving components that can fail (like disc platters).

Data corruption from unexpected power loss in the middle of a write operation can be prevented by using the df command to make sure the drive isn't mounted (use umount /path/to/mountpoint to unmount), and fuser -vam /dev/sdb* (replacing /dev/sdb* with the block device assigned to the drive in question) to confirm nothing else is using the relevant block device. If the drive isn't mounted or in use, you can safely unplug it.

3
  • But doesn't shutdown also cut the power supply? Is it possible that the power is cut while IO is still on ongoing by the command shutdown by the shutdown command? Commented Dec 22, 2016 at 5:54
  • Yes, it does. No, that is not possible. Commented Dec 22, 2016 at 6:09
  • Specifically, lxr.linux.no/#linux+v3.13.5/drivers/base/core.c#L1946 Commented Dec 22, 2016 at 6:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.