Macintosh HFS Filesystem for Linux¶
Note
This filesystem doesn’t have a maintainer.
HFS stands forHierarchicalFileSystem and is the filesystem usedby the Mac Plus and all later Macintosh models. Earlier Macintoshmodels used MFS (MacintoshFileSystem), which is not supported,MacOS 8.1 and newer support a filesystem called HFS+ that’s similar toHFS but is extended in various areas. Use the hfsplus filesystem driverto access such filesystems from Linux.
Mount options¶
When mounting an HFS filesystem, the following options are accepted:
- creator=cccc, type=cccc
- Specifies the creator/type values as shown by the MacOS finderused for creating new files. Default values: ‘????’.
- uid=n, gid=n
- Specifies the user/group that owns all files on the filesystems.Default: user/group id of the mounting process.
- dir_umask=n, file_umask=n, umask=n
- Specifies the umask used for all files , all directories or allfiles and directories. Defaults to the umask of the mounting process.
- session=n
- Select the CDROM session to mount as HFS filesystem. Defaults toleaving that decision to the CDROM driver. This option will failwith anything but a CDROM as underlying devices.
- part=n
- Select partition number n from the devices. Does only makessense for CDROMS because they can’t be partitioned under Linux.For disk devices the generic partition parsing code does thisfor us. Defaults to not parsing the partition table at all.
- quiet
- Ignore invalid mount options instead of complaining.
Writing to HFS Filesystems¶
HFS is not a UNIX filesystem, thus it does not have the usual features you’dexpect:
- You can’t modify the set-uid, set-gid, sticky or executable bits or the uidand gid of files.
- You can’t create hard- or symlinks, device files, sockets or FIFOs.
HFS does on the other have the concepts of multiple forks per file. Thesenon-standard forks are represented as hidden additional files in the normalfilesystems namespace which is kind of a cludge and makes the semantics forthe a little strange:
- You can’t create, delete or rename resource forks of files or theFinder’s metadata.
- They are however created (with default values), deleted and renamedalong with the corresponding data fork or directory.
- Copying files to a different filesystem will loose those attributesthat are essential for MacOS to work.
Creating HFS filesystems¶
The hfsutils package from Robert Leslie contains a program calledhformat that can be used to create HFS filesystem. See<https://www.mars.org/home/rob/proj/hfs/> for details.
Credits¶
The HFS drivers was written by Paul H. Hargrovea (hargrove@sccm.Stanford.EDU).Roman Zippel (roman@ardistech.com) rewrote large parts of the code and broughtin btree routines derived from Brad Boyer’s hfsplus driver.