Prepare a disk to be imaged by Clonezilla for use on smaller disks?

Solution 1:

Inside every clonezilla image, there is a file called sda-pt.parted. You can edit the sector size of /dev/sda to be smaller than your target hard drive.

Here is how we do it:

  1. Install OS and programs
  2. Shrink partition in OS to lowest possible value (we find under 80 works best)
  3. Sysprep and clone
  4. Edit image/sda-pt.parted

Below is a sample of an edited sda-pt.parted file

Model: ATA ST31000524AS (scsi)
Disk /dev/sda: 78200000s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start    End        Size       Type     File system  Flags
1      2048s    206847s    204800s    primary  ntfs         boot
2      206848s  78135295s  77928448s  primary  ntfs

Original:

Model: ATA ST31000524AS (scsi)
Disk /dev/sda: 1953525168s

Solution 2:

In creating your Master Image, resize the partitions or "total non Free space area" to be smaller than your smallest target drive will be.

Use the expert mode instead of beginner in Clonezilla.

If you are sure all the data from the image could fit the smaller disk, add the option "-icds"

CloneZilla will work fine Imaging to a smaller drive than the image was created on.


Solution 3:

The other fix provided here worked for me. The file to edit is image/sda-pt.parted inside the image folder itself.

In that file, just shrink number in the line that says

Disk /dev/sda: #########s

If you know the target size you want in bytes, you can divide by the sector size to get the number of sectors you want. In my case, I'd built out a 40GB system with 40GB partitions but it was on a 320GB drive. Sure enough, just changing the disk size to 40GB / 512 sectors (40000000000/512=78125000s) did the trick.

Alternatively, you can just look at the end of your partition table in that file and use a number just bigger than that the endpoint of your last partition.

I should also note that none of the options I found when I searched clonezilla help for pushing bigger images to smaller drives worked ("expert mode", resize, etc.). It seems like the best approach is to build your image, then adjust the disk size to be as small as possible before pushing.


Solution 4:

We started using a 64Gb SSD to build our images. We have a drive reserved for this purpose. When building a new image, we first put this drive in the computer to be used as a template. We find this also helps us produce and capture images faster, as well as ensuring the resulting image will fit in any system we have in service.