This section describes the optional use of UUIDs instead of device names to identify file system devices in the boot loader file and the /etc/fstab
file.
In the Linux 2.6 and later kernel, udev provides a userspace solution for the dynamic /dev
directory, with persistent device naming. As part of the hotplug system, udev is executed if a device is added or removed from the system.
A list of rules is used to match against specific device attributes. The udev rules infrastructure (defined in the /etc/udev/rules.d
directory) provides stable names for all disk devices, regardless of their order of recognition or the connection used for the device. The udev tools examine every appropriate block device that the kernel creates to apply naming rules based on certain buses, drive types, or file systems. For information about how to define your own rules for udev, see Writing udev Rules.
Along with the dynamic kernel-provided device node name, udev maintains classes of persistent symbolic links pointing to the device in the /dev/disk
directory, which is further categorized by the by-id
, by-label
, by-path
, and by-uuid
subdirectories.
![]() | |
Other programs besides udev, such as LVM or md, might also generate UUIDs, but they are not listed in |
A UUID (Universally Unique Identifier) is a 128-bit number for a file system that is unique on both the local system and across other systems. It is a randomly generated with system hardware information and time stamps as part of its seed. UUIDs are commonly used to uniquely tag devices.
The UUID is always unique to the partition and does not depend on the order in which it appears or where it is mounted. With certain SAN devices attached to the server, the system partitions are renamed and moved to be the last device. For example, if root (/
) is assigned to /dev/sda1
during the install, it might be assigned to /dev/sdg1
after the SAN is connected. One way to avoid this problem is to use the UUID in the boot loader and /etc/fstab
files for the boot device.
The device ID assigned by the manufactuer for a drive never changes, no matter where the device is mounted, so it can always be found at boot. The UUID is a property of the filesystem and can change if you reformat the drive. In a boot loader file, you typically specify the location of the device (such as /dev/sda1
or /dev/evms/sda1
) to mount it at system boot. The boot loader can also mount devices by their UUIDs and administrator-specified volume labels. However, if you use a label and file location, you cannot change the label name when the partition is mounted.
You can use the UUID as criterion for assembling and activating software RAID devices. When a RAID is created, the md driver generates a UUID for the device, and stores the value in the md
superblock.
You can find the UUID for any block device in the /dev/disk/by-uuid
directory. For example, a UUID looks like this:
e014e482-1c2d-4d09-84ec-61b3aefde77a
After the install, you can optionally use the following procedure to configure the UUID for the system device in the boot loader and /etc/fstab
files for your x86 system.
Install the SUSE Linux Enterprise Server for x86 with no SAN devices connected.
After the install, boot the system.
Open a terminal console as the root
user or equivalent.
Navigate to the /dev/disk/by-uuid
directory to find the UUID for the device where you installed /boot
, /root
, and swap
.
At the terminal console prompt, enter
cd /dev/disk/by-uuid
List all partitions by entering
ll
Find the UUID, such as
e014e482-1c2d-4d09-84ec-61b3aefde77a —> /dev/sda1
Edit /boot/grub/menu.1st
file, using the Boot Loader option in YaST2 or using a text editor.
For example, change
kernel /boot/vmlinuz root=/dev/sda1
to
kernel /boot/vmlinuz root=/dev/disk/by-uuid/e014e482-1c2d-4d09-84ec-61b3aefde77a
![]() | |
Make a copy of the original boot entry, then modify the copy. If you make a mistake, you can boot the server without the SAN connected, and fix the error. |
If you use the Boot Loader option in YaST, there is a defect where it adds some duplicate lines to the boot loader file when you change a value. Use an editor to remove the following duplicate lines:
color white/blue black/light-gray
default 0
timeout 8
gfxmenu (sd0,1)/boot/message
When you use YaST to change the way that the root (/
) device is mounted (such as by UUID or by label), the boot loader configuration needs to be saved again to make the change effective for the boot loader.
As the root
user or equivalent, do one of the following to place the UUID in the /etc/fstab
file:
Open YaST to
+ , select the device of interest, then modify .Edit the /etc/fstab
file to modify the system device from the location to the UUID.
For example, if the root (/
) volume has a device path of /dev/sda1
and its UUID is e014e482-1c2d-4d09-84ec-61b3aefde77a
, change line entry from
/dev/sda1 / reiserfs acl,user_xattr 1 1
to
UUID=e014e482-1c2d-4d09-84ec-61b3aefde77a / reiserfs acl,user_xattr 1 1
![]() | |
Make sure to make a backup copy of the |
After the install, use the following procedure to configure the UUID for the system device in the boot loader and /etc/fstab
files for your IA64 system. IA64 uses the EFI BIOS. Its file system configuration file is /boot/efi/SuSE/elilo.conf
instead of /etc/fstab
.
Install the SUSE Linux Enterprise Server for IA64 with no SAN devices connected.
After the install, boot the system.
Open a terminal console as the root
user or equivalent.
Navigate to the /dev/disk/by-uuid
directory to find the UUID for the device where you installed /boot
, /root
, and swap
.
At the terminal console prompt, enter
cd /dev/disk/by-uuid
List all partitions by entering
ll
Find the UUID, such as
e014e482-1c2d-4d09-84ec-61b3aefde77a —> /dev/sda1
Edit the boot loader file, using the Boot Loader option in YaST2.
For example, change
root=/dev/sda1
to
root=/dev/disk/by-uuid/e014e482-1c2d-4d09-84ec-61b3aefde77a
Edit the /boot/efi/SuSE/elilo.conf
file to modify the system device from the location to the UUID.
For example, change
/dev/sda1 / reiserfs acl,user_xattr 1 1
to
UUID=e014e482-1c2d-4d09-84ec-61b3aefde77a / reiserfs acl,user_xattr 1 1
![]() | |
Make sure to make a backup copy of the |
For more information about using udev(8) for managing devices, see “Dynamic Kernel Device Management with udev” in the SUSE Linux Enterprise Server 10 Installation and Administration Guide.
For more information about udev(8) commands, see its man page. Enter the following at a terminal console prompt:
man 8 udev