Create a new volume group named vgdata from initialized PV /dev/sdb1.
Which command is appropriate?
vgcreate VG PV... groups one or more initialized physical volumes under a new VG name.
Detailed explanation
/devIncorrect. pvcreate initializes PV metadata and does not create a VG.
Incorrect. pvcreate initializes PV metadata and does not create a VG.
/procCorrect. vgcreate vgdata /dev/sdb1 creates the volume group.
Correct. vgcreate vgdata /dev/sdb1 creates the volume group.
/runIncorrect. lvcreate creates an LV from a VG.
Incorrect. lvcreate creates an LV from a VG.
/sysIncorrect. vgs only displays volume-group information.
Incorrect. vgs only displays volume-group information.
Try it yourself
An example you can run in a temporary verification environment.
find /sys -maxdepth 1 -type d -printf '%f
' | sort | grep -E '^(block|bus|class|devices|module)$'Expected result
block、bus、class、devices、module等Key points
- vgcreate creates a VG
- The first argument is the VG name
- Following arguments are PVs
Notes
- Environment: Linux sysfs / 読み取り操作
- 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.