1.0 KiB
1.0 KiB
LPIC-1 102.1: Designing a disk layout
Building LVM on a spare disk, growing a logical volume and its filesystem in one step, and adding a swap file.
Before you start
The lab adds an empty 2 GiB spare disk, /dev/loop40. It comes back at
every boot, before filesystems are mounted. Before you start, look at the
VM's own layout with lsblk -f and findmnt, and work out why each
filesystem is where it is.
Tasks
- On
/dev/loop40, make a physical volume, a volume groupvg_laband a 1 GiB logical volumelv_data, and put a filesystem on it. Then grow the logical volume and its filesystem by 500 MiB in one step withlvextend -r. - Add a 512 MiB swap file, turn it on, and check it with
swapon --show.
Hints
pvcreate,vgcreate,lvcreate -n lv_data -L 1G vg_lab,mkfs.ext4ormkfs.xfs;lvs,lsblk -f.lvextend -r -L +500M. XFS grows only while it's mounted; ext4 grows either way.fallocate -l 512M(ordd),chmod 600,mkswap,swapon; a line in/etc/fstabkeeps it on after a reboot.