I'm trying to set a custom udev to set the /dev/sd** mount point for all 6 HDDs on my system.

I've been trying to get it to work, but it just wont. I need to get this sorted because my drives seem to randomly change messing with my links and libraries. 5 of my drives are truecrypt encrypted and as such i can`t use UUID to mount to specific points.

This is what i`ve been trying to use. Im running Ubuntu 13.04 ans have saved the file in /lib/udev/rules.d/65-persistent-hdd.rules

# These are the rules to force all drives into specific /dev/sd** slots for truecrypt mounting
KERNEL=="sd*", SUBSYSTEMS==" block", ATTRS{serial}=="3PK0R7AD", SYMLINK+="sda%n"
KERNEL=="sd*", SUBSYSTEMS==" block", ATTRS{serial}=="S1UVJ1LZ401091", SYMLINK+="sdb%n"
KERNEL=="sd*", SUBSYSTEMS==" block", ATTRS{serial}=="S1VSJ1KS202775", SYMLINK+="sdc%n"
KERNEL=="sd*", SUBSYSTEMS==" block", ATTRS{serial}=="W1F08BLH", SYMLINK+="sdd%n"
KERNEL=="sd*", SUBSYSTEMS==" block", ATTRS{serial}=="S1Y6J90SA14564", SYMLINK+="sde%n"
KERNEL=="sd*", SUBSYSTEMS==" block", ATTRS{serial}=="S13PJDWS223047", SYMLINK+="sdf%n"

So as you see, im trying to force {serial}=="3PK0R7AD" to /dev/sda, {serial}=="S1UVJ1LZ401091"to /dev/sdb, etc, etc

  • Did you eventually solve this ? (get back to me with @Cbhihe) – Cbhihe Oct 10 '15 at 14:08

I'm not 100% certain but I think the problem is SYMLINK+= will use the default /dev/NAME and only add an additional symbolic link. So you probably can't create symbolic links to devices that already exist?

Instead use NAME="sda"

From http://www.reactivated.net/writing_udev_rules.html

After you have used a series of match keys to precisely match a device, udev gives you fine control over what happens next, through a range of assignment keys. For a complete list of possible assignment keys, see the udev man page. The most basic assignment keys are introduced below. Others will be introduced later in this document. NAME - the name that shall be used for the device node SYMLINK - a list of symbolic links which act as alternative names for the device node


KERNEL=="hdb", NAME="my_spare_disk"



It's not working for me, but I'm not sure where my problem is in my udev rules as debugging doesn't show them even being processed. Hopefully this helps you

I'm trying to do the same thing and force my devices to be specific /dev/sdX and I know people wonder why do it but some people want that level of control over their devices.

Your Answer

