Date: Wed, 3 Apr 2002 11:27:59 +0100 To: debian-powerpc@lists.debian.org Subject: Sharing disk space between MacOS X and Linux Hi, I spent a few hours figuring out how to do this so I thought I'd share the results of my fiddling to save people time in the future. I have an iBook2 on which I primarily run Linux. However, on occasion I reboot into MacOS X -- primarily to watch a DVD or connect to the Internet using the built-in 56K modem. For various reasons it is desirable to have a partition which both operating systems can use (to exchange downloaded files, etc). Originally I planned to have a 1.5Gb HFS+ or HFS partition shared between the two. However, this didn't work out -- the hfsplus tools don't really "mount" the partition into the kernel's VFS tree and the vanilla HFS driver has crashed my kernel several times. So I scrapped this idea and the partition lay fallow for a few months. A few days ago, however, I was away from my Ethernet and wireless networks and urgently needed to download a large postscript file to the Linux partition using the 56K modem, so I went looking for a solution. It occurred to me that both OS X and Linux 2.4 have pretty solid support for FAT32. I could reformat and use my 1.5Gb "shared" partition as FAT32 under Linux quite happily using 'mkdosfs -F 32' and mounting it with the vfat filesystem. Lovely. Indeed, I could mount the same partition under MacOS X from the shell, however I couldn't persuade MacOS to automount it and make it appear on my desktop, because OS X thought it was an HFS partition without a correctly formatted HFS volume due to its type entry in the partition map. Much fiddling later I discovered the solution: Mac OS X will discover and mount the partition correctly as FAT32 if you set the partition type to the magic string "DOS_FAT_32". In mac-fdisk, use the 'd' to delete your partition, then use the 'C' (capital C!) option to create a new one covering exactly the same sectors on the disk, then enter the type as "DOS_FAT_32". I partitioned under Linux and then formatted under OS X using the Disk Tool in Utilities. It works very well indeed for me. Under Linux the fstab entry looks like this: /dev/hda10 /scratch vfat defaults,uid=500,gid=500 0 0 ... and 'mac-fdisk -l' reports: /dev/hda # type name length base ( size ) system dump: name /dev/hda len 8 /dev/hda1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map /dev/hda2 Apple_Driver43 Macintosh 54 @ 64 ( 27.0k) Driver 4.3 /dev/hda3 Apple_Driver43 Macintosh 74 @ 118 ( 37.0k) Driver 4.3 /dev/hda4 Apple_Driver_ATA Macintosh 54 @ 192 ( 27.0k) Unknown /dev/hda5 Apple_Driver_ATA Macintosh 74 @ 246 ( 37.0k) Unknown /dev/hda6 Apple_FWDriver Macintosh 200 @ 320 (100.0k) Unknown /dev/hda7 Apple_Driver_IOKit Macintosh 512 @ 520 (256.0k) Unknown /dev/hda8 Apple_Patches Patch Partition 512 @ 1032 (256.0k) Unknown /dev/hda9 Apple_HFS untitled 5120000 @ 1544 ( 2.4G) HFS /dev/hda10 DOS_FAT_32 Scratch 3072000 @ 5121544 ( 1.5G) Unknown /dev/hda11 Apple_Bootstrap Bootstrap 65536 @ 8193544 ( 32.0M) NewWorld bootblock /dev/hda12 Swap Linux 2097152 @ 8259080 ( 1.0G) Unknown /dev/hda13 Apple_UNIX_SVR2 Linux 28713848 @ 10356232 ( 13.7G) Linux native I'm very pleased with this. The only annoyance is that OS X insists on labelling the disk icon "SCRATCH" and won't allow me to rename it to something that isn't all-caps. Ho hum, can't have everything ;) I'd be interested if anyone has solved this problem by a more elegant route (preferably involving a "real" filesystem...) Will