How to hot-swap SATA drives in Linux

If you want the drives to be automounted and your automount system uses pmount to do the mounting (pmount allows mounting by a normal user without an entry in /etc/fstab) you may need to edit /etc/pmount.allow. If the drives are seen as non-removable, which SATA hard disks usually are, pmount will refuse to mount them unless you add the device name to /etc/pmount.allow, for example.

echo ‘/dev/sdb1’ >>/etc/pmount.allow

echo ‘/dev/sdc[123]’ >>/etc/pmount.allow

echo ‘/dev/sdd*’ >>/etc/pmount.allow

The first allows one particular partition to be mounted by pmount, the second example permits three specific partitions on a drive, while the third lets through every partition on a drive. Note the use of single quotes to stop the shell interpreting the wildcards.

via How to hot-swap SATA drives in Linux | TuxRadar Linux.