Hello everyone!

I am working on resizing qcow2 images using virt-resize+liguestfs. E.g. I when shrinking a partition, I have to resize filesystem using resize2fs-size. The problem is that I cannot find out minimal partition size (aka resize2fs -P). The only way is calling "resize2fs-size 1K", wait for resize2fs to claim "resize2fs: New size smaller than minimum (510050)" and parse this output.

It is known that resize2fs carries out complex calculations (no always correct) to get minimal size, so statvfs/tune2fs-l cannot help.

The questions are:
1) How to get minimal partition size (equal to resize2fs -P)?
2) More general, how to execute commands from appliance but make them run over image (which may not have anything but filesystem) - I saw something like that in source.

Thanks in advance!

--
Your sincerely,
Maxim Perevedentsev

_______________________________________________
Libguestfs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to