Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
blkid reads the signatures on block devices and prints them as NAME="value" pairs: UUID, LABEL, TYPE, PARTUUID, PARTLABEL. Without root it may show cached (old) data; run it as root for fresh values.
Zo schrijf je het
blkid [OPTION]... [DEVICE]...
blkid -L LABEL | -U UUIDOpties 20
Meest gebruikt
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1All devices
blkid /dev/vdb1: LABEL="data" UUID="4e5c7a6b-3f1d-4c2e-9a5b-7d2f8e1c0a93" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="2a9b…"UUID for fstab, TYPE for the type field.
2One device
blkid /dev/vdb1Only that partition.
3Only the UUID value
blkid -s UUID -o value /dev/vdb1 4e5c7a6b-3f1d-4c2e-9a5b-7d2f8e1c0a93Perfect for scripts.
4Add an fstab line without typing the UUID
echo "UUID=$(blkid -s UUID -o value /dev/vdb1) /data xfs defaults 0 0" >> /etc/fstabNo typing mistakes.
5Find the device of a UUID or label
blkid -U 4e5c7a6b-3f1d-4c2e-9a5b-7d2f8e1c0a93 /dev/vdb1 blkid -L dataThe reverse lookup.
6All XFS file systems
blkid -t TYPE=xfsFilter by type.
7As shell variables
eval $(blkid -o export /dev/vdb1); echo $TYPE $UUIDUse the values in a script.
8Probe without cache
blkid -p /dev/vdb1Fresh data, also for partitions without a file system.
9Find duplicate UUIDs (cloned disks)
Duplicates cause mount and LVM problems.
10Find encrypted volumes
blkid -t TYPE=crypto_LUKSLUKS-encrypted partitions.
Niets past bij dit filter.
Exitcodes
0 :: Done. 2 :: Nothing found. 4 :: Usage error. 8 :: Ambivalent result (more than one signature).