Some applications crash on a sparsebundle disk image?

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
emendelson
Forum All-Star
Posts: 1228
Joined: Tue Oct 14, 2008 12:12 am

Some applications crash on a sparsebundle disk image?

Post by emendelson »

Following a suggestion here a few weeks ago about using the sparsebundle format for SheepShaver disk images, I replaced the disk image in one of my projects with a sparsebundle - and then found (as I had discovered earlier but had forgotten) that some programs crash when run from a sparsebundle disk image, so I've had to go back to the old .dsk/.img format.

The program that caused a crash in my project was the macps2pdf script in the MacGhostView32 application. SheepShaver crashed even when i compiled an AppleScript that ran macps2pdf. it doesn't cause any problems on a traditional disk image.

I have no idea why this should happen, but I remember that I encountered similar problems when I first tried using sparsebundles in my projects some years ago. I don't remember the exact detail, but I remember going back to the standard disk image, as I did just now.

Probably no one else will have this kind of problem, but I thought it was worthwhile to post a message about it.
User avatar
adespoton
Forum All-Star
Posts: 3066
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Some applications crash on a sparsebundle disk image?

Post by adespoton »

Thanks; I'll keep an eye on it. I had similar issues years ago when sparsebundle support was first added, but did something to fix it at some later date, and I'm not sure what that was now. It's possibly that I modified my bundles to have 1MB files instead of the default 8MB, or it could be something else.
emendelson
Forum All-Star
Posts: 1228
Joined: Tue Oct 14, 2008 12:12 am

Re: Some applications crash on a sparsebundle disk image?

Post by emendelson »

If you remember what you did to fix it, please let us know.
User avatar
mabam
Master Emulator
Posts: 318
Joined: Wed Apr 10, 2013 9:32 am

Re: Some applications crash on a sparsebundle disk image?

Post by mabam »

When I tried a few years ago, I wasn't even able to install OS 9 in SheepShaver using a sparsebundle image. Would indeed be great to know how to fix this.
User avatar
Ronald P. Regensburg
Expert User
Posts: 6315
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Some applications crash on a sparsebundle disk image?

Post by Ronald P. Regensburg »

I vaguely remember that that the initial assigned size of the sparsebundle image mattered. There must be an old discussion about that somewhere in the forum.
emendelson
Forum All-Star
Posts: 1228
Joined: Tue Oct 14, 2008 12:12 am

Re: Some applications crash on a sparsebundle disk image?

Post by emendelson »

Couldn't find anything in old messages after a quick search, but I may not have looked deeply enough.
User avatar
adespoton
Forum All-Star
Posts: 3066
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Some applications crash on a sparsebundle disk image?

Post by adespoton »

I think it may not have been on the forum; we may have been discussing it directly with Vasi or on the mail list.
User avatar
adespoton
Forum All-Star
Posts: 3066
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Some applications crash on a sparsebundle disk image?

Post by adespoton »

Here's the script I use to prep my images as sparsebundles:

Code: Select all

#!/bin/sh

echo $1
hdiutil convert "$1" -format UDSB -tgtimagekey sparse-band-size=2048 -o "$1-1Mb.sparsebundle"
I use this on a regular 2GB disk image after installing 9.0.4.
emendelson
Forum All-Star
Posts: 1228
Joined: Tue Oct 14, 2008 12:12 am

Re: Some applications crash on a sparsebundle disk image?

Post by emendelson »

adespoton wrote:Here's the script I use to prep my images as sparsebundles:

Code: Select all

#!/bin/sh

echo $1
hdiutil convert "$1" -format UDSB -tgtimagekey sparse-band-size=2048 -o "$1-1Mb.sparsebundle"
That seems to work! Thank you! It's good to have it on record here for future reference. The macpcl2pdf app doesn't crash the system now.
emendelson
Forum All-Star
Posts: 1228
Joined: Tue Oct 14, 2008 12:12 am

Re: Some applications crash on a sparsebundle disk image?

Post by emendelson »

And here is an AppleScript wrapper for adespoton's script that includes error handling:

Code: Select all

on open theDrop
	repeat with thisItem in theDrop
		set thisPath to POSIX path of thisItem
		set outPath to thisPath & "-1Mb.sparsebundle"
		try
			do shell script "hdiutil convert" & space & quoted form of thisPath & space & "-format UDSB -tgtimagekey sparse-band-size=2048 -o" & space & quoted form of outPath
		on error err
			if err contains "recognized" then
				display dialog "Please change the extension of the disk image to .img and try again." buttons {"OK"}
			end if
		end try
	end repeat
end open
Certainly adespoton can improve on this but it seems to work.
User avatar
adespoton
Forum All-Star
Posts: 3066
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Some applications crash on a sparsebundle disk image?

Post by adespoton »

I'll add the git repo to this thread too:

https://github.com/adespoton/sparserbundler
emendelson
Forum All-Star
Posts: 1228
Joined: Tue Oct 14, 2008 12:12 am

Re: Some applications crash on a sparsebundle disk image?

Post by emendelson »

adespoton wrote:I'll add the git repo to this thread too:

https://github.com/adespoton/sparserbundler
Could you check the 7z file in the repository? I can't extract it either on Windows (with 7-Zip) or macOS (with BetterZip). And various other programs say the file is invalid.
User avatar
adespoton
Forum All-Star
Posts: 3066
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Some applications crash on a sparsebundle disk image?

Post by adespoton »

Hmm; I'll check it over the next couple of days; it's possible the upload never completed correctly (the original decompresses for me with Keka and The Unarchiver).
emendelson
Forum All-Star
Posts: 1228
Joined: Tue Oct 14, 2008 12:12 am

Re: Some applications crash on a sparsebundle disk image?

Post by emendelson »

Slightly improved code for the AppleScript wrapper (and, for anyone doing this for the first time, you must save it in the File Format "Application" (not "Script"):

Code: Select all

on open theDrop
	repeat with thisItem in theDrop
		set thisPath to POSIX path of thisItem
		set outPath to thisPath & "-1Mb.sparsebundle"
		try
			do shell script "hdiutil convert" & space & quoted form of thisPath & space & "-format UDSB -tgtimagekey sparse-band-size=2048 -o" & space & quoted form of outPath
		on error err
			if err contains "recognized" then
				display dialog "Please change the extension of the disk image to .img and try again." buttons {"OK"}
			else
				display dialog "Error:" & space & err buttons {"OK"}
			end if
		end try
	end repeat
end open
User avatar
adespoton
Forum All-Star
Posts: 3066
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Some applications crash on a sparsebundle disk image?

Post by adespoton »

Github repo fixed; somehow I pushed the alias instead of the archive. It should be accessible now.
Post Reply