5

Is there any way to safely remove any external disk connected via eSATA? Disks make an ugly noise when unplugged, even if there are no mounted partitions I found this little command somewhere, and it seems to shutdown the disk.

sdparm --flexible --command=stop /dev/sdb &>/dev/null

But, just when it powers off, it starts working again.

Any clue?

cocomac
  • 3,824
Padlite
  • 103

2 Answers2

9

Try echo 1 > /sys/block/<disk>/device/delete. You'll need to be root to do this.

On my system, this powers off the eSATA disk and deallocates its block device. The disk stays powered off and I can disconnect it at my leisure.

Note: make sure you have unmounted any filesystems first to prevent data loss!

Robie Basak
  • 15,910
1

There is a procedure when you want to remove SATA disks.

First umount any partitions, and then flush the I/O buffer by entering

blockdev --flushbufs /dev/sd?

then remove the drive by entering

echo 1 > /sys/block/sd?/device/delete

I guess it can work for eSATA as well.

A question still remains in my mind: are the heads are safely parked in the landing zone with this procedure?

ianinini
  • 140