Skip to content
Search Oracle Linux

    Browse this documentation

    The complete LVM disk-expansion flow: hot-adding a disk, vgextend, lvextend -r growing xfs online (field record)

    What to do when the disk fills up. This page is a complete field record of hot-adding a disk → growing online → taking effect without a reboot, covering how to read the factory default layout and xfs’s boundary.

    Terminal window
    lsblk /dev/sda
    sda
    ├─sda1 1M BIOS Boot
    ├─sda2 2G /boot ← standard partition (not in LVM)
    └─sda3 18G LVM PV ← VG "ol"
    Terminal window
    vgs && lvs
    # VG #PV #LV VSize VFree
    # ol 1 2 18.00g 0g
    # LV root 16G / swap 2G

    Key points: the VG is called ol (the counterpart of RHEL’s rhel); /boot sits outside it, so growing the root disk does not touch the boot path; there is no separate /home LV under root (unlike Rocky/Alma’s autopart).

    Terminal window
    # 1. Create a PV on the new disk (/dev/sdb here is the hot-added 5G disk)
    pvcreate /dev/sdb
    # Physical volume "/dev/sdb" successfully created.
    # 2. Add it to the existing VG
    vgextend ol /dev/sdb
    # Volume group "ol" successfully extended.
    vgs --units g
    # ol 2 2 22.99g 5.00g
    # 3. Grow the root LV and the filesystem together (-r = invokes xfs_growfs automatically)
    lvextend -r -l +100%FREE /dev/ol/root
    # xfs_growfs done
    # Logical volume ol/root successfully resized.
    # 4. Verify
    df -h /
    # /dev/mapper/ol-root 21G 2.7G 19G 13% /

    Measured: 16G → 21G with no reboot, nothing unmounted. Hot-adding disks on virtualization platforms (PVE qm set <vmid> --scsi1 local-lvm:5) and cloud-volume expansion (OCI block volume) follow the same flow; adding a physical disk works identically.

    Terminal window
    lvextend -r -L +5G /dev/ol/root # grow by 5G
    lvextend -r -L 20G /dev/ol/root # grow to 20G (absolute)

    xfs grows online effortlessly, but shrinking does not exist. For “root is 100G, too big, want 40G”, the correct answer on xfs is backup → rebuild → restore. If shrinking is a hard requirement, choose ext4 for that volume at install time (the filesystem dropdown in manual partitioning). OL defaults everything to xfs for performance and large-capacity scenarios — understand your workload before deciding.

    The added disk can also grow swap (or host a swapfile):

    Terminal window
    lvextend -r -L +2G /dev/ol/swap # xfs is wrong for swap; the swap LV uses mkswap format
    mkswap /dev/ol/swap && swapon -a
    • Measured: the default layout, the full four-step expansion (online, no reboot), and the xfs_growfs automation (E3 run record);
    • Not measured: striped PVs across disks, LV migration (pvmove) — advanced operations scenarios to be measured and added later;
    • Sources: the OL 10 documentation storage chapter, lvm(8), xfs_growfs(8).