![restore clonezilla image to smaller drive restore clonezilla image to smaller drive](https://image.ibb.co/huejC5/IMG_3792.jpg)
Use a tool such as gparted for that.įor each partition on the source drive, issue the command dd if=/dev/sdaX of=/dev/sdbY Use a tool such as fdisk or cfdisk for that.įor each partition on the target drive which is smaller than its corresponding partition on the source drive, reduce the size of this corresponding partition on the source drive to match the size of the partition on the target drive. There should be a one-to-one correspondence between the partitions on your source drive and the partitions on your target drive, except that (some of) the partitions on the target drive can be smaller than their corresponding partitions on the source drive. Lay out a partition table on the target drive with as many partitions as on the source drive. Summing up, if you want to clone a larger drive onto a smaller drive, proceed as follows: However, the proper way to do it would be to do a clean Grub reinstall (or whatever you have on your MBR) on the new harddrive. replacing /dev/source and /dev/target with the device names of the source and target harddrives, e.g., /dev/sda and /dev/sdb, respectively. If you insist on cloning the MBR, then only clone the first 446 bytes like so: dd if=/dev/source of=/tmp/mbr.bak bs=512 count=1ĭd if=/tmp/mbr.bak of=/dev/target bs=446 count=1 The MBR, which has a size of 512 bytes and is the first section of your hard drive, contains information on the layout of the harddrive: Please also note that you should not simply copy an MBR of a larger drive onto the MBR of a smaller drive (or vice versa, for that matter).
![restore clonezilla image to smaller drive restore clonezilla image to smaller drive](https://clonezilla.org/clonezilla-live/doc/02_Restore_disk_image/images/ocs-06-dev-img.png)
Ideally, the new size of your source partition should be equal to the size of your target partition (and not just smaller or equal), or else you will end up with some unallocated space on your target partition after the cloning. And only then could you use dd to clone the partition. So, since you cannot clone a larger partition onto a smaller partition, the only thing you could do is to first reduce the size of your source partition to a size smaller or equal to that of your target partition with something like gparted which is aware of the filesystem specifics, such that you do not lose data. What do you expect? Should some blocks just be dropped? Which ones? And how should dd know? Of course, you could use dd's bs= and count= options to only copy the first so-and-so-many blocks of your source partition such that it fits onto your target partition, but you will end up with a broken partition. The reason is simple: your source partition is bigger than your target partition.
![restore clonezilla image to smaller drive restore clonezilla image to smaller drive](https://clonezilla.org/clonezilla-live/doc/11_lite_server/images/ocs-09-advanced-param-k.png)
(But do read on, your problem can be solved yet.) Once again: You cannot clone a larger partition onto a smaller partition. The exact options to use depend on your particular use case, but to simply copy all the files the following should do: rsync -av /mount/point/of/large/partition/ /mount/point/of/small/partition However, if the files that are on the larger partition would also fit on the smaller partition, you could use rsync to copy those files. However, this time, choose your new, renamed backup that you just edited to point to your new partition scheme.You clearly cannot clone a larger partition to a smaller partition (using dd and the like) since there is simply not enough space. Choose “Restore Partitions” and point it to the folder where you keep your backups. Restore your backups to where they should beįire up Clonezilla again. Save the changes for both files and exit your text editor. Repeat the previous step with the file “parts.” If “dev-fs.list” contained references to partitions “sda1” and “sda2,” but you want to restore your backup to partitions “sde3” and “sde4,” replace “sda1” with “sde3” and “sda2” with “sde4.” Let’s repeat this last step for clarity’s sake (and to minimize any chance of a wrong move resulting in data loss).
#Restore clonezilla image to smaller drive update
Update it to reflect your new partition scheme. You’ll find references to the previous partitions inside. The next step is to edit the file “dev-fs.list” with a text editor. If your backup source were “sda2” and “sda3” from the device “sda,” as in our case, but you now want to restore it to partitions “sde3” and “sde4” on device “sde,” rename all files to reflect that change. See how some of the files have the sdX assignments of the original devices/partitions in their name? It’s time to rename them. Rename the folder to something like “Backup-Test” to be sure you’re in the correct folder and not altering your original backup. We must stress this: leave your original backup untouched and only tweak the clone. Go back to the folder of the clone of your backup.