Since this question is mostly gem5 agnostic, I would also recommend thoroughly 
searching Stack Exchange as well, e.g.: 
https://superuser.com/questions/693158/can-i-expand-the-size-of-a-file-based-disk-image

Another thing you might be able to do is to put your additions on a separate 
image as mentioned at: 
https://stackoverflow.com/questions/55603929/question-about-transferring-files-to-arm-linux-in-gem5-full-system-mode

It is also worth noting that QEMU's qcow2 disk image format allows for sparse 
images, allowing to create a humongous image that takes up little disk space. 
It would be awesome if we added support for it in gem5 at some point. Ubuntu's 
convenient cloud images are distributed like that for example.


________________________________
From: gem5-users <gem5-users-boun...@gem5.org> on behalf of Seeley, Justin P 
<jpsee...@wpi.edu>
Sent: Tuesday, April 16, 2019 7:31:45 PM
To: gem5-users@gem5.org
Subject: [gem5-users] Expanding Disk Image for FS Mode

Hello,

I am using the X86 disk image from:
http://gem5.org/Download

I am trying to get full system mode working, so I use an R script as a 
benchmark.

This requires me to edit the disk image by:
1. Copying over my R scripts
2. Installing R
3. Installing Rscript

I can easily copy over my R scripts by just copying them over to the mounted 
disk image.

However, installing R and Rscript is not so easy. The disk image does not have 
enough room to install them, so I have been trying to expand the disk image to 
no success. I get the following for this disk image.

> e2fsck -f linux-x86.img
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open linux-x86.img

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a dos partition table in linux-x86.img
________

I am able to increase the disk size with:
> sudo dd if=/dev/zero bs=1M count=400 >>  linux-x86.img

But because of this superblock issue resize2fs does not work.

Has anyone had any luck expanding the X86 disk image for gem5? It seems strange 
the disk image from the gem5 source has this superblock issue.

Thank you,
Justin

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to