Safely removing eSATA disks

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!


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?