[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

removing 'md' device from a qcow2 image

From: address@hidden
Subject: removing 'md' device from a qcow2 image
Date: Tue, 10 Dec 2019 02:35:55 +0000 (UTC)

I have been given the following qcow2 image.

root@nvc-t2-227:~# qemu-img info ./img.orig
image: ./image.orig
file format: qcow2
virtual size: 800G (858993459200 bytes)
disk size: 8.5G

I need to shrink the virtual size to 50G.

Unfortunately, the qcow2 image has a raid array inside it as a result of which virt-resize fails.

root@nvc-t2-227:~# qemu-nbd --connect=/dev/nbd0 ./img.orig
root@nvc-t2-227:~# fdisk -l

root@nvc-t2-227:~# fdisk -l /dev/nbd0
Disk /dev/nbd0: 800 GiB, 858993459200 bytes, 1677721600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 280F7B6B-E02A-41BA-9FA8-258C021EA06E

Device        Start        End    Sectors   Size Type
/dev/nbd0p1    2048    1050623    1048576   512M EFI System
/dev/nbd0p2 1050624 1637091327 1636040704 780.1G Linux RAID

Is there a way I can shrink this qcow2 image?  
virt-resize cannot handle the software raid 'md' interface.
I am fine removing the raid interface and shrinking the image to a smaller size.
How can I achieve this?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]