Linux Device Number Decoder
Turn a major:minor pair into its dev_t, or a dev_t back into major and minor — with the node name, the mknod line and the driver that owns the major.
How the 32-bit value is packed
Major numbers in this page's table
| Major | Type | Registered use |
|---|
A Linux device number is a pair: the major picks the driver and the minor picks the unit. The kernel allows majors 0 to 4095 (12 bits) and minors 0 to 1048575 (20 bits). Userspace packs them into one dev_t in a different order from the kernel: makedev puts the major in bits 8–19 and splits the minor across bits 0–7 and 20–31, while the kernel's own MKDEV packs the minor low and the major high. That is why 8:1 is 0x0801 as a dev_t but 0x00800001 as a kernel value. ls -l shows the pair as 8, 1; /proc/partitions and lsblk use 8:1; stat exposes the same number as st_rdev for a device node and st_dev for a mounted filesystem. Majors are assigned in the kernel's devices.txt registry, but majors 234 to 254 (character) and 240 to 254 (block) are handed out at run time, so the driver behind one of those depends on the host — /proc/devices is the authority there. Everything on this page is computed locally in your browser; nothing is stored or sent.