Lvm2
Cheatsheet for ordinary use of LVM2Common lvm2 commands
The commands i use for administration of my little server.
More on lvm2 #
Learn more about LVM2 from wikipedia.
There are of course man pages for those commands.
Commands #
| command | explanation |
|---|---|
vgdisplay / lvdisplay |
displays the volume groups or the logical volumes |
pvdisplay |
displays which partitions are in the volume group |
lvcreate -L 30G -n livesystem vg0 |
creates a 30G volume with name livesystem on the volume group vg0 |
mkfs.ext4 -v /dev/vg0/livesystem |
creates an ext4 filesystem on that volume |
pvmove <dev> |
moves data of that partitions |
vgreduce vg0 <dev> |
removes the partition from the volume group vg0 |
pvremove <dev> |
cleans the pv label |
pvcreate <dev> |
makes the a physical volume |
vgextend vg0 <dev> |
extends the volume group vg0 to the partition |
resize2fs <dev> |
does an online resize of the file system |