Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have disk image from VirtualBox, it is a raw image, just like dd makes it, now I would like to restore the system to real machine using Clonezilla. However Clonezilla does not recognize the image (there is no "restore" option which means Clonezilla does not see it).

The question is -- how to convert dd disk image file into Clonezilla format? So I could restore the system.

share|improve this question
1  
Why do you want to use CloneZilla and not restore with dd? –  jippie May 5 '12 at 21:03
    
The problem is, the target partition in restore is not the same as source partition in save, it is bigger, and dd didn't handle it (I tried already). –  greenoldman May 6 '12 at 6:50
    
did you create a disk image or a partition image with dd? And which partition is larger, is the source partition larger than the destination, or the other way around? –  jippie May 6 '12 at 16:39
    
Did justaguy's solution work for you? I tried dd of a partition to an image file(not whole disk). But clonezilla didn't seem to see it. A commmenter(psusi) says even with clonezilla it ends up the wrong size. But it may be more than just a size problem. I tried a few non-unix programs to resize after restoring the image with dd. and one couldn't see it. one resized it but the amount remaining and amount used didn't add to the claimed partition size. I didn't resize it to the image size, as even if that worked, i'd have hardly any space free, as the drive had hardly any space free. –  barlop Jan 20 '13 at 11:10
    
@barlop, I don't remember exactly, probably you have to match the sizes, and enlarge partition afterwards. Something like this. –  greenoldman Jan 20 '13 at 11:21

3 Answers 3

up vote 2 down vote accepted

Restore it with dd and then resize the partition(s) with gparted running from bootable media. It should work as long as you didn't use LVM on the virtual machine.

If you have LVM, you can increase the LVM partition size with fdisk or parted, and then pvresize, lvresize, and resize2fs (or whatever is appropriate for your filesystem).

share|improve this answer

If you made the image with dd, then you just restore it with dd. If you really wanted to, you should be able to have clonezilla create its image from the raw image just like you would from a hard drive, but there is not much reason to.

share|improve this answer
1  
The problem is, the target partition in restore is not the same as source partition in save, it is bigger, and dd didn't handle it (I tried already). And I cannot use Clonezilla to clone the partition because it is VirtualBox image, not "real" partition. –  greenoldman May 6 '12 at 6:50
    
@macias, neither does clonezilla; you have to resize the filesystem afterwards ( with resize2fs for ext[234] ). –  psusi May 7 '12 at 14:20
    
@psusi What if upgrading from small hdd to bigger hdd. The partition on small hdd is still quite small and 95% used. Perhaps one could resize the destination partition to that size and have it work, but one may well want the destination partition to be bigger. Is that possible, and if so, then why doesn't having it bigger to start with work? –  barlop Jan 20 '13 at 11:14
    
@barlop, the partition is just a container. The only thing the size of the partition has to do with the size of the filesystem is that the filesystem can not be larger than its container. Moving the filesystem to a larger container does not automatically make the filesystem larger, hence resize2fs. –  psusi Jan 20 '13 at 15:23

When using dd to restore it back (and really, that's the easiest way), you can just change the values of the if and of arguments and then the image is restored. That's just like copying a backup folder from an external hard disk back to the "normal" hard disk.

share|improve this answer
1  
The problem is, the target partition in restore is not the same as source partition in save, it is bigger, and dd didn't handle it (I tried already). –  greenoldman May 6 '12 at 6:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.