folder size requirements

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
starfiretbt
Mac Mechanic
Posts: 161
Joined: Fri Jun 06, 2014 8:33 pm

folder size requirements

Post by starfiretbt »

Qemu has a really complex way of making drives (volumes in basilisk and sheepshaver), I created one for my hard disk. I seem to remember hearing somewhere that the amount of memory allocated to the drive will increase automatically as it is needed (for example my computer only says it has 1.2 GB left). Is my memory correct or do I need to make more hard drives? I know with Basilisk I have a hard drive my operating system is installed on and a blank one that I stored my games into. Sheepshaver had more memory intensive games so I had three dedicated to that.
User avatar
Cat_7
Expert User
Posts: 6176
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: folder size requirements

Post by Cat_7 »

Both Basilisk and SheepShaver for Windows use fixed size hard disk images.
With Qemu you can use qcow2 images. They use a much space as there is data in the image.

To create one, use: qemu-img.exe create -f qcow2 -o size=2G MacOS9.2.qcow2
To convert an img file to qcow2, use: qemu-img.exe convert -f raw -O image.img image.qcow2

On the command line to start Qemu, use:
-drive file=MacOS9.2.qcow2,format=qcow2,media=disk
(but adjust that line to your installation location and image name)

Best,
Cat_7
starfiretbt
Mac Mechanic
Posts: 161
Joined: Fri Jun 06, 2014 8:33 pm

Re: folder size requirements

Post by starfiretbt »

You mean use command prompt to create it, correct? Just like I did with the qemu drive I have my os 9.2 installed on? I remember being confused in the guide when I was told to use the qemu-img.exe to create a drive until I was told to use the command prompt instead. I'm going to ask instead of try because I am worried about using command prompt incorrectly (isn't that the function that can change how a computer operates?) so please don't be angry.

So open command prompt and enter "create -f qcow2 -o size=2G MacOS9.2.qcow2" then enter "convert -f raw -O image.img image.qcow2" then edit my qemu.bat file from

qemu-system-ppc-screamer.exe ^
-L pc-bios ^
-M mac99,via=pmu ^
-m 512 ^
-display sdl ^
-boot c ^
-drive file=MacOS9.2.img,format=raw,media=disk ^
-device sungem,netdev=network01 -netdev user,id=network01,hostfwd=tcp::2121-:21

to

qemu-system-ppc-screamer.exe ^
-L pc-bios ^
-M mac99,via=pmu ^
-m 512 ^
-display sdl ^
-boot c ^
-drive file=MacOS9.2.img,format=raw,media=disk ^
-drive file=MacOS9.2.qcow2,format=qcow2,media=disk ^
-device sungem,netdev=network01 -netdev user,id=network01,hostfwd=tcp::2121-:21
User avatar
Cat_7
Expert User
Posts: 6176
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: folder size requirements

Post by Cat_7 »

Let me rephrase that:

Open a command prompt and navigate to the folder where qemu-img.exe is. Then convert the MacOS9.2.img file that you already have to the qcow2 format:
qemu-img.exe convert -f raw -O MacOS9.2.img MacOS9.2.qcow2

Edit your qemu.bat file to only have one drive in it:
-drive file=MacOS9.2.qcow2,format=qcow2,media=disk ^

Start qemu.bat. If MacOS9.2 boots successfully and everything works, you can delete the old MacOS9.2.img.

Best,
Cat_7
starfiretbt
Mac Mechanic
Posts: 161
Joined: Fri Jun 06, 2014 8:33 pm

Re: folder size requirements

Post by starfiretbt »

Maybe I'm doing it wrong, tell me if my steps aren't correct

1. I opened command prompt
2. I entered everything in parenthesis "cd C:\Users\TBTol\Desktop\Games\Mac Emulation\Qemu" which is the location of my qemu folder with the .exe and .img files
3. I pressed enter
4. I copied and pasted qemu-img.exe convert -f raw -O MacOS9.2.img MacOS9.2.qcow2
5. I pressed enter
6. I get the error message "qemu-img.exe: Must specify image file name" even though my .img file is named the same as what the guide says and what you are saying, I even copied the file's name just in case I was reading it wrong but I still get that message.
User avatar
Cat_7
Expert User
Posts: 6176
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: folder size requirements

Post by Cat_7 »

The convert command is:

qemu-img.exe convert -f raw -O qcow2 MacOS9.2.img MacOS9.2.qcow2

Best,
Cat_7
starfiretbt
Mac Mechanic
Posts: 161
Joined: Fri Jun 06, 2014 8:33 pm

Re: folder size requirements

Post by starfiretbt »

