Try libguestfs-tools:
https://askubuntu.com/questions/107228/how-to-resize-virtual-machine-disk/481887#481887

It is the easiest method. I think it boots QEMU, mounts the image, and
does the resizing operations for you.

You may need to add sudo to commands due to this bug:
https://askubuntu.com/questions/1046828/how-to-run-libguestfs-tools-tools-such-as-virt-make-fs-without-sudo

I've just tested it on a Ubuntu 19.10 host and Ubuntu 18.04 Ubuntu
server image after server setup mentioned at:
https://askubuntu.com/questions/884534/how-to-run-ubuntu-desktop-on-qemu/1046792#1046792
(replacing all qcow2 with raw)

On Wed, Apr 22, 2020 at 5:23 PM Choe, Jiwon via gem5-users
<gem5-users@gem5.org> wrote:
>
> Hi all,
>
> This might not be exactly gem5-related, but I was wondering if anyone on this 
> mailing list has done this before and could help me out.
>
> I'm trying to increase the .img disk image size, and I thought I had made 
> some progress by using "qemu-img resize" and "parted" linux commands. But 
> when I try to use this image, I get an error saying: "EXT2-fs (sda1): error: 
> read_inode_bitmap: Cannot read inode bitmap".
>
> When I run e2fsck on the image, I get the following message:
> The filesystem size (according to the superblock) is 1048416 blocks
> The physical size of the device is 524128 blocks
> Either the superblock or the partition table is likely to be corrupt!
>
> Has anyone successfully managed to increase a disk image size? Or would you 
> recommend that I just create a fresh new disk image with a larger size?
>
> Thanks,
> Jiwon
> _______________________________________________
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to