HFS Disk Maker: Tool for creating HFS disk images

Anything about Mac emulation that does not belong in the above categories.

Moderators: Cat_7, Ronald P. Regensburg

User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by adespoton »

Under 10.6, you can just use Disk Utility to create HFS images. I believe this capability was removed in 10.8?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by Ronald P. Regensburg »

Writing to HFS was dropped in 10.6 (Snow Leopard), but this post by our own ClockWise suggests that one can write HFS on Snow Leopard with FuseHFS: http://www.emaculation.com/forum/viewtopic.php?t=6365
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by adespoton »

Ah yes; that's what I was thinking of -- my mistake. I had FuseHFS installed in 10.6, but that broke with 10.7, as OSXFuse doesn't support the FuseHFS plugin.
integerpoet
Space Cadet
Posts: 1
Joined: Sat Sep 26, 2015 9:10 pm

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by integerpoet »

This was exactly the kind of tool I wanted. Thanks!

It seems to be a "below the radar" kind of thing on your web site; nothing calls attention to it. And this gets me thinking…

If you did either (or both) of the following things, I'd feel more confident about the continued existence of this app:
  1. productize it (start generating revenue for yourself)
  2. open-source it
Any chance of either of those happening?
User avatar
24bit
Forum All-Star
Posts: 1424
Joined: Wed Nov 11, 2009 5:47 pm
Location: Germany

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by 24bit »

Most of you will know, that DU in 10.6 could write NDIF images - though Finder can not write to them.
However, the hidden options for DU in 10.6 can still be enabled as described here for 10.4:
http://hints.macworld.com/article.php?s ... 1181738987

Image

Whatever it may be good for...
User avatar
sentient06
Mac Mechanic
Posts: 188
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by sentient06 »

I made a small app a while ago that I'm quite sure might work on recent OSX systems to create HFS image files, please try it:

http://hfsutilsgui.mariot.me.uk/

I only released one version. I didn't get much feedback, perhaps it was badly published?

It doesn't do much, I simply imitated the "Disk Utility" interface to allow creation of HFS images. I was thinking about diving into file read-writting, but I simply gave up in order to sort out other applications I was prioritising at the time.

As the name suggests, it is simply a GUI for HFS Utils, so the binaries are nested on it. It is open-source, so feel free to copy it, just don't sell it. =D

Anyway, it might be useful. Feedbacks are very welcomed. If there is a demand I can improve it and give it new features.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by Ronald P. Regensburg »

I was indeed not aware of your app, I knew the HFS Disk Maker by CharlesS that this topic is about. HFS Disk Maker creates HFS disk images from a file or from a folder with files. It makes it easy to transfer files from OSX to a 68k emulator.

Your app works fine here (in Yosemite) to create a new empty HFS (or HFS+) image of any size.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by adespoton »

I think the two might have got confused. I went looking for sentient06's app a while ago and ended up with CharlesS's one instead.

I'll try it on 10.11 sometime over the next day to see how it works :)
User avatar
sentient06
Mac Mechanic
Posts: 188
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by sentient06 »

Ronald P. Regensburg wrote:I was indeed not aware of your app, I knew the HFS Disk Maker by CharlesS that this topic is about. HFS Disk Maker creates HFS disk images from a file or from a folder with files. It makes it easy to transfer files from OSX to a 68k emulator.

Your app works fine here (in Yosemite) to create a new empty HFS (or HFS+) image of any size.
I just tested HFS Disk Maker, it is very handy. =D

How did you do that, CharlesS? Did you use any libraries or do you create the whole data structure manually? You mention the image is done from scratch, that's why I ask.

I wonder.. if we could make a converter to get all contents from a HFS+ image and copy over to a "replica" in HFS, it could be a nice alternative. Or maybe not, maybe that's just adding complexity to something that already works.

We should think of a way of allowing users to alter the existing HFS image contents, but only thinking of creating a bespoke UI for drag-and-drop and listing folders like HFVExplorer makes me tired. Maybe we could try to sync a folder and an HFS image? I believe HFSUtils can be used for that.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by adespoton »

I can think of two good ways to move this forward... one is to stay OSX-only and make it a filesystem plugin, which would mean that hdiutil would inherit its features and images could be easily mounted read/write in the Finder.

The other is to make a platform-independent solution so we can deploy it to any OS -- the optimal situation here would be to be able to take the contents of a folder and coerce them into an hfs image, and vice versa. Having a metadata editor built in would be icing on the cake (manually select resource fork, create Desktop DB and DF files with appropriate entries, etc.).
User avatar
sentient06
Mac Mechanic
Posts: 188
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by sentient06 »

adespoton wrote:I can think of two good ways to move this forward... one is to stay OSX-only and make it a filesystem plugin, which would mean that hdiutil would inherit its features and images could be easily mounted read/write in the Finder.

Mmmmm like paragon's NTFS support and OpenZFS?

Where to start? I made a quick research on how to work with filesystem plugins, but no success. Apparently is not a very discussed subject, probably not many projects out there aiming at new filesystem support. But it seems like an obvious solution for OSX users, I wonder is no one ever did it..
Last edited by sentient06 on Fri Nov 06, 2015 11:05 am, edited 1 time in total.
User avatar
sentient06
Mac Mechanic
Posts: 188
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by sentient06 »

Hey! doesn't FuseHFS do that!?
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by adespoton »

No, FuseHFS goes through Fuse instead of through the filesystems framework. This means that it can be made available to the OS as a filesystem, but it doesn't present the components to hdiutil in a way that it can do transparent operations and image creation. It should be possible to create a filesystem framework based on FuseHFS, but that hasn't been done to date.
CharlesS
Granny Smith
Posts: 107
Joined: Thu Aug 14, 2008 9:05 am

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by CharlesS »

