= Major device number
A \b[major device number] is the first component of a <device number>. In Linux interfaces it identifies a device class or registered device-number allocation; the <minor device number> distinguishes interfaces within that context. `major(d)` extracts the major component from the combined `dev_t` value.<Device-number conversion in the Linux man-pages project>[makedev(3), DESCRIPTION]{ref}
The device type is also significant. The Linux registry assigns character major1 to memory-related interfaces, including `/dev/null`, while block major1 describes RAM disks. Reusing the integer1 across these two types does not equate their behavior.<Linux allocated devices in the Linux kernel documentation>[Entry1, character and block allocations]{ref}
An original metadata example makes the components explicit. Suppose a character-special node represents $(\mathrm{major},\mathrm{minor})=(240,12)$. Renaming that node within the file system does not by itself change its stored pair. A second node can represent the same pair, while a node with pair $(241,12)$ has a different major context despite matching minor12.
<Linux device-number allocation> can be dynamic, so a major number should not automatically be treated as a permanent hardware serial number or a universally fixed driver label.<Linux allocated devices in the Linux kernel documentation>[Opening notes, dynamic allocation and naming]{ref} Its role is part of the device interface and registration scheme.
The structured conversion satisfies
$$
\operatorname{major}(\operatorname{makedev}(a,b))=a
$$
for supported values. An <inode> number identifies a file-system object, while the represented device's major/minor pair answers a different question. The containing file system's own device identity is another distinct field.<Device file metadata in the Linux man-pages project>[inode(7), Inode number, Device where inode resides and Device ID]{ref}
Back to article page