http://lists.debian.org/debian-powerpc/2002/debian-powerpc-200204/msg00041.html [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Sharing disk space between MacOS X and Linux * To: debian-powerpc@lists.debian.org * Subject: Sharing disk space between MacOS X and Linux * From: William R Sowerbutts * Date: Wed, 3 Apr 2002 11:27:59 +0100 * User-agent: Mutt/1.3.27i 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 _________________________________________________________________________ William R Sowerbutts will@sowerbutts.com Coder / Guru / Nrrrd http://sowerbutts.com main(){char*s=">#=0> ^#X@#@^7=",c=0,m;for(;c<15;c++)for (m=-1;m<7;putchar(m++/6&c%3/2?10:s[c]-31&1< * Prev by Date: Re: Installing onto a powerbook for the first time * Next by Date: Re: Sharing disk space between MacOS X and Linux * Previous by thread: Some questions about wmaker and other things * Next by thread: Re: Sharing disk space between MacOS X and Linux * Index(es): o Date o Thread http://www.macosxhints.com/article.php?story=20030613121738812 Create HFS+ and FAT32 partitions on one external drive. Tue, Jun 17 '03 at 09:29AM from: Anonymous I've got an external FireWire 160G drive. The original intent was to use it for backups of my TiBook, and for moving files around between Windows, linux and Mac OS X systems. So, the obvious solution would be creating one backup partition with HFS+, and the rest of the space leave for FAT32 as the most common standard. I did some searching on the Internet, but it doesn't look like there is full solution for this problem posted ... so I did my own research and developed this procedure. To make it work, you need only OS X and Windows - no special software involved. The idea is to create partitions on the target Windows system, and then format them on OS X. Standard precaution - you'll work as root in terminal app, so you must be very careful. You can ruin the whole file system with just one wrong command! Read the rest of the hint for the process... Procedure: 1. Create two partitions in Windows (Windows2000 in my case), first for HFS+, second for FAT32. No need to format them. 2. Connect drive to OS X. Befor switching drive on, run this command from terminal: ls /dev/rdisk? You'll get a list of current disks. 3. Switch on the external drive. If OS X pops up with a window about initing new drive, press Ignore. 4. Repeat the ls /dev/rdisk? command. Now you should see one more disk in the list. Remeber its number (i.e. rdisk2, I'll use this one in the examples). 5. Type ls /dev/rdisk2*. You should get rdisk2s1 and rdisk2s2 - first is first partition, second is second partition. 6. Run the following command, but change HFS_VOLUME_NAME to something informative for you: newfs_hfs -v HFS_VOLUME_NAME /dev/rdisk2s1 When it's done, you now have an HFS+ partition. 7. Run this command: newfs_msdos -v FAT_VOLUME_NAME -F 32 /dev/rdisk2s2 Now you have a FAT32 partition. It's not limited to only 32gb -- I have 100gb, and it works at least with OS X 10.2.6. 8. Powercycle the external drive. 9. In my case, OS X picks up the FAT32 partition, but doesn't recognize HFS+ (what an irony). To mount the HFS+ partition (which will show the icon in the Finder), type this command: hdid /dev/disk2s1 Pay attention - this time it's not rdisk2s1, but disk2s1. 10. On Windows, go to the Disk Manager and assign some letter to the FAT32 drive. W2K works fine with partitions over 32gb; it just doesn't want to create them. That's it! [robg adds: I have not tested this one myself! Please heed the caution if you're going to try this one...]