create file that can be mounted I am trying to create a bootable filesystem filename.fs from a directory that contains all the OS files.
My problem is that I cannot create a file that contains a filesystem. I found a explanation for doing this on ubuntu but macos does not have mkfs and newfs_* gives me the following error.
&gt; newfs_msdos ./clonezilla-live-2.6.6-15-amd64.fs
newfs_msdos: warning: ./clonezilla-live-2.6.6-15-amd64.fs is not a character device
newfs_msdos: ./clonezilla-live-2.6.6-15-amd64.fs: Cannot get partition offset: Inappropriate ioctl for device

I may be going about this all wrong but I have not found any instructions on creating a bootable filesystem from a directory that contains all the files for my OS.
To create a mountable disk image, use hdiutil. The straightforward way just creates a DMG which can then be mounted and written to
hdiutil create -size 500m -volname CLONEZIL -fs FAT32 clonezilla.dmg

To create a DMG with the content of an existing directory use
hdiutil create -srcfolder my-clonezilla-dir -volname CLONEZIL -fs FAT32 clonezilla.dmg

To mount it afterwards either double-click the DMG file in Finder or run one of the following in Terminal
open clonezilla.dmg
hdiutil attach clonezilla.dmg

To unmount either eject in Finder or run
hdiutil detach /Volumes/CLONEZIL