LightYear
/Docs
DocsStorageIncrease Disk Space on a Linux Server

Increase Disk Space on a Linux Server

Expand your root partition or add a new volume when your server runs low on disk space.

intermediate
7 min read
LightYear Team
Updated April 24, 2026
diskstoragelinuxpartitionresize

Option 1 — Resize the Root Volume (Resize Server)

The simplest approach is to upgrade to a larger server plan, which includes a larger root disk.

See: Resize a Server (Upgrade Plan)

Option 2 — Attach Additional Block Storage

Attach a new block storage volume and mount it at a specific path (e.g. /var/lib/docker).

See: Attach and Format Block Storage

Option 3 — Extend an Existing Volume

If you resized a block storage volume, extend the filesystem:

>_BASH
$# Check current size
$lsblk
$
$# For ext4
$resize2fs /dev/vdb
$
$# For XFS
$xfs_growfs /mount/point

Freeing Up Disk Space

Before adding storage, check what's consuming space:

>_BASH
$# Top 10 largest directories
$du -h / --max-depth=3 2>/dev/null | sort -rh | head -20
$
$# Docker cleanup
$docker system prune -a --volumes
$
$# APT cache
$apt-get clean
$apt-get autoremove
$
$# Journal logs
$journalctl --vacuum-size=500M
$
$# Large files
$find / -type f -size +500M 2>/dev/null

Monitoring Disk Usage

>_BASH
$# Current usage
$df -h
$
$# Inode usage (can fill up independently of space)
$df -i
$
$# Watch in real time
$watch -n 5 df -h

Setting Up Disk Alerts

>_BASH
$# Add to crontab: alert if disk > 80%
$*/15 * * * * df -h / | awk 'NR==2 {gsub("%",""); if ($5>80) print "DISK ALERT: "$5"% used"}' | mail -s "Disk Alert" [email protected]

Was this article helpful?

Your cookie choices for this website

This site uses cookies and related technologies, as described in our privacy policy, for purposes that may include site operation, analytics, and enhanced user experience. You may choose to consent to our use of these technologies, or manage your own preferences. Cookie policy