That worked, but how does it solve my space issue? If I start putting software in my (I don't know what you would call it, basilisk and sheepshaver call them volumes) will space automatically grow to fit? In Sheepshaver I just made three volumes for all my games but some of them were really large.
It says I have 1.20 GB available, will this new file grow if I put more than 1.2 GB in it?
User avatar
adespoton
Forum All-Star
Posts: 4285
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: folder size requirements

Post by adespoton »

starfiretbt wrote: Wed Feb 21, 2024 9:58 pm That worked, but how does it solve my space issue? If I start putting software in my (I don't know what you would call it, basilisk and sheepshaver call them volumes) will space automatically grow to fit? In Sheepshaver I just made three volumes for all my games but some of them were really large.
It says I have 1.20 GB available, will this new file grow if I put more than 1.2 GB in it?
You'd be better off to create a new volume, actually. qcow2 allows you to use both compression and sparse images, meaning you can compress the enclosed data so it takes up less space on the host volume, and you can have the image file only be as large as the data it contains, ignoring empty space.

qemu-img.exe has a resize command. However, this will resize the maximum size of the IMAGE, but doesn't affect the VOLUME stored on that image -- so your volume would still be 1.2GB until you used a partition manager from within your emulator to resize the partition linked to the mounted volume.

This is a lot of steps with a lot of potential places for mistakes, so it's generally easier to just create a new qcow2 image, format it as a single volume, and then migrate your data over from the old volume to the new one from within the emulator. If you really don't want to do that, use the resize command to set a new volume size, then launch the emulator, launch Disk Tools (or whatever your partition manager of choice is) and then, if your partition manager supports it, resize the HFS+ volume.

I don't think Apple disk utilities supported resizing partitions until OS X 10.3 or later though, so you might have to use a third party tool like FWB HD Toolkit to do it, if it's even possible like that, or boot your image up attached to an OS X OS, and use Disk Utility to resize the OS 9 partition to use up all the available space on the image.

And it's worth pointing out that you are always required to set a maximum image size; you could set this to 2TiB, but it has to be something. And that image can have multiple partitions; you shouldn't have any partition be larger than the OS you're going to be using it with can support, though.

Essentially, Mac OS 9 can BOOT off a partition that is ~190GB or less.
Mac OS 9 can USE a partition that is 2TB or less.
HFS+, the partition system used by OS 9 and OS X/macOS, can handle partitions up to 2EB (that's Exabyte).

So your best path forward is to create a new qcow2 image of 190GB with compression, add it as a second volume to QEMU, boot QEMU, use Disk Tool to format the entire image as a single 190GB partition, mount that partition, copy everything over from your 1.2GB volume, bless the System Folder on the new volume, shut down the OS, remove the 1.2GB volume from your QEMU config, and start it back up again.

If you want a second, larger volume, create that in the same way but set the size to 2TB, and just keep both volumes mounted when emulating OS 9.

Both these images will start small, and keep growing as you use up space on them. The one caveat is that if you write data to the volume inside OS 9 and then delete it again, the qcow2 volume won't shrink in size; you need to "zero out" the empty space and then rebuild the image in the host to shrink it.
starfiretbt
Mac Mechanic
Posts: 161
Joined: Fri Jun 06, 2014 8:33 pm

Re: folder size requirements

Post by starfiretbt »

I accidentally posted in this thread viewtopic.php?t=12078. I was reviewing it to remember how to create a second drive.

I think I got it figured out. I did create a second drive and I used the "Drive Setup" from "Utilities" and it seems to work. I will let you guys know if I have any trouble. Thank you again for your patience.
starfiretbt
Mac Mechanic
Posts: 161
Joined: Fri Jun 06, 2014 8:33 pm

Re: folder size requirements

Post by starfiretbt »

I also wanted to thank you adespoton because I didn't know if it was clear it was your advice that I was following when I used the drive setup. I don't know if that specifically was what you were talking about when you mentioned disk tools but it was the closest thing I could find that looked like what you were talking about. I didn't want you to think I was ignoring your advice, I was following it even if I had trouble understanding it.
User avatar
adespoton
Forum All-Star
Posts: 4285
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: folder size requirements

Post by adespoton »

starfiretbt wrote: Fri Feb 23, 2024 10:09 pm I also wanted to thank you adespoton because I didn't know if it was clear it was your advice that I was following when I used the drive setup. I don't know if that specifically was what you were talking about when you mentioned disk tools but it was the closest thing I could find that looked like what you were talking about. I didn't want you to think I was ignoring your advice, I was following it even if I had trouble understanding it.
That's the right thing; I kept my advice generic because I couldn't remember offhand which application is used in OS 9 :)
Post Reply