[SOLVED] Creating raw image from physical disk for migration

TobiasE

New Member
Dec 6, 2017
24
1
1
44
Hello
I was under the impression that I could create a .raw image of my linux device for migrating to proxmox like this:
dd if=/dev/hda | gzip | ssh proxmoxserver dd -of=disk_image.raw
The problem is that this raw image gets really big, bigger than virtual disk images in general. I think I am missing something.
Is there some other step that I am missing? I thought I could just create an image like above and then add it to a proxmox vm.
 
Hello
I was under the impression that I could create a .raw image of my linux device for migrating to proxmox like this:
dd if=/dev/hda | gzip | ssh proxmoxserver dd -of=disk_image.raw
The problem is that this raw image gets really big, bigger than virtual disk images in general. I think I am missing something.
Is there some other step that I am missing? I thought I could just create an image like above and then add it to a proxmox vm.


First, you forgot the unzip in your example and the command line will not work directly, but I think that you just typed it manually. (More information https://pve.proxmox.com/wiki/Migrat...ws_physical_machine_to_a_VM_raw_file_directly)

Using the described method will create a file that is exactly as big as the real source device was and not as big as your used space was.
 
Yes, sorry about the command.
So if I have a disk of 200 GB then the virtual representation of that file will also be 200 GB?
When i create disks from within proxmox, the actual file size of the disk is much smaller than the disk's capacity,
So then using dd is a bad option for migrating disks to proxmox?
 
Yes, sorry about the command.
So if I have a disk of 200 GB then the virtual representation of that file will also be 200 GB?

You wrote .raw file and yes, that's the case for .raw files. That's the whole purpose of a .raw file.
You can (and I suggest you do) convert it afterward to another format. Either via GUI or via qemu-img as explained in https://pve.proxmox.com/wiki/Migration_of_servers_to_Proxmox_VE.

When i create disks from within proxmox, the actual file size of the disk is much smaller than the disk's capacity,

depending on the chosen storage and file type, yes. It's called thin provisioning.

So then using dd is a bad option for migrating disks to proxmox?

No, necessary first step. Please see the aforementioned wiki article (url).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!