blkid

Linux · System · reference only

What it does

Shows the UUID, label and file system type of block devices, such as disks and partitions.

Syntax

blkid [opciones] [dispositivo...]

Options and parameters

  • -s etiqueta

    Shows only that property, such as UUID, LABEL or TYPE.

  • -o formato

    Changes the output format: value, device, full, list or export.

  • -L etiqueta

    Looks for the device that has that label.

  • -U uuid

    Looks for the device that has that UUID.

  • -p

    Probes the device directly instead of using the cache.

Usage examples

  • sudo blkid

    Lists all devices with their UUID and type.

  • sudo blkid /dev/sda1

    Shows the data of one specific partition.

  • sudo blkid -s UUID -o value /dev/sda1

    Prints only the UUID, ready to copy into /etc/fstab.

  • sudo blkid -L datos

    Finds the device whose label is datos.

Notes and common mistakes

  • It is commonly used to identify partitions by UUID in /etc/fstab, which does not change even if the device name does.

Related commands