3-2 Create and Remove PV, Assign PVs to Vs and Create and Delete LVs Flashcards
after partitioning (picking linux lvm partition in gpt if using for lvm)
pvcreate /dev/xvda
after partioning
creates physical volume
pvdisplay
Show available physical volumes
Which filesystems can extend and/or reduce?
xfs
ext4
xfs can increase and cant reduce?
ext can both increase and decrease
vgcreate newvgname /dev/disks
Create volume group and add /dev/disks to it
vgdisplay
Show available volume groups
lvcreate -n newlogicalvolume1 -L 100M VGname
lvcreate -n newlogicalvolume2 -L 400M VGname
afterwards
mkfs -t xfs /dev/VGname/newlogicalvolume1
mount /dev/VGname/newlogicalvolume1 /mnt/newdir
Create logical volume
- n • Volume name
- L • Size in bytes (1M, 1G, etc)
- l (lowercase l) size in extents (ex if PE size was 4 mb, then -l 2 means 8mb)
One volume group can have more than one LVM using diff amounts of it assigned when making LVM
lvdisplay
Display logical volumes
lvremove /dev/vgroup/lvolume
Remove logical volume
pvremove /dev/disk
Remove physical volume
vgremove /dev/vgroup
remove volume group
partition with fdisk or gdisk
initialize partitions or new device (as whole) as physical volumes, with pvcreate /dev/xvda
make volume group, vgcreate
add physical volumes together into volume groups
make lvm on volume groups
how to add to a volume group that already exists
vgdisplay
PE Size: Number
size of physical extents in volume group