What must I check before expanding a Linux server filesystem?
Expanding a provider disk or adding physical capacity does not automatically grow every partition, volume and filesystem above it. The correct sequence depends on the verified storage stack. Ext4, XFS, LVM, encryption and RAID require different supported procedures, so a single copied resize command is not safe for every server.
Before you start
- An authorised SSH session on the Linux server.
Instructions
1. Map capacity at every layer
Identify the application path and compare the device, partition or logical volume size with the mounted filesystem size. Record the filesystem type before selecting a tool.
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
findmnt -T /srv/data -o TARGET,SOURCE,FSTYPE
df -hT /srv/dataReplace /srv/data with the existing target. Check whether newly added capacity is visible to the operating system.
2. Use only an applicable non-writing preview
If the verified target is a mounted XFS filesystem, its grow tool can report geometry without changing it. Other stacks need their own documented planning checks.
sudo xfs_growfs -n /srv/data-n performs no growth. Run this only for the confirmed XFS mount; it is not an ext4, partition or LVM resize command.
3. Plan the exact expansion sequence
Grow underlying layers in their supported order, then the filesystem. Validate recovery arrangements and required downtime before any write operation; shrinking is a separate and often unsupported operation.
Check the result
- The plan names exact verified devices, layers and filesystem-specific commands. After the approved change, compare lsblk and df and test application reads and writes.
Troubleshooting
- The filesystem still shows the old size
- A lower layer may have grown while the filesystem did not. Reinspect the stack instead of repeating a partition command blindly.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
