Inspect partition numbers, start/end sectors, and type codes on GPT disk /dev/sdb.
Do not modify the partition table.
Which command is appropriate?
gdisk -l DEVICE displays GPT information and the partition list without entering an editing session.
Detailed explanation
gdisk -l /dev/sdbCorrect. gdisk -l /dev/sdb lists the GPT partition table read-only.
Correct. gdisk -l /dev/sdb lists the GPT partition table read-only.
mkfs.ext4 /dev/sdbIncorrect. mkfs creates a filesystem and can destroy existing data.
Incorrect. mkfs creates a filesystem and can destroy existing data.
mount /dev/sdb /mntIncorrect. mount attaches a filesystem and does not inspect GPT layout.
Incorrect. mount attaches a filesystem and does not inspect GPT layout.
pvcreate /dev/sdbIncorrect. pvcreate initializes an LVM physical volume and changes state.
Incorrect. pvcreate initializes an LVM physical volume and changes state.
Try it yourself
An example you can run in a temporary verification environment.
gdisk -? 2>&1 | sed -n '1,12p'Expected result
-lでパーティションテーブルを一覧表示する旨を含むヘルプKey points
- gdisk handles GPT
- -l lists information
- Confirm the disk before any write operation
Notes
- Environment: GPT fdisk 1.x / ヘルプ表示のみ
- 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.