sentient06 wrote:
Ronald P. Regensburg wrote:I was indeed not aware of your app, I knew the HFS Disk Maker by CharlesS that this topic is about. HFS Disk Maker creates HFS disk images from a file or from a folder with files. It makes it easy to transfer files from OSX to a 68k emulator.

Your app works fine here (in Yosemite) to create a new empty HFS (or HFS+) image of any size.
I just tested HFS Disk Maker, it is very handy. =D

How did you do that, CharlesS? Did you use any libraries or do you create the whole data structure manually? You mention the image is done from scratch, that's why I ask.
My tool creates the whole data structure manually, using the spec in Inside Macintosh. No libraries involved beyond the standard Cocoa frameworks and whatnot that you need to make a typical OS X app. Not the easiest way to go about doing it, and it certainly took me a while to get it working well enough for fsck not to complain about things, but it seems to work now, and I feel like I learned a lot in the process of writing it. It's also written expressly with Mac compatibility in mind, not being a port of an app for another platform, so it takes special care to preserve the resource fork, finder info, etc. that are already associated with the files on the native HFS+ disk.

There are things that could be better... currently my tool has to leave a bunch of empty space on the image so that the OS can create the Desktop file, and it errs on the side of generosity since the early Mac OS somewhat stupidly refuses to mount an HFS disk at all if it doesn't have a Desktop file and the system can't create one. This makes the resulting images a bit larger in size than they strictly need to be; if I were to reverse-engineer the format of the Desktop file and create it by scratch instead of relying on the OS to do it, things could be packed much more tightly together. I just don't have time right now, though.
I wonder.. if we could make a converter to get all contents from a HFS+ image and copy over to a "replica" in HFS, it could be a nice alternative. Or maybe not, maybe that's just adding complexity to something that already works.

We should think of a way of allowing users to alter the existing HFS image contents, but only thinking of creating a bespoke UI for drag-and-drop and listing folders like HFVExplorer makes me tired. Maybe we could try to sync a folder and an HFS image? I believe HFSUtils can be used for that.
Building an HFS disk from scratch was enough work when I was just making a static snapshot of something. Adding code to modify an existing one—well, once you've done that, you've effectively written a whole file system driver. More time than I want to spend on something like this.

If you need to dynamically modify HFS images, FuseHFS works for that. My thinking in creating this tool was that the great majority of the time that you're dealing with HFS images, it's to get something into or out of the emulator from the host environment. Getting things out of the emulator is easy enough, since OS X still has read-only HFS support. Importing things into the emulator is a pain, though, and it was one even when OS X still had write support for HFS, since you had to create the disk image, mount it, copy files in, dismount—just too many steps. I wanted to have a way to quickly turn a folder into something that be plugged right into the emulator in one step, which is why I made this little tool.
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
User avatar
sentient06
Mac Mechanic
Posts: 188
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by sentient06 »

Ah, well done, my friend. To code it from scratch. Really cool. :cool:

I didn't know Mac OS required a desktop file. Is it that invisible alias that holds anything you might move to the desktop? Does anyone know how does a read-only media like a CD handle this desktop file? It could be possible to simply use a template and write the bytes into the image, I suppose. Now I'm curious, I must do some tests.. =D
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by adespoton »

Mac OS wrote a Desktop DB and Desktop DF file (or on earlier OSes, just the Desktop file) to each volume, and this was used to track not only what was in the desktop path, but also all Finder Info comments, and in the Desktop DF case, cached icons as well.

Basically, it's where the extended metadata was kept that the Finder needed to display files and folders correctly. This also means that if you attempt to mount a disk image in a locked state, you'll hit the same issue.

And on really early versions of the OS, the Desktop file needs to be writeable on the boot volume in order for the volume to boot correctly. This means that on Mini vMac, you can't use a vanilla boot image of System 1 for example without first stripping the disk image header (or compiling your mini vMac to mount standard images as writeable).

CharlesS's application avoids this issue by not writing the header in the first place :)

That reminds me: do you include an option to bless a system folder if it is in the folder being converted? That could become really useful as time goes on.
CharlesS
Granny Smith
Posts: 107
Joined: Thu Aug 14, 2008 9:05 am

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by CharlesS »

adespoton wrote:Mac OS wrote a Desktop DB and Desktop DF file (or on earlier OSes, just the Desktop file) to each volume, and this was used to track not only what was in the desktop path, but also all Finder Info comments, and in the Desktop DF case, cached icons as well.

Basically, it's where the extended metadata was kept that the Finder needed to display files and folders correctly. This also means that if you attempt to mount a disk image in a locked state, you'll hit the same issue.
It also keeps track of application/document bindings, IIRC.

The important thing is that the classic OS (System 6, at least—I haven't tested this in System 7) won't mount a disk without one.
That reminds me: do you include an option to bless a system folder if it is in the folder being converted? That could become really useful as time goes on.
Not currently, but you're right, that could be a useful idea for the future. You can bless the folder pretty easily, though, just by booting from another Mac boot disk, and then mounting the image you want to bless and double-clicking on the System Folder on it—that usually causes the Mac OS to bless the System Folder you just opened.

edit: Actually, thinking about it a bit, I don't think you'd want to use HFS Disk Maker to make a bootable system disk, since it only leaves a small space for the Desktop file and otherwise will be completely full. You might have trouble writing things like preference files and the like.
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: HFS Disk Maker: Tool for creating HFS disk images

Post by adespoton »

Hey... maybe you could make the "slack space" a user-defined option if you hold down the option key :) That way, you could get rid of it altogether (not a good idea, but hey...) or increase it to whatever value you want by just padding with 0s :)
Post Reply