1 Frequently Asked Questions about the HFS filesystem for 2 Linux 3 Paul H. Hargrove, hargrove@sccm.Stanford.EDU 4 version 1.0.3, 27 Apr 1997 5 6 This document provides answers to some of the most frequently asked 7 questions about the HFS filesystem for Linux. It is currently pretty 8 rough and totally unorganized. Corrections, additions and clarifica- 9 tions are appreciated. The most current version of this document is 10 kept on The HFS for Linux Page <http://www-sccm.Stanford.EDU/~har- 11 grove/HFS/>. 12 ______________________________________________________________________ 13 14 Table of Contents: 15 16 1. What is this FAQ about? 17 18 2. What is HFS? 19 20 3. How I mount AppleShare volumes? 21 22 4. What is the current version of the HFS filesystem. 23 24 5. How stable is the current version? 25 26 6. Is there a mailing list for discussion of the HFS filesystem? 27 28 7. What version of Linux do I need to be running? 29 30 8. Will it run on my (your processor type here)? 31 32 9. Will it run under (your non-Linux operating system here)? 33 34 10. Why can I mount some HFS CDROMs but not others? 35 36 11. What does ``only 1024-char blocks implemented (512)'' mean? 37 38 12. Why do I get a message about a bad or unknown partition table? 39 40 13. Can I mount multiple HFS partitions from the same Macintosh 41 disk? 42 43 14. In what ways can I write to HFS filesystems? 44 45 15. Does the HFS filesystem work with 400 kB or 800 kB Macintosh 46 diskettes? 47 48 16. How can I format an HFS filesystem? 49 50 17. How can I fsck an HFS filesystem? 51 52 18. Why do I get ``error -50'' messages from my Mac when using 53 netatalk? 54 55 19. Why does my Macintosh show generic application and document 56 icons? 57 58 20. How owns all the copyrights and trademarks? ;-) 59 60 20.1. This Document 61 62 20.2. The Software 63 64 20.3. Trademarks 65 ______________________________________________________________________ 66 67 11.. WWhhaatt iiss tthhiiss FFAAQQ aabboouutt?? 68 69 This FAQ is about the HFS filesystem for Linux, which is available in 70 two forms. The stand-alone version (called hfs_fs) is a Linux kernel 71 loadable module implementing the Macintosh HFS filesystem. The HFS 72 filesystem is also included in some distributions of the Linux kernel 73 source (in the directory linux/fs/hfs). This version can be compiled 74 as a loadable module or compiled into the kernel. 75 76 Either version allows a machine running Linux to read and write disks 77 from a Macintosh (almost) as though they were native Linux disks. 78 79 22.. WWhhaatt iiss HHFFSS?? 80 81 HFS stands for ``Hierarchical File System'' and is the filesystem used 82 by the Mac Plus and all later Macintosh models. Earlier Macintosh 83 models used MFS (``Macintosh File System''), which is not supported. 84 85 33.. HHooww II mmoouunntt AApppplleeSShhaarree vvoolluummeess?? 86 87 The HFS filesystem is for mounting local filesystems only. There is 88 an experimental afpfs by Ben Hekster heksterb@acm.org available from 89 http://www.odyssey.co.il/~heksterb/Software/afpfs/. 90 91 44.. WWhhaatt iiss tthhee ccuurrrreenntt vveerrssiioonn ooff tthhee HHFFSS ffiilleessyysstteemm.. 92 93 As of version 1.0.3 of this FAQ, version 0.95 is the most recent. You 94 can always find the most recent version on The HFS for Linux Page 95 <http://www-sccm.Stanford.EDU/~hargrove/HFS/>. Announcements of new 96 versions are made to the comp.os.linux.announce newsgroup. 97 98 55.. HHooww ssttaabbllee iiss tthhee ccuurrrreenntt vveerrssiioonn?? 99 100 Version 0.95 is considered to be ``beta'' software, so I recommend 101 making backups of anything important before you start playing. It is 102 relatively free of bugs due to lots of testing of the previous 103 releases. 104 105 After a suitable period without new bugs the I will consider the 106 software to be ``stable'' and the version number will jump to 1.0. 107 108 66.. IIss tthheerree aa mmaaiilliinngg lliisstt ffoorr ddiissccuussssiioonn ooff tthhee HHFFSS ffiilleessyysstteemm?? 109 110 There is no mailing list devoted exclusively to the HFS filesystem. 111 However, announcements of new versions are posted to the ``linux- 112 atalk'' and ``hfs-interest'' lists. I will see bug reports sent to 113 those lists but e-mail is more reliable (hargrove@sccm.Stanford.EDU). 114 115 To subscribe to hfs-interest send e-mail with a body of ``subscribe 116 hfs-interest (your e-mail address)'' to majordomo@ccs.neu.edu. 117 118 To subscribe to linux-atalk send e-mail with a body of ``SUBSCRIBE 119 LINUX-ATALK (Your full name)'' to listserv@netspace.org. 120 121 77.. WWhhaatt vveerrssiioonn ooff LLiinnuuxx ddoo II nneeeedd ttoo bbee rruunnnniinngg?? 122 123 To compile and use the stand-alone distribution of the HFS filesystem 124 you will need Linux kernel version 2.0.1 or newer compiled with 125 modules enabled (CONFIG_MODULES). To compile you will need the kernel 126 headers which match the kernel you are running. This is covered in 127 more detail in the installation instructions in INSTALL.txt. 128 129 If your kernel came with HFS in the kernel source tree then HFS should 130 work with your Linux version. There may be small problems with a few 131 of the development kernel releases. For these releases check the HFS 132 for Linux Page <http://www-sccm.Stanford.EDU/~hargrove/HFS/> for 133 patches. 134 135 88.. WWiillll iitt rruunn oonn mmyy ((yyoouurr pprroocceessssoorr ttyyppee hheerree))?? 136 137 The code is carefully written to be independent of your processor's 138 word size and byte-order, so if your machine runs Linux it can run the 139 HFS filesystem. However some younger ports don't yet have support for 140 loadable modules. 141 142 Note that HFS is tested most extensively on Intel platforms. So there 143 could be subtle compilation problems on other platforms. If you 144 encounter any that are not addressed by the documentation then please 145 let me know. 146 147 99.. WWiillll iitt rruunn uunnddeerr ((yyoouurr nnoonn--LLiinnuuxx ooppeerraattiinngg ssyysstteemm hheerree))?? 148 149 No. There is a port in progress to NetBSD. I know of no other active 150 porting attempts. If you are interested in porting the HFS filesystem 151 to another Unix-like operating system, I am interested in providing 152 what guidance I can. 153 154 1100.. WWhhyy ccaann II mmoouunntt ssoommee HHFFSS CCDDRROOMMss bbuutt nnoott ootthheerrss?? 155 156 In the past there was a known incompatibility with some ``hybrid'' 157 CDROMs that appear as HFS disks on Macs and as ISO9660 disks on other 158 systems. I think I have fixed the problem. So, if you encounter this 159 particular problem or have problems with specific non-hybrid CDROMs 160 please e-mail me with the title and manufacturer of the CD. 161 162 1111.. WWhhaatt ddooeess ````oonnllyy 11002244--cchhaarr bblloocckkss iimmpplleemmeenntteedd ((551122))'''' mmeeaann?? 163 164 This message comes from the kernel and indicates that an attempt was 165 made to read a 512-byte block from a device that doesn't support 166 512-byte blocks. The HFS filesystem only works with 512-byte blocks, 167 and therefore doesn't function with these devices. Eventually it may 168 be able to use 1024-byte (or even 2048-byte) blocks when necessary. 169 Ideally the device driver should be enhanced to support 512-byte 170 blocks so that the various filesystems which need 512-byte blocks 171 don't each need to work around it. 172 173 1122.. WWhhyy ddoo II ggeett aa mmeessssaaggee aabboouutt aa bbaadd oorr uunnkknnoowwnn ppaarrttiittiioonn ttaabbllee?? 174 175 If your Linux kernel doesn't understand Macintosh partition tables it 176 gives this warning when it can't find a partition table it recognizes. 177 To support partitioned media with such kernels, decoding of Mac 178 partition tables is done by the HFS filesystem so you should still be 179 able to mount the disk. However, to do so you will need to mount the 180 raw device (such as /dev/sdb instead of /dev/sdb4) and use the part 181 mount option to indicate which partition you want. 182 183 1133.. CCaann II mmoouunntt mmuullttiippllee HHFFSS ppaarrttiittiioonnss ffrroomm tthhee ssaammee MMaacciinnttoosshh ddiisskk?? 184 185 Only if your kernel understands Macintosh partition tables. It the 186 kernel doesn't understand the Macintosh partition table, the HFS 187 filesystem must access the raw device. Therefore, the kernel thinks 188 the entire drive is in use and prevents additional mounts on it. 189 190 1144.. IInn wwhhaatt wwaayyss ccaann II wwrriittee ttoo HHFFSS ffiilleessyysstteemmss?? 191 192 The HFS filesystem is as capable as the MS-DOS or VFAT filesystems, 193 except that certain things can only be done with a file's data fork. 194 195 You ccaann: 196 197 +o Create, delete and rename directories and data forks of files with 198 the caveat that names are case insensitive (so foo and Foo are the 199 same file or directory). 200 201 +o Run Linux executables or shared libraries on an HFS disk if they 202 are stored in the data fork of a file. 203 204 +o Read, write and truncate both forks of files and the Finder's 205 metadata of files and directories. 206 207 +o Mmap data forks of files (and the resource fork if the filesystem 208 is mounted with the fork=cap option). 209 210 +o Toggle the 'w' permission bits (as a group) of data forks. 211 212 +o Change the i_mtime of files and directories. 213 214 You ccaannnnoott: 215 216 +o Create, delete or rename resource forks of files or the Finder's 217 metadata. Note, however, that they are created (with defaults 218 values), deleted and renamed along with the corresponding data fork 219 or directory. 220 221 +o Run Linux executables or shared libraries on an HFS disk if they 222 are stored in the resource fork of a file. 223 224 +o Mmap the Finder's metadata (when fork=cap) or AppleDouble header 225 files (when fork=double or fork=netatalk). 226 227 +o Change permissions on directories. 228 229 +o Change the uid or gid of files or directories. 230 231 +o Set the set-uid, set-gid or sticky permission bits. 232 233 +o Create multiple links to files. 234 235 +o Create symlinks, device files, sockets or FIFOs. 236 237 1155.. DDooeess tthhee HHFFSS ffiilleessyysstteemm wwoorrkk wwiitthh 440000kk oorr 880000kk MMaacciinnttoosshh 238 ddiisskkeetttteess?? 239 240 Yes and no. The software is fully capable of dealing with HFS disks 241 of any size. However, the 400k and 800k diskettes are written in a 242 physical format that is incompatible with most non-Macintosh floppy 243 drives. Note also that almost all 400k Macintosh diskettes are MFS, 244 not HFS. 245 246 1166.. HHooww ccaann II ffoorrmmaatt aann HHFFSS ffiilleessyysstteemm?? 247 248 Robert Leslie (rob@mars.org) has written a package for working with 249 HFS filesystems (like mtools plus a graphical interface). One program 250 in the package is hformat which can format HFS filesystems. The 251 latest version can be found on the HFS Utilities home page 252 <http://www.mars.org/home/rob/proj/hfs/>. 253 254 1177.. HHooww ccaann II ffsscckk aann HHFFSS ffiilleessyysstteemm?? 255 256 Right now you'll have to use a Macintosh to do this. However, Rob 257 Leslie is working on an fsck for HFS filesystems. 258 259 1188.. WWhhyy ddoo II ggeett ````eerrrroorr --5500'''' mmeessssaaggeess ffrroomm mmyy MMaacc wwhheenn uussiinngg 260 nneettaattaallkk?? 261 262 To be compatible with netatalk's afpd you will need to use netatalk 263 version 1.4b1 or newer and mount the HFS filesystem with the ``afpd'' 264 mount option. More information is provided in the ``afpd'' subsection 265 of the ``Mount Options'' section of the HFS documentation (HFS.txt if 266 you have the stand-alone HFS distribution or 267 linux/Documentation/filesystems/hfs.txt if HFS is in your kernel 268 source tree.) 269 270 1199.. WWhhyy ddooeess mmyy MMaacciinnttoosshh sshhooww ggeenneerriicc aapppplliiccaattiioonn aanndd ddooccuummeenntt 271 iiccoonnss?? 272 273 When using the ``afpd'' mount option the Desktop database on the disk 274 is not made available to Netatalk's afpd. Because of this mounting an 275 HFS filesystem across the network to a Macintosh may result in the 276 Finder showing generic application and document icons. Additionally 277 double clicking on a document will fail to start the correct 278 application. 279 280 If the disk is writable you can make Netatalk build a new Desktop 281 database in its own format by holding down the Option key while 282 selecting the volume in the Chooser. If the disk is not writable then 283 these problems can be worked around by copying the application to a 284 local disk on the Macintosh. 285 286 2200.. HHooww oowwnnss aallll tthhee ccooppyyrriigghhttss aanndd ttrraaddeemmaarrkkss?? ;;--)) 287 288 2200..11.. TThhiiss DDooccuummeenntt 289 290 This document is Copyright (c) 1996, 1997 by Paul H. Hargrove. 291 292 Permission is granted to make and distribute verbatim copies of this 293 document provided the copyright notice and this permission notice are 294 preserved on all copies. 295 296 Permission is granted to copy and distribute modified versions of this 297 document under the conditions for verbatim copies above, provided a 298 notice clearly stating that the document is a modified version is also 299 included in the modified document. 300 301 Permission is granted to copy and distribute translations of this 302 document into another language, under the conditions specified above 303 for modified versions. 304 305 Permission is granted to convert this document into another media 306 under the conditions specified above for modified versions provided 307 the requirement to acknowledge the source document is fulfilled by 308 inclusion of an obvious reference to the source document in the new 309 media. Where there is any doubt as to what defines ``obvious'' the 310 copyright owner reserves the right to decide. 311 312 2200..22.. TThhee SSooffttwwaarree 313 314 The HFS filesystem software is Copyright (c) 1994-1997 by Paul H. 315 Hargrove. 316 317 The software is free software; you can redistribute it and/or modify 318 it under the terms of the GNU General Public License as published by 319 the Free Software Foundation; either version 2, or (at your option) 320 any later version. 321 322 The software is distributed in the hope that it will be useful, but 323 WITHOUT ANY WARRANTY; without even the implied warranty of 324 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 325 General Public License for more details. 326 327 You should have received a copy of the GNU General Public License 328 along with the software in the file ``COPYING''; if not, write to the 329 Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 330 USA. 331 332 2200..33.. TTrraaddeemmaarrkkss 333 334 +o ``Finder'' is a trademark of Apple Computer, Inc. 335 336 +o ``Apple'', ``AppleShare'', and ``Macintosh'' are registered 337 trademarks of Apple Computer, Inc. 338 339 +o ``MS-DOS'' is a registered trademarks of Microsoft Corporation. 340 341 +o All other trademarks are the property of their respective owners. 342 343