Inspect filesystem type, UUID, and label for /dev/sdb1 to obtain an identifier for /etc/fstab.
Do not modify the device.
Which command is appropriate?
blkid reads block-device signatures and displays UUID, LABEL, and TYPE, which can be used in persistent mount configuration.
Detailed explanation
mkfs.ext4 /dev/sdb1Incorrect. mkfs creates a new filesystem and can overwrite existing identifiers.
Incorrect. mkfs creates a new filesystem and can overwrite existing identifiers.
blkid /dev/sdb1Correct. blkid /dev/sdb1 displays the filesystem identity fields.
Correct. blkid /dev/sdb1 displays the filesystem identity fields.
mount /dev/sdb1 /mntIncorrect. mount attaches the device but is not the dedicated identifier query.
Incorrect. mount attaches the device but is not the dedicated identifier query.
fsck /dev/sdb1Incorrect. fsck checks consistency rather than primarily retrieving fstab identifiers.
Incorrect. fsck checks consistency rather than primarily retrieving fstab identifiers.
Try it yourself
An example you can run in a temporary verification environment.
blkid --help | sed -n '1,14p'Expected result
block device attributesを検索・表示する使用法Key points
- blkid reads signatures
- UUID and TYPE are shown
- It does not change state
Notes
- Environment: util-linux blkid / ヘルプ表示のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.