5

I have an old disk that often gets stuck in some form of loop, and often I need to perform a full reboot to get it "unstuck", whereupon I had found out about the hdparm -w command. However, its manpage lists this command as dangerous:

-w

Perform a device reset (DANGEROUS). Do NOT use this option. It exists for unlikely situations where a reboot might otherwise be required to get a confused drive back into a useable state.

What are the dangers, and do they exceed the dangers of data loss due to a hard-reboot?

slhck
  • 235,242
nanofarad
  • 719
  • 1
  • 9
  • 23

1 Answers1

1

You don't want to issue the command while any filesystem using that drive is mounted, or a read/write operation is in progress, obviously.

However, if your drive got stuck during a read/write operation, and a kernel operation is blocked as a result (the involved process will be in D state according to ps) I imagine you might cause an unexpected condition (i.e. possibly a kernel panic) if you send this command.

You also probably might do something weird to the drive if you issue this command while the drive is busy doing something else (like a firmware update), though I don't know that for a fact. Some drive firmwares may have bugs that cause weirdness in this case.

LawrenceC
  • 75,182