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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.