This process allows to map a specific device to a constant device-node, located in /dev, by using udev rules. This can then be used in fstab, among other places, to ensure that the device can be mounted with a unchanging device-node--ideal for desktop shortcuts and other mounting operations.

This article focuses on USB devices and was copied almost verbatim from the Gentoo wiki, later supplemented with additional hints.

Make fstab entry

Options nodev, nosuid, and noexec are unnecesary; they are stated for security reasons only. Additionally, depending on your locale preferences, add codepage and iocharset options (such as codepage=866,iocharset=utf-8) in order to be able to display non-Latin file-names correctly.

Now, root and users who belongs to the storagegroup can mount the USB device by:

mount /mnt/usbdrive

To allow a non-root user to access to USB devices, add them to the storage group:

# gpasswd -a username storage

Restart udev

To load the updated rules, run:

# udevadm control --reload-rules

Examples

Here are some mapping and mounting examples. This system's devices sometimes made nodes as sda or sda1 so I two rules for each needed to be specified, which aid "device not found" problems. The sda node is also needed for disk-level activities; e.g., fdisk /dev/sda.

This always maps a specific USB device (in this case, a pendrive) to /dev/usbpen, which is then set in fstab to mount on /mnt/usbpen:

Note the order of the lines. Since all the USB keys should create the /dev/sd<a||b> node, udev will first check if it is a rules-stated USB-key, defined by serial number. But if an unknown USB-key is plugged, it will create also create a node, using the previously stated generic name, "otherkey". That rule should be the last one in rules file so that it does not override the others.

This is an example on how to distinguish USB HDD drives and USB sticks: