Hi,Seems that this will be the dealbreaker for ProxMox for us ... unfortunate. The only workaround I see is to create the LV, mount it, rsync the files, and unmount.
We need to automate it so we can't be booting into GParted manually for each one of them. We need to resize the partition on the KVM that we dd'ed into the iSCSI LV to the maximum size of the VM - parted / cfdisk etc all don't work right ...
Any ideas feel fre to let us know
# ls -lsa bigdisk
4194304 -rw-r--r-- 1 admin admin 4294967296 Nov 8 23:08 bigdisk
# dd if=/dev/zero of=bigdisk bs=1G seek=4 count=6
# ls -lsa bigdisk
10485760 -rw-r--r-- 1 admin admin 10737418240 Nov 8 23:12 bigdisk
# fdisk -l bigdisk
Disk bigdisk: 10.7 GB, 10737418240 bytes
43 heads, 32 sectors/track, 15240 cylinders, total 20971520 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
Disk identifier: 0x9dbffc21
Device Boot Start End Blocks Id System
bigdisk1 2048 8388607 4193280 83 Linux
#fdisk -l bigdisk
Disk bigdisk: 10.7 GB, 10737418240 bytes
40 heads, 32 sectors/track, 16384 cylinders, total 20971520 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
Disk identifier: 0x9dbffc21
Device Boot Start End Blocks Id System
bigdisk1 2048 20971519 10484736 83 Linux
# kpartx -a bigdisk
# e2fsck -f /dev/mapper/loop0p1
# resize2fs /dev/mapper/loop0p1
# mount /dev/mapper/loop0p1 /mnt
# df -k /mnt
Dateisystem 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
/dev/mapper/loop0p1 10320184 75556 9720392 1% /mnt
# umount /mnt; kpartx -d bigdisk
If I understand you correctly, you copied a 20 GB raw image onto an 50 GB LV. That should work, but you need to resize the partition (you seem to have achieved that) AND you need to resize the filesystem on top of it. For instance you need to use resize2fs or xfs_growfs for ext2+ or xfs on the relevant partition, respectively.
Well. Please show us the exact error messages you see, and an sfdisk -l <device> would also be useful.So what we've done is
1) Create a 50GB LV on SAN through VM
2) Copy a 20GB .RAW file as a block into the LV
3) LV partitions now show 1.0mb partition, a 20GB partition, and empty space of about 29.9GB at the end.
When I do cfdisk the device, it shows up fine ... BUT when I try to maximize, it doesn't work. Presumably b/c its mounted. And you can't unmount because the iscsi connection will drop.
We try parted - again can't resize and there's no swap - I am thinking the partition starts at the wrong sector? Also, why is there a 1.0MB partition ahead of our regular partition?
We basically need to automate this process - someone requests a VM, we set it up, copy in image, and resize partition. FDISK parameters can be fed in I suppose but this does not seem to work correctly.