Applies to
- Fedora CoreOS 44.x
- Hyper‑V virtual machines
- Default installation (single disk, XFS root filesystem, no custom Ignition storage config)
Overview
Fedora CoreOS automatically expands the root partition only on first boot. If you later increase the VM’s virtual disk size (for example, from 10 GB to 25 GB), the root partition and filesystem will not resize automatically. Manual steps are required.
This article describes the supported method to expand the root partition and filesystem.
Prerequisites
- The VM disk size has already been increased in Hyper‑V
- Root or sudo access on the Fedora CoreOS VM
- Recommended: VM snapshot or backup before proceeding
Procedure
Step 1: Verify Disk and Partition Sizes
Confirm the OS sees the new disk size and identify the root partition (usually /dev/sda4).
lsblk df -hT /sysroot
Expected:
- The disk (e.g.
/dev/sda) shows the new size (25 GB) - The root partition (
/dev/sda4) still shows the old size (~10 GB)
If the disk still shows the old size, rescan it:
echo 1 | sudo tee /sys/block/sda/device/rescan
Step 2: Expand the Root Partition
Extend partition 4 to fill the newly available disk space:
sudo growpart /dev/sda 4
Verify the change:
lsblk
The root partition (/dev/sda4) should now reflect the larger size.
Step 3: Remount /sysroot as Read‑Write
Fedora CoreOS mounts /sysroot as read‑only by default. To safely modify it, use a temporary mount namespace:
sudo unshare --mount mount -o remount,rw /sysroot
Step 4: Grow the XFS Filesystem
Expand the XFS filesystem to use the new partition size:
xfs_growfs /sysroot
Exit the mount namespace:
exit
Step 5: Confirm the Result
Verify the filesystem now uses the full disk size:
df -h /sysroot lsblk
Important Notes
- Fedora CoreOS uses XFS for the root filesystem; always use
xfs_growfs(notresize2fs). - Ignition and automatic resizing apply only during first boot.
- This procedure is online and does not require reinstallation.
- The system remains compliant with Fedora CoreOS’s immutable design.
Outcome
The root partition and filesystem now fully utilize the expanded virtual disk capacity.
Comments
0 comments
Please sign in to leave a comment.