Logical Volume Management (LVM)/shaare/PaqQSg
LVM (Logical Volume Management)
-
Combine disk together by software
-
Add new HDD on the fly to extend disk space
-
Set LVM in Linux install
-
Desired capacity: all → set last partition to space left
-
/boot→500 MBLVM⚠ always -
fdisk /dev/sdcn→ new partitiont→ change partition system ID8e→ change to Linux LVM
-
pvcreate /dev/sdc1→ create physical volume -
pvdisplay→ infos -
vgcreate vg /dev/sdc1→ create volume group -
vgdisplay→ show info -
lvcreate -n lv --size 500 vg -
lvdisplay→ show info -
mkfs.xfs /dev/vg/lv→ format logical volume
Extend LVM → create LVM partition
pvcreate /dev/sd01vgextend vg /dev/sd01lvextend -L +100M /dev/mapper/vg-vgxfs_growfs /dev/mapper/vg-vg
Add / Extend Swap Space
-
System will not boot if set incorrect
-
Recommended:
2xsize of RAM -
dd if=/dev/zero of=/newswap bs=1M count=1024- Extract disk space from HDD to swap
-
chmod go-r /newswap- Make file non-readable for others
-
mkswap /newswap- Make swap file
-
swapon /newswap- Activate swap (add with the rest)
-
nano fstab
/newswap swap swap defaults 0 0
xfs_info → display detailed information
xfs_info /dev/mapper/cs-root- Debug info about main XFS partition
(97)