LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   backup to qcow2 (or anything VM compatible) using dd (anything) (https://www.linuxquestions.org/questions/linux-software-2/backup-to-qcow2-or-anything-vm-compatible-using-dd-anything-817512/)

serafean 07-01-2010 06:16 PM

backup to qcow2 (or anything VM compatible) using dd (anything)
 
Hi, my laptop has a cracked screen and is going to ship for repairs. I'd like to backup the data I have oon it.I'm thinking "tar -cpjf" would do the trick, but a crazy thought entered my mind : backup the entire system to a virtual disk (with a format like qcow2) and then be able to run it from a VM (like qemu). is that even possible?
I mean, backing up your system so that it is vm-ready would be really cool. assuming sda5=root
Code:

dd if=/dev/sda5 of=~/root.qcow2
or would that just create a file the size of the partition? would it run anyway?

The optimal shipping time is less than 24 hours away, so a quick answer would really be appreciated.

Serafean

unSpawn 07-01-2010 07:14 PM

'dd if=/dev/sda of=/path/to/humongous/storage/disk.dd; qemu-img convert -c -f raw -O qcow2 /path/to/humongous/storage/disk.dd /path/to/humongous/storage/disk.qcow2;'?

jefro 07-01-2010 07:38 PM

I don't even convert them when I use qemu. I just dd the disk and use it as hda. I don't rename the file though. It really isn't a qcow2 file just by dding it.

serafean 07-02-2010 02:39 AM

Quote:

It really isn't a qcow2 file just by dding it.
So a qcow2 file can only be written to from a VM? noted.
Thanks UnSpawn, personnally I'd replace the first ; with &&. Just seems more failure-safe.


All times are GMT -5. The time now is 11:21 PM.