Jump to Navigation

103 - Need to know UUID and external device

UUID (Universally Unique Identifier) is the only way to guarantee you recognize the same drive or partition no matter what.
If you introduce to your system another hard drive, this might upset quite a few things, starting with the way your system boots up
(or stops booting up upon the new drive introduction). Using UUID helps remedy most of such things so on.

1. Device Map

# ls /dev/disk
by-label  by-path  by-uuid

You can find by-uuid and recognize all uuid for device attached to your system.

2. To know device name (like usb device and so on.) you installed.

# dmesg | tail -n 22

3. To know an UUID for a specific device.

# ls -al /dev/disk/by-uuid/ | grep sdb
lrwxrwxrwx 1 root root  10 Aug 17 15:36 e3fa64e0-8da8-4c46-ae37-19a9b922afa0 -> ../../sdb1

4. To know a specific device information.

# /lib/udev/vol_id /dev/sdb1

5. To know the list of all UUID in your system.

# blkid
/dev/mapper/VolGroup00-LogVol01: TYPE="swap"
/dev/mapper/VolGroup00-LogVol00: UUID="da7da508-b3db-498d-a70f-d17967bdbe41" TYPE="ext3"
/dev/sda1: LABEL="/boot" UUID="1d8ff6a5-ef01-431c-85ce-979e3a318cfa" TYPE="ext3"
/dev/hda: LABEL="CentOS_5.3_Final" TYPE="iso9660"
/dev/VolGroup00/LogVol00: UUID="da7da508-b3db-498d-a70f-d17967bdbe41" TYPE="ext3"
/dev/VolGroup00/LogVol01: TYPE="swap"

Main menu 2

Story | by Dr. Radut