2.2. udev device naming rules


Userspace device manager (udev) subsystem allows you to define rules for assigning persistent names to devices. These rules are stored in a file with a .rules extension.

There are two primary locations for storing the udev rules:

  • /usr/lib/udev/rules.d/ directory contains default rules that come with an installed package.
  • /etc/udev/rules.d directory is intended for custom udev rules.
참고

If a rule from /usr/lib/udev/rules.d/ is modified, it will be overwritten by the rules file of the package during an update. Hence, any manual or custom rule should be added in /etc/udev/rules.d where it is retained until removed explicitly. Before use, udev rules from both directories are merged. If a rule in /etc/udev/rules.d has the same name as one in /usr/lib/udev/rules.d/ the one in the former takes precedence.

The purpose of these rules is to ensure that storage devices are consistently and predictably identified, even across system reboots and configuration changes.

udev rules define actions to execute based on incoming events that notify about adding, changing or removing a device. This also helps to collect values for the persistent storage attributes and direct udev to create the /dev content based on the collected information. The udev rules are written in human-readable format using key-value pairs.

In the case of storage devices, udev rules control creation of symbolic links in the /dev/disk/ directory. These symbolic links provide user-friendly aliases for storage devices, making it more convenient to refer to and manage these devices.

You can create custom udev rules to specify how devices should be named based on various attributes such as serial numbers, World Wide Name (WWN) identifiers, or other device-specific characteristics. By defining specific naming rules, you have precise control over how devices are identified within the system. To create a specific custom symbolic link in /dev for a device see the udev(7) man page on your system.

While udev rules are very flexible, it is important to be aware of udev limitations:

  • Accessibility Timing: Some storage devices might not be accessible at the time of a udev query.
  • Event-Based Processing: The kernel can send udev events at any time, potentially triggering rule processing and link removal if a device is inaccessible.
  • Processing Delay: There might be a delay between event generation and processing, especially with numerous devices, causing a lag between kernel detection and link availability.
  • Device Accessibility: External programs invoked by udev rules, like blkid, might briefly open the device, making it temporarily inaccessible for other tasks.
  • Link Updates: Device names managed by udev in /dev/disk/ can change between major releases, requiring link updates.

The following table lists the symlinks available in /dev/disk.

Expand
Device typeNonpersistent Name (Kernel Name)Persistent Symlink Names

Real Devices

nvme (Non-Volatile Memory Express)

/dev/nvme*

/dev/disk/by-id/nvme-<wwid> /dev/disk/by-id/nvme-<model>_<serial>_<nsid>

scsi (Small Computer System Interface)

/dev/sd*, /dev/sr*

/dev/disk/by-id/scsi-<model>_<serial> /dev/disk/by-id/wwn-<wwn> /dev/disk/by-id/usb-<vendor>_<model>_<serial>-<instance> /dev/disk/by-id/ieee1394-<ieee1394_id> /dev/disk/by-path/ip-<ip_address>:<ip_port>-iscsi-<iqn_name>-lun-<lun_number> /dev/disk/by-id/scsi-0<vendor>_<model>_<id> /dev/disk/by-id/scsi-1<t10_vendor_id> /dev/disk/by-id/scsi-2<eui64_id> /dev/disk/by-id/scsi-3<naa_regext_id> /dev/disk/by-id/scsi-3<naa_reg_id> /dev/disk/by-id/scsi-3<naa_ext_id> /dev/disk/by-id/scsi-3<naa_local_id> /dev/disk/by-id/scsi-8<name> /dev/disk/by-id/scsi-S<vendor>_<model>_<serial>

ata (Advanced Technology Attachment)/atapi (ATA Packet Interface)

/dev/sd*, /dev/sr*

/dev/disk/by-id/ata-<model>_<serial> /dev/disk/by-id/wwn-<wwn>

cciss (Compaq Command Interface for SCSI-3 Support)

/dev/cciss*

/dev/disk/by-id/cciss-<model>_<serial> /dev/cciss/<ccissid>

virtio (Virtual Input Output)

/dev/vd*

/dev/disk/by-id/virtio-<serial>

pmem (Persistent Memory)

/dev/pmem*

/dev/disk/by-id/pmem-<uuid>

mmc (MultiMedia Card)

/dev/mmcblk*

/dev/disk/by-id/mmc-<name>_<serial>

memstick (Memory Stick)

/dev/msblk*

/dev/disk/by-id/memstick-<name>_<serial>

Virtual devices

loop

/dev/loop*

/dev/disk/by-loop-inode/<id_loop_backing_device>-<id_loop_backing_inode> /dev/disk/by-loop-ref/<id_loop_backing_filename>

dm (device-mapper)

/dev/dm-*

/dev/mapper/<name> /dev/disk/by-id/dm-name-<name> /dev/disk/by-id/dm-uuid-<uuid> /dev/disk/by-id/wwn-<wwn>

md (multiple device)

/dev/md*

/dev/md/<devname> /dev/disk/by-id/md-name-<name> /dev/disk/by-id/md-uuid-<uuid>

Partitions (either on top of a real or a virtual device)

(any)

(any)

/dev/disk/by-partuuid/<uuid> /dev/disk/by-partlabel/<label> /dev/…​/<persistent_symlink_name>-part<number>

LVM PVs (Logical Volume Manager Physical Volumes; either on top of a real or a virtual device)

(any)

(any)

/dev/disk/by-id/lvm-pv-uuid-<pvuuid>

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동