[Discuss] best way to automount removable SATA drives

Rich Pieri richard.pieri at gmail.com
Sun Jul 3 11:36:03 EDT 2016


Hot plug SATA isn't intended for frequent swapping. It's there for
servers that need to occasionally swap out failed devices without full
shutdowns. If you intend to swap drives frequently then use USB or
eSATA. These were designed with frequent swapping in mind. udev will
have something to say about USB drives. It may have something to say
about eSATA drives if the eSATA controller is capable of informing the
kernel of changes. My N40L's controller is not so I have to tell the
kernel to scan the SCSI interfaces when I swap drives:

  for host in /sys/class/scsi_host/*; do
    echo "- - -" >/sys/class/scsi_host/`basename ${host}`/scan
  done

and to detach an eSATA device (where the device is "sdf" in this example):

  echo "1" >/sys/block/sdf/device/delete

But for SATA drives? Just leave them plugged in with their spindown
times set to something reasonable so that they aren't spinning unless
they're in use (hdparm). Maybe have the backup drive mounted and
unmounted explicitly by the backup system.

-- 
Rich P.



More information about the Discuss mailing list