How to Resize a DigitalOcean Volume

Quickly resize a DigitalOcean volume in the control panel and with one command. Expand your filesystem's capacity without downtime.

P
Parathan Thiyagalingam
December 27, 20252 min read
How to Resize a DigitalOcean Volume

When your DigitalOcean volume runs out of space, here’s the quickest way to expand it. In most cases, you only need one command after increasing the size in the control panel.

Quick Steps

  1. Increase volume size in DigitalOcean control panel
  2. Run one command on your server
  3. Done!

Step 1: Increase Volume Size in DigitalOcean Control Panel

  1. Go to Volumes in your DigitalOcean control panel
  2. Click on your volume
  3. Click Resize Volume
  4. Enter the new size and confirm

Step 2: Check Current Status (Optional)

# See your current disk usage
df -h

You’ll likely see something like:

/dev/sda 635G 635G 0 100% /mnt/volume_blr1_03

Step 3: Resize the Filesystem

This is the magic command that does everything:

sudo resize2fs /dev/sda

Replace /dev/sda with your actual device name (check with df -h to see yours).

Expected output:

resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/sda is mounted on /mnt/volume_blr1_03; on-line resizing required
old_desc_blocks = 40, new_desc_blocks = 44
The filesystem on /dev/sda is now 183500800 (4k) blocks long.

Step 4: Verify Success

df -h

Before:

/dev/sda 635G 635G 0 100% /mnt/volume_blr1_03

After:

/dev/sda 695G 635G 28G 96% /mnt/volume_blr1_03

Success! You now have additional free space available.

Why This Works

The magic: resize2fs performs an online resize, meaning it expands the filesystem while it’s still mounted and in use. No downtime required!

What If It Doesn’t Work?

In rare cases, you might need additional steps, but 90% of the time, the simple command above is all you need.

If you get errors, try:

# Check your device name first
df -h

# Then use the correct device name
sudo resize2fs /dev/your-device-name

Quick Automation Script

Save this for future resizes:

#!/bin/bash
echo "Before resize:"
df -h

echo "Resizing filesystem..."
sudo resize2fs /dev/sda

echo "After resize:"
df -h

echo "✅ Resize complete!"

That’s It!

No complex unmounting, no partition table editing, no reboots. Just:

  1. Resize in DigitalOcean panel
  2. Run sudo resize2fs /dev/sda
  3. Enjoy your extra space

The resize2fs command automatically detects the new volume size and expands the filesystem to use all available space. Simple and effective!