Allocate 20 GiB from vgdata and create an LV named lvlogs.
Which command is appropriate?
lvcreate -L SIZE -n NAME VG allocates the requested capacity from the VG and creates the logical volume.
Detailed explanation
pvcreate -L 20G -n lvlogs vgdataIncorrect. pvcreate initializes a PV.
Incorrect. pvcreate initializes a PV.
vgcreate -L 20G -n lvlogs vgdataIncorrect. vgcreate creates a VG rather than an LV.
Incorrect. vgcreate creates a VG rather than an LV.
lvcreate -L 20G -n lvlogs vgdataCorrect. lvcreate -L 20G -n lvlogs vgdata creates the requested LV.
Correct. lvcreate -L 20G -n lvlogs vgdata creates the requested LV.
lvs -L 20G -n lvlogs vgdataIncorrect. lvs queries existing LVs and does not create one.
Incorrect. lvs queries existing LVs and does not create one.
Try it yourself
An example you can run in a temporary verification environment.
lvcreate --help 2>&1 | sed -n '1,18p'Expected result
-L/--size、-n/--name、VGを指定する使用法Key points
- lvcreate creates an LV
- -L sets size
- -n sets the LV name
Notes
- Environment: LVM2 / ヘルプ表示のみ
- 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.