Which command provides a list of block devices with their filesystem types?

Prepare for the Google Data Center Technician Exam. Use our interactive quiz featuring flashcards and multiple choice questions with hints and explanations. Get exam-ready today!

Multiple Choice

Which command provides a list of block devices with their filesystem types?

Explanation:
To know which block devices exist and what filesystem each uses, you want a command that lists the devices and shows their filesystem type in the same output. The command that does this is lsblk -f. lsblk lists block devices in a tree and with the -f flag it adds a filesystem section, showing FSTYPE, as well as LABEL, UUID, and MOUNTPOINT when applicable. This makes it easy to see that a device like /dev/sda1 is ext4, /dev/sdb1 is xfs, and so on, even if some partitions aren’t mounted. In contrast, df -h reports how much space is used on mounted filesystems and doesn’t reveal the filesystem type for each device. The mount command shows information about currently mounted filesystems, including their type, but it only covers mounted ones and may omit unmounted block devices. The network-focused command ip addr is unrelated.

To know which block devices exist and what filesystem each uses, you want a command that lists the devices and shows their filesystem type in the same output. The command that does this is lsblk -f. lsblk lists block devices in a tree and with the -f flag it adds a filesystem section, showing FSTYPE, as well as LABEL, UUID, and MOUNTPOINT when applicable. This makes it easy to see that a device like /dev/sda1 is ext4, /dev/sdb1 is xfs, and so on, even if some partitions aren’t mounted.

In contrast, df -h reports how much space is used on mounted filesystems and doesn’t reveal the filesystem type for each device. The mount command shows information about currently mounted filesystems, including their type, but it only covers mounted ones and may omit unmounted block devices. The network-focused command ip addr is unrelated.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy