Hi
I create a 20GB droplet and create a snapshot then I realize that I will need more space so I did a permanent resize on the droplet to 40 GB but I made a mistake on the configuration and I restored the snapshot but when I check the space (df -h) its listed only 20 GB. I contacted the support of digitalocean and they told me that they can put the droplet on recovery and the I can change the size, but I wasn’t able to do it since the only information that I found this command sudo resize2fs /dev/vda1
but I wasn’t able to make it to work, can you help me to resolve this issue?
Regards
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
You’ve probably solved this problem by now, but I had a similar issue and solved it. I created a droplet that was 20gb, then took a snapshot and created a new 30gb droplet from that snapshot. Running
df -h
on the new droplet still showed 20gb. Tech support linked me to this unanswered question (accidentally) and an article that contained information that mainly applied to resizing additional filesystems (ie, those without the OS), but the main command did the trick for me. Simply run the following command:Resize2fs is safe to use on live filesystems with an OS. Here is a note from the resize2fs manual page:
“If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel and the file system supports on-line resizing. (Modern Linux 2.6 kernels will support on-line resize for filesystems mounted using ext3 and ext4)”
Still, if you’re paranoid about data loss like me, and if you’ve made any changes since spinning up the new droplet, create a snapshot backup for yourself before running resize2fs.
In your specific case, I think the problem was that you were using the disk name instead of the volume name. The volume name and path is what appears when you run
df -H
, which for me was:Whereas
/dev/vda
was my disk name, as it appeared inparted
.Hello there,
You can check our article on How to Resize Droplets
https://docs.digitalocean.com/products/droplets/how-to/resize/
In certain cases, a disk resize fails to resize the Droplet’s partition or filesystem. If you rerun df -h after a disk resize and the output is unchanged, this usually indicates a problem. Use
gdisk
to get more information:The output looks like this:
Some operating systems, like CentOS, don’t come with gdisk by default. You can either install
gdisk
using the package manager (e.g. sudo yum install gdisk) or use fdisk:The output looks like this:
In both of the above cases, the partition is still 25 GB even though the disk is 50 GB.To resize the partition, use the
growpart
command. In this command, /dev/vda is the name of the disk, separated by a space, and followed by the number of the partition to resize, 1.The command to resize the filesystem depends on the filesystem type. If you don’t know what filesystem you’re using, check with df:
You can see the filesystem type in the second column of the output. The following example output shows the filesystem type is ext4.
For ext3/4 filesystems, use
resize2fs
to resize the filesystem.For XFS, use
xfs_growfs
to resize the filesystem.Hope that this helps!