In Linux, I would like to know about the differences in purposes and usages of uuid, device (major and minor) number, and device file for a device. They all seem to me to identify a device (and may also identify its driver).

  1. If I am correct, a device file is an interface to a device and its driver, and used by a user program to access the device and its driver.

    Are the uuid and/or device number of a device also used by a user program to access the device? Or are they used internally by the OS kernel, and hidden from OS users?

  2. If I am correct, for a fixed device, its device number and device file can change even on the same computer and the same OS, e.g. when the OS reboots, when other devices of the same type are added to the computer, or when run some commands that can change them.

    Is it the same for the uuid of a device? Or is the uuid of a device fixed, regardless of which computer and OS the device is attached to, and regardless of whether the OS reboots and whether there are other devices attached to the computer later?

    when is an uuid assigned to a device? During manufacturing of the device?

  3. How can I find out the uuid of a device? What commands/programs can do that?

    For example, cat /etc/fstab can show the uuid of each partition. How can I find out the uuid of a hard disk?


1 Answer 1


There are IDs / UUIDs in real (drives) and virtual (LVM, MD) hardware and in file systems. The file system UUIDs can be easily changed. Hardware IDs cannot be changed.

start cmd: # blkid /dev/sda2
/dev/sda2: UUID="b7d3900a-b6bc-4a40-b8dd-30d8df0037d0" SEC_TYPE="ext2" TYPE="ext3" PTTYPE="dos" PARTUUID="00097464-02"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .