Wwid and UUID of fixed disk identifiers for Linux systems

Source: Internet
Author: User
Tags uuid uuid identifier

Background description: In a Linux system, if you add a new SCSI disk or map a SAN storage LUN operation, a disk identifier (sd*) will appear after restarting the operating system.

For example, the previously added SAN storage LUN has a disk identifier of/DEV/SDD, and after a reboot it turns out to be/DEV/SDH, especially in an Oracle RAC environment where we do not want to see this.

Before you solve this problem, you need to understand the wwid and UUID numbers in your Linux system first.

First, Wwid

According to SCSI standards, each SCSI disk has a wwid, similar to the MAC address of the network card, the requirements are unique.

By wwid The SCSI disk, the disk path is guaranteed to be permanent, and the/dev/disk/by-id directory on the Linux system contains the Wwid access path for each SCSI disk.

To view disk devices Wwid Method 1:

[email protected]/]# Ll/dev/disk/by-id/
Total 0
lrwxrwxrwx. 1 root root dm-name-vg_rac01node01-logvol01. /.. /dm-0
lrwxrwxrwx. 1 root Root 28 2017 Dm-uuid-lvm-ywdtad547swxxq2m9yf3vl7gd42z61gqjqsrxv0gpavzdle2d1dh26apin6v59mz. /.. /dm-0
lrwxrwxrwx. 1 root root 9 May 19:01 scsi-360060160e2b0420004a53e678d42e711. /.. /SDG
lrwxrwxrwx. 1 root root 9 May 19:01 scsi-360060160e2b04200c687b330c741e711. /.. /SDH
lrwxrwxrwx. 1 root root 9 scsi-3600605b00a8043c020b6bdd53057904d. /.. /SDA
lrwxrwxrwx. 1 root root scsi-3600605b00a8043c020b6bdd53057904d-part1. /.. /SDA1
lrwxrwxrwx. 1 root root scsi-3600605b00a8043c020b6bdd53057904d-part2. /.. /sda2

To view disk devices Wwid Method 2:

[Email protected] packages]# scsi_id--WHITELIST/DEV/SDA
3600605b00a8043c020b6bdd53057904d
[Email protected] packages]# scsi_id--whitelist/dev/sdb
360060160e2b04200c687b330c741e711

RHEL6 use the command as above, use scsi_id--whitelist/dev/sd* in RHEL5

After rebooting the system, if you want to keep the disk identifier intact, you need to bind the disk identifier and Wwid as follows:

=======================================================================================

Second, UUID

UUID is a file system generated at the time of creation, used to mark the file system, like Wwid is also unique.

Therefore, the use of UUID to flag SCSI disk, but also to ensure that the path is permanent. /dev/disk/by-uuid on Linux can see each disk device that has created the file system and the mapping relationship with/dev/sd*.

To view the file system uuid:

[Email protected]/]# Ll/dev/disk/by-uuid/
Total 0
lrwxrwxrwx. 1 root root 3777-9e7c. /.. /sda1
lrwxrwxrwx. 1 root root 414563cf-af5d-467a-bca9-81b8dad6e17f. /.. /dm-0
lrwxrwxrwx. 1 root root 948ab5bc-f796-4f74-8cd5-84b6474d79ae. /.. /dm-1
lrwxrwxrwx. 1 root root 9CBB7F73-582C-47E4-99D7-1C79FAE90EFC. /.. /sda2

After rebooting the system, if you want the mounted mount directory and file system bindings to be the same, you should use the UUID identifier in the/etc/fstab, as follows:

[Email protected]/]# Cat/etc/fstab

#/etc/fstab
# Created by Anaconda in Sun may 01:13:01
# Accessible filesystems, by reference, is maintained under '/dev/disk '
# See mans Pages Fstab (5), Findfs (8), mount (8) and/or Blkid (8) for more info
#
/DEV/MAPPER/VG_RAC01NODE01-LOGVOL01/EXT4 defaults 1 1
UUID=9CBB7F73-582C-47E4-99D7-1C79FAE90EFC /boot EXT4 defaults 1 2
uuid=3777-9e7c /boot/efi vfat umask=0077,shortname=winnt 0 0
/dev/mapper/vg_rac01node01-logvol00 Swap swap defaults 0 0
tmpfs/dev/shm tmpfs defaults 0 0
devpts/dev/pts devpts gid=5,mode=620 0 0
Sysfs/sys Sysfs defaults 0 0
proc/proc proc Defaults 0 0

Wwid and UUID of fixed disk identifiers for Linux systems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.