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.
vgcreate -L 20G -n lvlogs vgdataIncorrect. vgcreate creates a VG rather than an LV.
lvcreate -L 20G -n lvlogs vgdataCorrect. 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.
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 / ヘルプ表示のみ
- Use read-only inspection or a disposable disk when learning storage commands.
- Partition and LVM writes can destroy data; verify the target before running them.
Foundation review
Place the operation
lvcreate consumes VG free extents and produces a named block device.
Check the side effect
Review the selected VG and free capacity before creating the LV.