Which command shows the LABEL and UUID for a block device?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which command shows the LABEL and UUID for a block device?

Explanation:
You want to quickly see a filesystem’s label and its unique identifier. The lsblk command with the -f option does exactly that: it lists block devices and shows filesystem-related information, including FSTYPE, LABEL, and UUID, in a clear, readable table. This makes it straightforward to identify the label you’ve assigned to a filesystem and its UUID, which is handy when mounting by UUID or verifying the filesystem identity. Other commands don’t fit as neatly for this purpose. Fdisk -l focuses on partition tables rather than filesystem metadata, so it doesn’t reliably show LABEL or UUID. Without -f, lsblk won’t display the LABEL and UUID. The blkid tool can report LABEL and UUID as well, but it’s more verbose and typically used when you’re targeting a specific device rather than getting a quick overview of all devices. So for a quick, authoritative view of label and UUID for block devices, lsblk -f is the best choice.

You want to quickly see a filesystem’s label and its unique identifier. The lsblk command with the -f option does exactly that: it lists block devices and shows filesystem-related information, including FSTYPE, LABEL, and UUID, in a clear, readable table. This makes it straightforward to identify the label you’ve assigned to a filesystem and its UUID, which is handy when mounting by UUID or verifying the filesystem identity.

Other commands don’t fit as neatly for this purpose. Fdisk -l focuses on partition tables rather than filesystem metadata, so it doesn’t reliably show LABEL or UUID. Without -f, lsblk won’t display the LABEL and UUID. The blkid tool can report LABEL and UUID as well, but it’s more verbose and typically used when you’re targeting a specific device rather than getting a quick overview of all devices. So for a quick, authoritative view of label and UUID for block devices, lsblk -f is the best choice.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy