Reverting to physical disk after importing with qm import-from

fmaione

Member
Mar 24, 2022
21
16
8
Hello, I just imported a physical disk to a VM using qm set 998 -scsi0 local-storage-zfs:0,import-from=/dev/sdd

There is a way to do the opposite, since the physical disk is the same? As the name says, VM disk is stored on ZFS.

Many thanks
 
You can try to pass-through a disk to VM, then use "disk>move" in VM hardware option. I am not sure if it will work.
You can always use "qemu-img" directly to move image around, take a look at "man qemu-img" or search for "qemu-img examples".

If the disk is stored in ZFS in raw format, you may even be able to use simple "dd".

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
@bbgeek17 you were absolutely right. Although virtual disk had a bunch of KB more than physical one, I just reverted using dd. It was a ZFS pool stored on the two-partitions layout (sdd1 and sdd9) and despite dd final error for going short writing on physical device, zpool scrub went absolutely well

The full story:
  1. I imported a physical disc to a VM using qm set 998 -scsi0 local-storage-zfs:0,import-from=/dev/sdd
  2. I used it
  3. I reverted to physical disk doing:
    • attached the physical disk via pass-through to the vm using qm set VMID -scsiX /dev/disk/by-id/ata-SanDisk_SDSSDA240G_17427xxxxxx,vendor=SanDisk,product=SDSSDA240G,serial=17427xxxxxx,cache=writeback,iothread=1,backup=0,replicate=0,rerror=report,werror=report
    • executing dd if=/dev/VIRTUALDISK of=/dev/PHYSICALDISK bs=10M status=progress
So if you get an error on the final stage of write it's because virtual disk has too much sectors.

Use at your risk, make sure you have backups.
 
Last edited: