10/21/2026

Reduce Size of the EBS Volume of your EC2

Resizing an EBS volume to a larger size is a straightforward process in the AWS console. However, reducing the size of an EBS volume is not supported directly. Unlike the resizing to larger size functionality, there is no built-in feature that allows you to decrease the size of an EBS volume through the AWS console

Reduce Size of the EBS Volume of your EC2

Resizing and Reducing EBS Volumes: Step-by-Step Guide

Resizing and reducing EBS volumes is not a simple task, but by following these steps, you can successfully accomplish it while ensuring data integrity and system stability. This guide will walk you through the process. Note: Before proceeding, please exercise caution and ensure you have backups of your data to avoid any potential data loss

1. Stop all traffic and connections, except for one SSH connection for your use.

2. Take a snapshot of the volume (backup): go to the AWS Management Console; access the EC2 service and navigate to the EBS section; locate the volume you want to resize and create a snapshot.

3. Create a new EBS volume with a smaller size: choose the same volume type as your old volume (e.g., gp2, gp3); enter the desired size (e.g., 70GB); select the same availability zone as the old volume; add a tag for the new volume, e.g., NAME: new-vol.

4. Attach and format the new volume: go to the EBS section and locate the newly created volume; click 'Attach' and select the EC2 instance; specify the Device Name as /dev/sdf (or any available device name); click 'Attach' to attach the new volume to the EC2 instance; use the command lsblk to list the current disks and verify that /dev/sdf is listed; check if the new volume has any data using the command 'sudo file -s /dev/sdf'. If it displays '/dev/sdf: data,' the volume is empty and can be formatted. If it shows any other output, do not format the volume.

5. Format the new volume

: sudo mkfs -t ext4 /dev/sdf

6. Mount the new volume. Create a directory to mount the new volume, mount it, then verify with df -h:

sudo mkdir /mnt/new-vol

sudo mount /dev/sdf /mnt/new-vol

7. Copy data from the old volume to the new volume using rsync. The time taken for the copy process will depend on the size of your data.

sudo rsync -axv / /mnt/new-vol/.

8. Make the new volume mountable: install GRUB on the new volume, then unmount it.

sudo grub-install --root-directory=/mnt/new-vol/ --force /dev/sdf sudo umount /mnt/new-vol

9. Update UUIDs and labels: check the UUID of the old volume using the blkid command and copy the UUID value for backup purposes. Replace the UUID of the new volume with the copied UUID using tune2fs:

sudo tune2fs -U COPIED_UUID /dev/sd

If you encounter an error like 'This operation requires a freshly checked filesystem', run 'sudo e2fsck -f /dev/sdf' to check the filesystem. Then check the system label of the old volume using 'sudo e2label /dev/sdf' and replace the label of the new volume with the old volume's label:

sudo e2label /dev/sdf cloudimg-rootfs

10. Detach the new volume and complete the process: stop the EC2 instance; detach the old volume and the new volume from the EBS section in the AWS console; attach the new volume to /dev/sda1; start the EC2 instance; SSH into the EC2 instance and verify that everything is functioning correctly. Once your system is working as expected, you may consider deleting the old volume and its snapshot after a week, if no issues arise. However, it's recommended to keep them as backups for added security.

By following these steps carefully, you can resize and reduce your EBS volumes while minimizing risks and ensuring the integrity of your data and system.

Tags: AWS, EBS Volume Reduction, EC2 Volume

Ready to build what's next?

Tell us about your project and our team will get back to you to map out the fastest path to a secure, scalable solution.

Talk to Our Experts