Skip to content

Instantly share code, notes, and snippets.

@DavideMontersino
Created March 13, 2017 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavideMontersino/7e971b33683a9cdc3807226a8afdd2b9 to your computer and use it in GitHub Desktop.
Save DavideMontersino/7e971b33683a9cdc3807226a8afdd2b9 to your computer and use it in GitHub Desktop.
Resize virtual box hard drive

A mix of these tutorials:

  • create a new (bigger) virtual hd
  • use a gparted iso, create a virtual machine and attach the iso, the old (smaller) hd and the new hd to the machine
  • once started, identify the two hard drives and launch:
    dd -if=/dev/sda of=/dev/sdb
    

be careful because if you invert if and of you will delete your original hd. This will take a lot of time to copy everything from one hard drive to the other.

  • At this point you will have an hd with all of the original partitions, and a lot of unallocated space. Just resizing the original partitions in gparted won't work.. some trickier adding and merging is needed:

First of all add an LVM partition using gparted, then follow these instruction from Increasing the logical volume: https://www.rootusers.com/how-to-increase-the-size-of-a-linux-lvm-by-expanding-the-virtual-machine-disk/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment