The fastest way to extend disk image files on Linux

So the VM is using too much space, and the disk image needs to grow. Previously I used dd with a bunch of options to do this. However, the truncate tool makes the whole ordeal a lot easier.

A simple command, such as the following, will grow the file disk.img by 10 gigabytes:

truncate -s +10G disk.img

Read the manual for truncate for more options.

Happy resizing.

Leave a Reply

Your email address will not be published. Required fields are marked *