[VMWare] Using VMWare & Clonezilla to expand your horizons

Probably something everyone but me knew already, but at least next time I will have to do something similar I’ll have a trace.

Problem

My original Bootcamp partition was a smallish thing at the end of the first disk I had in that machine. I have bigger needs and a new disk and all that jazz, so I want to clone the partition to the new one. Forget about disk utility for that, NTFS is not its forte, I’ve had weird partition size issues with it, so I use clonezilla, which works better, performs checks and repairs and is overall smarter.

I could restart on the CD and have my computer doing nothing but that for a couple of hours, but I would rather use VMWare Fusion.

Preparation

I have prepared my new partition as ExFAT on the mac (the closest it knows to creating a new NTFS one). By default, Bootcamp virtual machines grab the whole disk for the purposes of booting (even though it only uses and unmounts the NTFS partition), so I decided to use the same for the new one.

VMWare won’t let you add an existing disk directly using the UI but it does work with command line. Using mount I check which disk has the partition I want to use as destination

$ mount
/dev/disk2s1 on /Volumes/WIN7 (msdos, asynchronous, local, noowners)

So disk2 is my target.

With VMWare, you can create “proxy” disks for existing real hard drives with the command vmware-rawdiskCreator. So I create the vdmk file

$ /Applications/VMware\ Fusion.app/Contents/Library/vmware-rawdiskCreator create /dev/disk2 fullDevice ~/Desktop/Win7.vmdk ide

For some weird reason, the VMWare Fusion app won’t let you add that disk as is, so you need to right click on the bootcamp virtual machine, reveal it in finder, open package contents and edit the .vmk file. At the end of the file, I added

ide1:1.present = "TRUE"
ide1:1.fileName = "/Users/zino/Desktop/Win7.vmdk"
ide1:1.redo = ""

I then added the Clonezilla iso to the virtual CDROM, set the machine to boot off of it, and clicked start.

Clonezilla

Clonezilla has a plethora of modes, machine to machine over the network being an awesome one for instance, but what I want to do is first check the partition is the right one and formatted correctly.

So I enter the command prompt and fdisk the drives. There should be 2, sda and sdb, one being the source the other the target. Use the “p” command within fdisk to check the partition scheme and the availability of the disk. For me, the destination partition was sdb2. So I formatted it to NTFS:

$ sudo -i
# mkfs.ntfs -Q /dev/sdb2

Double check everything if you are unsure of which partition you will completely erase! Do not come back to me afterwards complaining your disk was erased… My partition was the 2nd one of the 2nd disk (sd b 2), but yours might be different.

Then go back to the clonezilla menu, select local, then local partition to local partition, choose the right ones as source and destination, and enjoy the show.

Why?

Well because that way I could write that post while it was doing the transfer. Because I trust clonezilla with copies, with all its smart things and its checks, even if it’s kind of daunting if you fear the command line. And because I generally hate the idea of having a computer stuck for hours on something that uses les than a percent of a percent of what it could do.

Oh and because that way I can tell people who didn’t know about the way of mounting real disks into VMWare, and give a shoutout to clonezilla.

Let me know if it’s useful to you!

  

Leave a Reply