To detect newly attached drive:
echo "0 0 0" > /sys/class/scsi_host/host?/scan"
(its permission is 200, write-only only to root)
The host? reflects SATA channel number.
To safely dismount the drive:
echo 0 > /sys/block/sd?/device/delete
The sd? is hdd's device identifier.
___
Thanks to stephane kattorr@sakana.fr
0 rants:
Post a Comment