On Tue, Sep 20, 2016 at 08:03:46PM +0000, ch_e...@yahoo.com wrote:
> Hi
> Could someone please advise me the best way to ensure a particular hard disk 
> (SATA) always appears at a specific device node, i.e how can I be sure 
> /dev/sdb for example is always going to refer to a specific drive even if 
> others are added or removed?
> UUIDs only apply to partitions, is there no way to do a similar thing for a 
> physical disk?
> I have some existing partitioned and formatted disks in a server which I want 
> to plug into another machine and move the services over to a VM

It's possible, although unless you're trying to change device's
permissions permanently you'd better use those /dev/disk/by-id symlinks

What you'd need is a custom udev rule like this (in a single line):

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id -g -d $devnode",
RESULT==<UUID>, NAME=<devicename>

Where device UUID can be obtained by:

/lib/udev/scsi_id -g <your_block_device_here>

Another dirty hack (as it's not intended to be used this way) whould be
configuring multipathing with a single path representing your disk


Reply via email to