On 09/26/2012 04:13 PM, Stefan G. Weichinger wrote: > > I had an XFS-filesystem within a KVM-VM (32 bit Gentoo, so it isn't that > off-topic, btw ;-) ) > > ... and I did a lot of work within that filesystem over the last 2 days. > > Unfortunately it ran full so I decided to shutdown the VM, use qemu-img > to resize that image-file (raw format), reboot the VM ... and deleted > the partition /dev/vdb1 (virtio ...) and recreated vdb1 with the full > size of the underlying image-file. > > XFS doesn't like that.
That won't work with any filesystem. I think instead of that last step, you should have booted to a livecd and used GParted to resize the partition. I went through this once: > http://michael.orlitzky.com/articles/resizing_a_kvm_or_qemu_disk_image.php That won't help you get your stuff back but it might help out the next time. There's proprietary software that can scan the disk for the deleted partition. They used to be included on Hiren's Boot CD circa 9.0, but you could easily waste a few hours screwing around with it. If there was nothing critical and nobody else has any clever ideas, you're probably better off reinstalling. You should cherish the times you trash something non-critical.