The best way to do this is with a udev
rule. Add a file to /etc/udev/rules.d
with a rule that looks something like this:
ACTION=="add", SUBSYSTEM=="block", ENV=="scsi", ENV=="xxx", ATTR="noop"
Obviously you should replace xxx
with the correct serial number for the disk in question. You can find that, and other attributes you could match on, with:
udevadm info --path=/sys/block/sda --query=property
The advantage of using udev
to do this, and matching on attributes like the disk serial number, is that it won't matter if it doesn't always appear at sda
.