Skill 1 in course 2.3: Storage
Storage and LVM
Partition disks with GPT, build logical volumes with LVM, grow them online, and add swap, all without losing data.
You will be able to
- Identify disks and free space, then add a GPT partition without touching existing data.
- Build physical volumes, a volume group with a chosen extent size, and logical volumes sized in megabytes or extents.
- Extend a logical volume and its file system while mounted, adding a disk to the group first when needed.
- Create swap on a partition, a logical volume or a file, and keep it active across reboots.
Lessons
- 01Disks and GPT partitionsFind out what storage exists and what is free, then add partitions with fdisk or parted without touching data in use.
lsblkblkidfdisk -lfdiskpartedpartprobe0/5 exercises - 02Logical volumes: PV, VG and LVTurn partitions into physical volumes, pool them into a volume group with a chosen extent size, and carve out logical volumes.
pvcreatevgcreatelvcreatepvsvgslvs0/5 exercises - 03Growing volumes and adding swapExtend a logical volume and its file system while it is mounted, add a disk to a group when it is full, and create swap that survives a reboot.
lvextendlvextend -rvgextendxfs_growfsresize2fsmkswap0/5 exercises