April 7, 2014

Migrating to a larger hardisk with CloneZilla and VirtualBox

I run Arch Linux as my primary operating system but use VirtualBox to run various Windows systems for developing software and accessing Windows only programs. I recently started running out of space on the hard disk for one of my virtual machines. I was quickly able to use one of my favourite Linux Boot Disks CloneZilla to copy my existing virtual hard disk to a new, larger virtual hard disk. This process was done using virtual disks, but the steps are exactly the same when using physical disks.

Steps to migrate to new hard disk

Note: It is possible to permanently lose your data from running the commands below, be careful!

  1. Download the CloneZilla live CD
    • In most cases you want to download the i486 infrastructure in the .iso format
  2. Ensure the virtual machine is shut off
  3. Add a new virtual hard disk to your virtual machine
    • Click on the machine in the VirtualBox Manager
    • Click on the Settings button at the top (Yellow Gear Icon)
    • Click on the Storage label
    • Click on the far right disk label that is in the row beside "Controller: SATA"
    • Create a new disk of whatever size you want., It must be bigger or at least the same size as your current disk
  4. Mount the CloneZilla iso
    • Click the CD/DVD drive in your Storage settings and at the far right click on the small CD image.
    • Click Choose a virtual CD/DVD image file from the dropdown menu
    • Navigate and click on the CloneZilla iso file you downloaded
  5. Start the virtual machine
  6. Select first option in the Grub boot menu (Default settings)
  7. Select your language
  8. Select Don't touch keymap
  9. Select Start_Clonezilla
  10. Select device-device
  11. Select Beginner
  12. Select disktolocal_disk
  13. Select the original disk
  14. Select the new disk
  15. Select Skip checking/repairing source file system
  16. Press 'Enter' and press y to go through the confirmation messages
  17. When CloneZilla is finished copying it will display a message prompting you to press "Enter"
    • Press Enter
    • Select Poweroff
    • Press Enter again when prompted
  18. The CloneZilla disk should have automatically been dismounted but if not umount it from the Storage section in Settings
  19. Remove the original disk from the Storage section in Settings
    • Set the new disk to use the same SATA Port number that the original disk was using under the attributes section on the right.
  20. You will have to format the new storage space for Windows or any other operating system to actually use the new space
  21. Optionally once you have tested that the new drive is working, delete the old drive from your system.

This is just one of the many uses of Clonezilla. It is an amazingly powerful tool for dealing with disks, partitions, and images.

Post how you use Clonezilla in the comments!

Tags: VirtualBox Linux CloneZilla