Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create HFS+ and FAT32 partitions on one external drive. System
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...]
    •    
  • Currently 3.39 / 5
  You rated: 5 / 5 (18 votes cast)
 
[353,699 views]  

Create HFS+ and FAT32 partitions on one external drive. | 67 comments | Create New Account
Click here to return to the 'Create HFS+ and FAT32 partitions on one external drive.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create HFS+ and FAT32 partitions on one external drive.
Authored by: momerath on Jun 17, '03 11:34:29AM
Well, even when you're not logged in as root you can ruin everything with one small command:sudo rm -Rf / :-)

[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: sjk on Dec 08, '05 03:22:27PM

There's potential even for non-admin users to do damage running that command (without sudo) because of, for example, loose permissions on third-party software installed under /Applications and /Library that Repair Disk Permissions doesn't fix.



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: georgegraphics on Jun 17, '03 12:33:15PM

You can also create the partition on the mac, using pdisk.

Make sure all the volumes on the drive are unmounted. Then run

sudo pdisk

Type

e /dev/rdisk<num>

type 'p' to list the partitions on the disk

work out which one you want to edit and type 'C <partition num>

It'll ask your for some data - the size (use the size listed by 'p') and a type, use "Windows_FAT_32" or 16 or 12 for the FAT type you want. Then run the mkfs_msdos command in the hint. Saves the drive swap.



[ Reply to This | # ]
Create DOS partitions on a Mac
Authored by: greed on Jun 17, '03 01:42:48PM
pdisk creates an Apple partition table. Linux can read that, but Windows (out of the box) cannot. Instead use fdisk, which creates a DOS partition table. Use with caution, though, as it looks like it only supports primary partitions, not extended/logical partitions. If you only want 2 partitions, that shouldn't be a problem, of course.

[ Reply to This | # ]
Mounting from the commandline
Authored by: greed on Jun 17, '03 01:39:01PM

If you think there should be a better solution to mounting the partitions without powering off the driver (or detaching the FireWire):

diskutil mount /dev/disk2s1
diskutil mount /dev/disk2s2

It looks like

diskutil mountDisk /dev/disk2
should also work, but I have had mixed results with that one.

[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: pbw on Jun 17, '03 03:08:19PM

Using this method, would the HFS+ partition be bootable for OSX? For example, could I use Carbon Copy Cloner to clone an OSX boot disk to the HFS+ partition and be able to boot from it? Since it appears you have to type "hdid /dev/disk2s1" via Terminal whenever you want to mount the partition, I would assume you could NOT boot from it (but if you could, you would be my hero).

I've been looking for a way to boot OSX from one Firewire partition while having a Windows partition available for my work PC (without needing MacDrive or MacOpener). Any ideas?



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: atverd on Jun 18, '03 01:52:38AM

Can't help with that, sorry. The problem is in Open Firmware, it doesn't recognize MBR-kind (aka fdisk aka msdos aka windows type) partitions, so doesn't want to load BootX from it, even if file system there is HFS+. yaboot might be able to load OS X from such partition, but I don't know how to make it work this way. I'll try to figure out, though.

So far I had created bootable CD with BootCD tool and keep it with me all the time, so in case of troubles I could boot from it and restore system from backup.



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: peertimo on Jun 18, '03 08:13:38AM

What is wrong with formatting the entire drive as FAT32? It will mount under OSX and Windows. No need for two partitions at all.



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: hotchili on Jun 18, '03 01:28:08PM

You can't boot from a Fat32 partition, for one thing (though it seems to be problematic booting using this methond as well).



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: tcurtin on Jul 15, '03 01:25:32AM

At least one other problem with making the whole drive FAT is that psync loses its mind with any files containing : or ? or & or the \r in Icon files... to name a few. So if you're looking to use the drive for backups, it won't work. Works great on an HFS+ partition though...



[ Reply to This | # ]
FAT32 has a 4gb file size limit
Authored by: tcurtin on Sep 03, '03 01:37:04AM

One other problem I just discovered - FAT32 has a file size limit of 4gb.

I thought I'd try formatting the whole drive to FAT32 then creating an HFS+ disk image large enough to back up my ibook onto... but as soon as the image gets bigger than 4gb disk copy dies.

---
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: tcurtin on Sep 02, '03 08:00:52AM
I've done a bit more work trying to get this working correctly. I had thought I could create one large DOS partition, and then make a large HFS+ disk image in it to save my Mac files. No dice though, since it appears there is a 5gb filesize limit on the msdos drive. (I get "operation unsupported" errors in disk copy whenever I try to make an image that's larger.)

I'd love any help anyone can provide with that piece.

Also, there's a PC program called freefdisk you can get at http://www.23cc.com/free-fdisk/ which has no partition size limit. So, you can create both partitions, and specify the filesystem for the pc one, on the PC.

Last, but not least, I'm not sure hdid is the best command to use to get your drive identitified. Every time I've used it, it created another /dev/rdisk? file. (Shouldn't it use the /dev/rdisk?s? file that's already there?) And, when I go to eject the firewire drive, it says disk "" can't be ejected because its in use. (I assume its referring to the /dev/rdisk1s5 file that was ignored when hdid created the /dev/rdisk2.) The manpage for hdid says its intended for disk images, not actual disks.

Here's what I get with sudo autodiskmount -adv. (Spits out quite a bit of info about how its trying to mount disks.)

For my main HFS partition (notice it calls hfs.util):

********We have a match for devname = disk0s9!!!**********
foreignProbe('hfs', 'disk0s9', removable=0, writable=1):
'/System/Library/Filesystems/hfs.fs/Contents/Resources/../../hfs.util -p disk0s9 fixed writable'
do_exec(/System/Library/Filesystems/hfs.fs/Contents/Resources/../../hfs.util -p disk0s9 fixed writable)
wait4(pid=11401,&statusp,0,NULL)...
wait4(pid=11401,&statusp,0,NULL) => 11401
foreignProbe(...) => -9
foreignUUID('hfs', 'disk0s9'):
'/System/Library/Filesystems/hfs.fs/Contents/Resources/../../hfs.util -k disk0s9'
do_exec(/System/Library/Filesystems/hfs.fs/Contents/Resources/../../hfs.util -k disk0s9)
wait4(pid=11402,&statusp,0,NULL)...
wait4(pid=11402,&statusp,0,NULL) => 11402
foreignUUID(...) => -4

For my firewire msdos partition (notice msdos.util):
********We have a match for devname = disk1s1!!!**********
foreignProbe('msdos', 'disk1s1', removable=0, writable=1):
'/System/Library/Filesystems/msdos.fs/Contents/Resources/../../msdos.util -p disk1s1 fixed writable'
do_exec(/System/Library/Filesystems/msdos.fs/Contents/Resources/../../msdos.util -p disk1s1 fixed writable)
wait4(pid=11403,&statusp,0,NULL)...
wait4(pid=11403,&statusp,0,NULL) => 11403
foreignProbe(...) => -1
foreignUUID('msdos', 'disk1s1'):
'/System/Library/Filesystems/msdos.fs/Contents/Resources/../../msdos.util -k disk1s1'
do_exec(/System/Library/Filesystems/msdos.fs/Contents/Resources/../../msdos.util -k disk1s1)
wait4(pid=11404,&statusp,0,NULL)...
wait4(pid=11404,&statusp,0,NULL) => 11404
foreignUUID(...) => -6

Now for my firewire hfs partition (notice it tries, and fails, to use msdos.util!):
********We have a match for devname = disk1s5!!!**********
foreignProbe('msdos', 'disk1s5', removable=0, writable=1):
'/System/Library/Filesystems/msdos.fs/Contents/Resources/../../msdos.util -p disk1s5 fixed writable'
do_exec(/System/Library/Filesystems/msdos.fs/Contents/Resources/../../msdos.util -p disk1s5 fixed writable)
wait4(pid=11405,&statusp,0,NULL)...
wait4(pid=11405,&statusp,0,NULL) => 11405
foreignProbe(...) => -2
Volume is bad
LookupWholeDiskForThisPartition('disk1s5') => 'disk1'

So, the command sudo /System/Library/Filesystems/hfs.fs/Contents/Resources/../../hfs.util -m disk1s5 /Volumes/ibookbak fixed writable nosuid dev actually does what you'd expect and lets you access the drive using /Volumes/ibookbak. But, doesn't show on desktop... (And doesn't unmount very cleanly, either.)

I don't really know what I'm doing here, I'm just muddling my way through. It seems like we need to get autodiskmount to know that the second partition should get hfs.util treatment, but I have no idea how to tell it so. Any help? I'll keep working...

---
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin

[ Reply to This | # ]

Create automatically working HFS+ and FAT32 partitions on the same external drive
Authored by: birdz on Sep 03, '03 11:55:16AM

there is a way to get both partitions working with mac os x, so you do not have to mount it manually - everything shows up automatically at connect

the solution is to use pdisk, a earlier suggested in a comment. caution: pdisk will not "create" partitions but only write the partition table. it will tell the system where to look for the partition, but will not create an empty partition at the desired place. the partition is created afterwards by the command newfs.

  1. if you do not care for compatibility with os9 then follow step 1 to 5 in the initial guide. if you do care: partition the drive in os x disktool as one big drive. check the box for mac os 9 driver.
    instead of using newfs now, you have to alter the partition table. (% represents the terminal.)
  2. unmount the drive (if mounted) in the finder or disktool with cmd-e or in the terminal with
    % disktool -e disk2 (whereas rdisk2 stands for your external drive, see initial guide)
  3. write the new partitions into the table:
    % sudo pdisk
    this starts a program that prompts for input.
  4. enter L if you wish to display your drives and partitions. your drive looks now something like
    /dev/rdisk2  map block size=512
       #:                 type name                 length   base     ( size )
       1:  Apple_partition_map Apple                    63 @ 1       
       2:       Apple_Driver43*Macintosh                56 @ 64      
       3:       Apple_Driver43*Macintosh                56 @ 120     
       4:     Apple_Driver_ATA*Macintosh                56 @ 176     
       5:     Apple_Driver_ATA*Macintosh                56 @ 232     
       6:       Apple_FWDriver Macintosh               512 @ 288     
       7:   Apple_Driver_IOKit Macintosh               512 @ 800     
       8:        Apple_Patches Patch Partition         512 @ 1312    
       9:            Apple_HFS temp               39068248 @ 1824     ( 18.6G)
      10:           Apple_Free                           0+@ 39070072
    
    Device block size=512, Number of Blocks=39070080
    DeviceType=0x0, DeviceId=0x0
    Drivers-
    1: @ 64 for 23, type=0x1
    2: @ 120 for 36, type=0xffff
    3: @ 176 for 21, type=0x701
    4: @ 232 for 34, type=0xf8ff
    
    enter e /dev/rdisk2 to edit the partition table. you get another prompt.
  5. now delete the hfs partition d 9. if it says not writeable, eject the drive (see 2).
  6. "create" a new hfs-partition. (note: this does only change in the partition table, it doesn't create the partition itself.)
    type C (capitatlized). then it will prompt for the first block, you can see that in the table above. after that the size in blocks: the best way is to take the calculator and enter the blocks from the previous hfs partition times the percentage you want it (39068248 * 0.95 = 37114843.2). then give the partition a name (in my case external) and enter the format in the way shown.
    Command (? for help): C  
    First block: 1824
    Length in blocks: 37114843    
    Name of partition: external
    Type of partition: Apple_HFS
    
  7. check the partition created with p :
       #:                 type name                 length   base     ( size )
       9:            Apple_HFS extern             37114843 @ 1824     ( 17.7G)
      10:           Apple_Free Extra               1953413 @ 37116667 (953.8M)
    
  8. create another partition named "win" with C 37116667 1953413 win Windows_FAT_32.
  9. enter w to write the table, and confirm. exit pdisk with q .
  10. now back with the terminal prompt create the partitions with newfs:
    % newfs_hfs -v external /dev/rdisk2s9
    % newfs_msdos -v win /dev/rdisk2s10
    
    note: the number of the partiotion in pdisk an the device name correspond. if it says Permission denied, you are accessing the wrong partition or the drive is mounted.
  11. now detach, reconnect & enjoy...


[ Reply to This | # ]
Create automatically working HFS+ and FAT32 partitions on the same external drive
Authored by: birdz on Sep 03, '03 01:07:41PM

oops. i just noticed that with apple, everything works fine. but when being connected to a windows machine, the fat32 partition won't show up. i guess you can either achieve compatibilty with os 9 or with windows, but with both is not possible.

so: do not format your hard drive with os x, or else you will loose the structure needed for windows machines.

i'll be back if i know more.



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive
Authored by: birdz on Sep 03, '03 04:00:16PM
sorry guys, my idea is not working. the process described above does not contain any errors, but it does not provide you with a fat32 partition that windows will recognize.

obviously the way to store partitions is completely different in os x than in windows - or rather different in windows from all other systems.

what seems interesting to me: i reformatted my hard disk (after i finished my process) with dos / fdisk. i even formatted the partitions. and the astonishing thing is that in os x with pdisk still displays the partition map i had constructed before. so os x stores the partition map differently and even in a different place.

[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive
Authored by: Pierre Duhem on Oct 23, '03 03:46:03AM

The partition table used by Apple is not the same as the one used under Windows and all Unix flavors.

Iomega and others have tried to build "mixed" partition tables (in particular for their "Tools" Zips). Having a look at what is on the disk gives a perfect idea of the quality of the software they sell.

Having a HFS/HFS+ partition and a FAT32 partition on the same disk relies necessarily on some hacks or on some holes offered by some utilities. I would not store _my_ files on such a disk.

Pierre Duhem



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: moritzh on Jan 12, '04 07:43:01PM
I'll share what I've found out because I think it gives you the best possible solution for the problem. Possible that some of you know about this already but from my point of view, my method has not explicitly been described before and I feel it is a good summary of various details spread over many previous posts.

Simply use

diskutil
to partition your extrnal FW drive! No need for a Windoze machine to set this up. Check out the man page for diskutil, it describes pretty well what you need to know and even gives an example which is almost exactly what you want.

The command line tool diskutil pretty much does what the well-known Disk Utility application does (duh...), except it also allows you to mix Apple (HFS+, ...) partitions with MS-DOS partitions on the same drive (you cannot do this with the Disk Utility).

Basically what you want is sth like this:

diskutil partitionDisk device numberOfPartitions MBRFormat <part1Format part1Name part1Size> <part2Format part2Name part2Size>

Replace

<part1Format part1Name part1Size>
with the appropriate details for your HFS+ partition and
<part1Format part1Name part1Size>
with the appropriate details for the MS-DOS partion (or vice versa). Keep in mind that the name for the DOS partition should be uppercase and less than 12 chars, otherwise the partition will not be assigned a name (but be created anyway).

When thinking about the size: You can use abbreviations like

10G
for 10 GByte (see man page). And you don't have to take out a calculator to determine how much space is left for your second partition (given the size of the first one): Simply use the desired size for the first partition and then give a number which exceeds the amount of space left for the second one - then automatically every little byte left will be used for the second partition.

As for the device: Use the procedure described in the original post to find out which device to use (to find out the disk #). Then use sth. like

/dev/disk2
Check out the man page for details.

Although you cannot repartition your boot up disk anyway, I think, be careful here and eject any other disks (such as iPods etc.) before using this command, just in case... As you know, there will be no confirmation question after entering the command and all data on the whole disk (all volumes) will be lost, so make sure you find out the appropriate disk # before typing in anything for fun.

Using the parameter

MBRFormat
specifies that the partition table be written in such a way that Windoze machines can read it.

And here is what you get using the procedure described above:

A partition which will be recognizable on Windoze machines AND Mac machines without problems and a HFS+ partition which will be recognized automatically on the Mac without any problems (no need to manually mount the volume after logging in as described in the original post, the volume will automatically be mounted upon log in and can be unmounted just like any other external volume in the Finder).

HOWEVER, YOU CANNOT BOOT UP YOUR MAC FROM THE HFS+ PARTITION.

As has been said before in previous posts: The way partition tables are stored on Win and Mac systems differs. (At the moment) you cannot have HFS+ and FAT32 (Windows) partitions on the same drive and boot up into the appropriate partition on BOTH systems. See also Pierre Duhem's concerns expressed in a previous post above on this. So if you are REALLY concerned about your data you might want to not use the procedure described and instead stick with ONLY HFS+ or ONLY FAT32. However, I have not experienced any problems with the setup described above (apart from the fact that I cannot boot off the partition which is not so relevant for me anyway and which I don't consider a problem now that i know about it). But can't guarantee total functionality, of course. [Insert "Batteries not included, only valid where not prohibited" and your other favorite legal warnings here.]

As I said, the Finder can perfectly handle the HFS+ volume created in the above manner. It's the Mac's open firmware that does not allow booting with the created HFS+ partition (because it does not like the partition table in MBRFormat). It took me quite a few tries to find out the details on this. For instance, I created a separate HFS+ partition onto which I cloned my whole internal boot up hard drive (via Carbon Copy Cloner). In System Preferences under Startup Disk you can then also select the cloned system for the next start up, BUT IT WILL NOT WORK. Apparrently, the open firmware does not like it (the external FW drive is not detectable at start up (press the [option] key when switching your Mac on to select the start up drive and the FW drive won't show up) but System Preferences does not know this and would let you choose the FW drive for start up although it will not work. On the other hand, by not using the parameter MBRFormat, which you might think would be worth a try, you would end up with a FAT32 (MS-DOS) partition which can be handled perfectly on your Mac but won't be recognized by Windoze which makes the whole thing pretty much pointless.

So Win machines can only handle MBRFormat type partition tables. So whichever way you turn it: Both Mac and Win systems don't really like each other's partition tables (or mixtures thereof) - however, the Mac is a bit more flexible here, as usual. :-) So decide for yourself if the pros or cons of this method overweigh. (I decided to go for it.)

BTW: Am using Mac OS X (10.3.2), if this is of any relevance.

[ Reply to This | # ]

Create HFS+ and FAT32 partitions on one external drive - use diskutil
Authored by: FyKnight on Jan 20, '04 08:31:49PM

That diskutil method rocks! I tried it last night and it worked a charm - first time.

The best bit is it does all the legwork for you, you don't have to fiddle around with mounting and unmounting drives, counting cylinders, allocating partitions or anything like that.

I have now successfully partitioned a 200G firewire drive into HFS+ and FAT32. And the FAT32 partition even mounts fine in linux. Thanks for the hint!

{P^/

btw The man page for diskutil is worth a read too.



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive - use diskutil
Authored by: grantjs on Jan 23, '04 05:22:55PM

Trying to create 3 partitions, I hit a small snag (probably user error)... at first I performed and received the following message:

[diskutil partitionDisk /dev/rdisk4 3 UFS Unix 50G MS-DOS MS-DOS 50G HFS+ MacOS 180G
Could not find disk for /dev/rdisk4.]

So referring to the man pages tried:
[diskutil partitionDisk disk4 3 UFS Unix 50G MS-DOS MS-DOS 50G HFS+ MacOS 180G]

And then no problem, getting back:

[Finished partitioning on disk disk4
/dev/disk4
#: type name size identifier
0: Apple_partition_scheme *232.9 GB disk4
1: Apple_partition_map 31.5 KB disk4s1
2: Apple_Boot 8.5 MB disk4s2
3: Apple_UFS Unix 48.4 GB disk4s3
4: DOS_FAT_32 MS-DOS 50.0 GB disk4s4
5: Apple_HFS MacOS 132.8 GB disk4s6]

Great tip!



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive - use diskutil
Authored by: muze7 on Feb 07, '04 01:33:41PM

Hi,

I am new here but tried something similar and failed.

diskutil partitionDisk disk1 2 MBRFormat HFS+ TEST 30G MS-DOS TEST2 10G

I need the MBRFormat to make the second partition readable under Windows but get the error:

There are too many arguments for the number of partitions specified.

I do not see why though, as I specified two partitions and two series of parameters.
If I get rid of the MBRFormat it works, but I need it!

Any ideas?

Thanks heaps
Bridget



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive - use diskutil
Authored by: moritzh on Mar 05, '04 06:10:06PM
Well, it wouldn't help you now anyway (since you got it working already), but I think your mistake was that you typed
/dev/rdisk4
instead of
/dev/disk4
Small and subtle difference that was pointed out in the original post...

[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive - use diskutil
Authored by: hellomilano on Sep 28, '05 02:20:30PM

Bravo!...worked seamlessly on OSX 10.4 and Windows XP and I have never touched UNIX before. Only addition to above line of code was 'MBRFormat' as noted in original posting. Both booted up without effort on Mac & Win.
Grazie!



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive - use diskutil
Authored by: osxpounder on Sep 29, '05 12:42:46PM

Not working for me. I followed silentaccord's instructions, and everything stops at step 5: "5) Now use fdisk to create the master boot record (MBR) so Windows will recognize the FAT32 partition:
fdisk -e /dev/disk4" [disk4 is the disk I'm working with]

On my machine, fdisk tells me "/dev/disk4 is not a character device or a regular file" and pdisk tells me "can't open file 'disk4' (No such file or directory)". I have fdisk(8), and I'm running OSX 10.3.9.

Can't understand why Disk Utility can tell me that, yes, disk4 is mounted, but it can mount/unmount it, but fdisk swears there's no such disk4. I can use diskutil to mountDisk, too. What do think's wrong? Did I miss something?

---
--
osxpounder



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive - use diskutil
Authored by: osxpounder on Sep 29, '05 02:13:54PM

I worked past my fdisk error: turns out I must specify the disk name differently. Although 'disk4' is what Disk Utility identifies as this disk, I had to use 'fdisk -e /dev/rdisk4' ....

So I managed to use fdisk to make the partitions, one HFS+ and one FAT32, then attached the external drive to a WinXp box. It recognized an unformatted volume, and let me format it [in this case, to 64GB].

Now, on the Mac, the FAT32 volume won't mount. Disk Utility calls it 'disk5s5', even in the graphic interface's left pane. I tried ejecting the disk and remounting. Nope. Tried just ejecting the Mac volume, which mounts every time I attach the disk, but 'disk5s5' still won't mount. Tried ejecting just the Mac volume. Tried using the buttons in DU to mount the disk5s5 volume. Nope and nope.

So I tried using the CLI and diskutil. diskutil reports that disk5s5 is mounted, but ... it doesn't show up in Finder.

If I click "Verify Disk" in DU's GUI with disk5s5 selected [greyed, not mounted, even though diskutil says it's mounted], I get:
Verifying volume "disk5s5"
BAD SUPER BLOCK: MAGIC NUMBER WRONG
** /dev/rdisk5s5 (NO WRITE)

LOOK FOR ALTERNATE SUPERBLOCKS? no


1 volume checked
1 non HFS volume checked

Now I'm really stuck, but I'm going to keep plugging at this.



---
--
osxpounder



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: muze7 on Feb 08, '04 03:23:47AM

Yes, I think the OS is relevant.

I have tried this in OS X 10.2.8 but it seems the kernel does not recognize the MBRFormat command.

From the diskutil man page it is not clear to me when this command was introduced, however

...in case I am doing something wrong, my tried commands in terminal are:

diskutil partitionDisk disk1 2 MBRFormat Hfs+ Test 10G MS-DOS TESTWIN 30G

If I get rid of the MBRFormat it works fine. I also tried to add ' OS9Drivers MBRFormat' rather than MBRFormat by itself but that fails also.

Error is: There are not enough parameters for the amount of partitions you specified
(something to that effect)



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: moritzh on Mar 05, '04 06:36:01PM
You are right, the OS version probably matters indeed. In fact, it appears quite obvious to me now that diskutil must have changed considerably from any previous version to that in 10.3.X because in 10.3.X it now also handles the sparse image files that FileVault uses (whcih is a major enhancement). (The man page for diskutil in 10.3.2 gives 24 Jan 2004 as the date.)

I don't have a machine with anything before 10.3.2 on it to test, but my guess is that full support for

MBRFormat
has indeed been included only in the 10.3 version.

As laid out in previous posts, implementing sth that handles MBRFormat correctly must be quite difficult which could be a reason that it was fully implemented only in 10.3.

BTW, when considering switching to 10.3, make sure you update to the most recent version because the changes made to the FileVault features after the initial release of 10.3 most likey also affected diskutil.

[ Reply to This | # ]

Create HFS+ and FAT32 partitions on one external drive.
Authored by: lyrrad on May 02, '04 02:19:37PM

I initially tried using anonymous' hint, that worked fine, except for the auto-mounting issue. so I searched and found this hint. everything worked, however the initial partition with the FAT32 created some garbage files that took up a good 10G. Puzzled where the files came from. However I quick format on the PC fixed the problem.

Am on 10.3.2



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: Thorir Jonsson on Mar 07, '05 03:07:21AM

I used this to partition an external USB/Firewire 160Gb disk, creating 109Gb HFS+ and MS-DOS 40 Gb partitions:

diskutil partitionDisk device numberOfPartitions MBRFormat <part1Format part1Name part1Size> <part2Format part2Name part2Size>

and there are no problems with either partition, unless machines running MacOS 9.x do not see the HFS+ partition; they only recognise the DOS partition.

---
Thorir J



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: simoncha on Apr 07, '05 06:33:33AM

There is a way to have Dos (FAT32) and Mac (HFS+) partitions on the same BOOTABLE firewire disk.

Warning : Its a hack,but I managed to do that on a Keyplug 80Go Firewire/USB hard disk and it work smoothly : I'm able to boot on it from an iBook G4, and the dos partition is usable on every PC i tried.

The idea is simple. Mac and Dos partition tables use the same area of the disk : the 1st block for DOS, several blocks starting from the 1st for MAC. But they dont use the same bytes on the 1st sector . For more details there is a clear a complete book : "File System Forensic Analysis" from Brian Carrier (see this chapter http://www.aw-bc.com/samplechapter/0321268172.pdf)

So you can make an hybrid 1st sector that Mac recognize as an apple partition table (and YES can boot on any bootable HFS partition) and PC recognize as a DOS partition table.

To do it under MacOs 10.3 :
1) find the device associed with your disk (see above) for me it was /dev/disk1 and unmount it

2) make an apple partition table and format each partition with diskutil :
diskutil partitionDisk disk1 3 \
MS-DOS LaPoche 37276936704B \
MS-DOS Pingouin 12337920000B \
HFS+ SECOURS 30408860160B
this make 2 dos partitions and 1 apple partition. (adapt it to your need, you dont have to express size in bytes, you can use number as 30G as said above)

3) unmount all partitions
4) look at the apple partition table :
diskutil list /dev/disk1

for the example in 2), we get :

/dev/rdisk1 map block size=512
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: DOS_FAT_32 DOS_FAT_32_Untitled_2 72806520 @ 64 ( 34.7G)
3: DOS_FAT_32 DOS_FAT_32_Untitled_3 24097504 @ 72806584 ( 11.5G)
4: Apple_Free 0+@ 96904088
5: Apple_HFS Apple_HFS_Untitled_4 59135240 @ 97166232 ( 28.2G)
6: Apple_Free 0+@ 156301472

Device block size=512, Number of Blocks=156301488
DeviceType=0x0, DeviceId=0x0


5) save the partition table (the first blocks) on a regular file (let's call it apple.dd) :
dd if=/dev/rdisk1 of=apple.dd bs=512 count=63

6) create a dos a partition table with fdisk :
fdisk -e
then we can recreate the partitions in a dos table, use EXACTLY the same value in blocks as given in 4)

7) unmount everything again

8) save the dos partition in a regular file :
dd if=/dev/rdisk1 of=dos.dd bs=512 count=1

9) make a mix of the two first blocks in a file call fusion.dd :
cp dos.dd fusion.dd
dd if=apple.dd of=fusion.dd bs=1 count=446

The 446 first bytes of the 1st block is a boot sequence for dos machine, the partition table itself is in the end of the block.

10) write on disk the hacked partition :

dd if=fusion.dd of=/dev/rdisk1 bs=512 count=1 conv=notrunc


11) That's all : you can now wander the world with a disk you can plug in almost every machine (windows, linux, mac) and you can even boot on Mac on any bootable partition !!!

I recommand Carbon Copy Cloner to copy your internal hard disk on such a partition.

Now your turn to help : If someone know hot to force diskutil to use cylinder boundary or make this firewire disk also bootable on PC, please post here or write to macos.x.simoncha@spamgourmet.com



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: silentaccord on Apr 11, '05 07:19:05AM

I tried your procedure and had a few problems.

In step 2), the output I get from "diskutil list /dev/disk1" is nothing like your example. I just ignored it and continued.

In step 6), can you be specific about what commands you used to create the DOS partition table? Since I'm not familiar with fdisk, I used "diskutil partitionDisk" with the MBRFormat argument. Is this acceptable?

In step 10), I can't seem to write back to the partition table:
dd: /dev/rdisk1: Invalid argument
0+1 records in
0+0 records out
0 bytes transferred in 0.002190 secs (0 bytes/sec)



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: dstrelau on Jun 14, '05 06:24:58PM

I don't have a Wintel machine to test it on at the moment, but I think I got this working. The partition table shows up in both pdisk and fdisk and both partitions (I created an HFS+ and a FAT32) show up on my Mac.

I'm guessing that diskutil with MBRFormat should be okay, but I did use fdisk. It's pretty easy if you just use the 'help' and '?' commands.

My disk gave the same 'Invalid Argument' complaint. I found that after fdisking, it had changed from /dev/rdisk1 to /dev/rdisk2 -- strange. Also, even when I put in the correct disk number, I still got 'Invalid Argument,' except this time, the drives remounted and the write light on the drive flashed.



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: vitius on Jan 22, '06 06:07:27PM

the following is my entry in attempting to do what you described. [diskutil partitiondisk disk1 2 MBRFormat Journaled HFS+ GBUM 143G MS-DOS FAT32 GUBP 50G]. the GBUM and GBUP terms are just my volume name choices. i continue to get the following message:

"There do not appear to be enough arguments for the number of partitions you specified."

Any idea why? Your help would be appreciated.



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: vikash on Feb 27, '06 12:07:47PM

Try "paritionDisk" with capital D and put "JournaledHFS+" (one word).



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: Agundaba on Feb 10, '04 07:00:31PM
I set up a 120GB disk on Oxford 911 chipset as well laid out by anonymous but encountered a few difficulties later on.

1) The HFS+ partition used to show up in disk utility, ready to be mounted. However, terminal must now be used to mount the partition each and every time the drive is attached.

2) Is it just me or does this cause a significant slowdown in the transfer rate of data now that there's now more than just HFS+ partitions? For me, things have seemed to slow down considerably when transferring files etc. to and from the external.

3) I would love to find out how to adjust the spin down/sleep time for this drive separate from my internal. It hurts to wake this drive up so often.

Any advice?



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: nparkar on Jun 01, '04 05:40:02PM

Hi,

I have a 60G external drive(firewire/USB) which I want to fromat as FAT32 because I want to use it on a mac os X machine also. Is there any size limit on the size of a FAt32 partition? I tried to format it in Windows XP ,both from command prompt(using 'format' command) and Xp utility in Control panel.None of them worked.ON the command prompt I got message that the volume size is too big for FAT32 and there was no option for Fat32 in the XP utility(DiskManagement). Any clues on how I can do this? Also,I had to format as NTFS,assign the drive with a letter and then try FAT32 from command prompt,but it did not work.Thanks for any suggestions!!



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: Accura on Jun 01, '04 11:43:25PM

Format it with windows 200 or read the posts above for a way to do it with in 10.3.x

jameso

---
"The time has come," the walrus said. "To talk of many things..."



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: hamarkus on Feb 16, '05 05:09:42PM

Could you not achieve a similar result by formatting the drive as FAT32* and creating a sparse disk image with OS X on it? It would be like having two partitions whose sizes adjust automatically. Mounting may take a little bit and I don't know whether you could boot of it but otherwise I can see no drawbacks.

* If your drive is bigger than the purported size limit of 127 GB, you will have to create more than one partition.



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: simoncha on Apr 13, '05 03:42:54PM
In step 2), the output I get from "diskutil list /dev/disk1" is nothing like your example. I just ignored it and continued.

OOOPS !!! you should type "diskutil disk1", not "diskutil list /dev/disk1"

In step 6), can you be specific about what commands you used to create the DOS partition table? Since I'm not familiar with fdisk, I used "diskutil partitionDisk" with the MBRFormat argument. Is this acceptable?

You cannot use "diskutil partitionDisk" because it formats every partition and destroy the partition table you made in step 2). You have to use fdisk.
fdisk is not a friendly tool but it can do the job. Use "man fdisk" and go ahead ! A few hints :

  • you should use a raw device (in my example "fdisk -e /dev/rdisk1")
  • after that, use "print' to see the partition table
  • "edit 1" for the first entry
  • "edit 2" for the second and so on ...
  • USE EXACTLY THE SAME PARTITION OFFSET and PARTITION SIZE as IN THE APPLE PARTITION TABLE
  • "quit" to save and exit
  • if you panic ctrl-C works fine !
  • if you are more comfortable with a Linux partition tool (cfdisk, parted, fdisk ...) you can try them. Any tool that write ONLY THE FIRST BLOCK is OK.
In step 10), I can't seem to write back to the partition table: dd: /dev/rdisk1: Invalid argument 0+1 records in 0+0 records out 0 bytes transferred in 0.002190 secs (0 bytes/sec)

It works fine, maybe a typing error or you forgot to unmount the disk.

Good Luck !



[ Reply to This | # ]
Create a bootable HFS+ partition and a FAT32 partition on one external drive.
Authored by: silentaccord on Apr 15, '05 06:32:55PM
Thanks to simoncha, I was finally able to create FAT32 and bootable Mac partitions on the same disk. I'm posting my process in detail so others will know how. I was able to simplify some things and I had to guess with some of the steps so if anyone sees something that should have been done differently, let me know. So far, everything seems to work fine. I included the results of some compatibility testing at the end. The following steps should work in 10.3.

1) Determine the device (e.g. /dev/disk1) associated with your disk. I will be using disk1 and rdisk1 in my examples. You can use steps 2 through 4 in the original hint to find the correct number for your disk. Unmount any partitions that are already on the disk (ejecting from Finder is sufficient). These partitions will be deleted.

2) I made two new partitions, one 18GB Mac (HFS+) called "Mac" and one 10G FAT32 (MS-DOS) called "PC":

diskutil partitionDisk disk1 2 HFS+ Mac 18G MS-DOS PC 10G
3) Unmount the newly created partitions (eject from Finder).

4) Get the partition information. You can use the command pdisk in Terminal. Enter l (lower case L) to list a device's partition map and then /dev/disk1. Then q to quit pdisk. Here's what mine looked like:

/dev/disk3  map block size=512
   #:                 type name                 length   base     ( size )
   1:  Apple_partition_map Apple                    63 @ 1       
   2:           Apple_Free                           0+@ 64      
   3:            Apple_HFS Apple_HFS_Untitled_2 37486592 @ 262208   ( 17.9G)
   4:           DOS_FAT_32 DOS_FAT_32_Untitled_3 20856304 @ 37748800 (  9.9G)
   5:           Apple_Free                           0+@ 58605104
5) Now use fdisk to create the master boot record (MBR) so Windows will recognize the FAT32 partition:
fdisk -e /dev/rdisk1
When prompted to initialize the partition table, enter y.

fdisk doesn't actually create any partitions. It just edits the MBR partition table. That's what the information from pdisk is for. The MBR created by fdisk can only contain information about four partitions. The important ones to enter are the Apple partition map and the HFS+ and FAT32 partitions. This means that in step 2, you can create a total of three partitions. The commands for the two partitions I created are:

edit 1
partition id: af (I wasn't sure what partition id to use for the Apple partition map so I just used HFS+)
edit in CHS mode? n
partition offset: 1 (This is the value in the base column for the Apple partition map in the output from pdisk.)
partition size: 63 (from the length column for the partition map)

edit 2
partition id: af (for HFS+)
edit in CHS mode? n
partition offset: 262208 (from the base column for the HFS partition in the output from pdisk)
partition size: 37486592 (from the length column for the HFS partition)

edit 3
partition id: c (for Win95 FAT32L)
edit in CHS mode? n
partition offset: 37748800 (from the base column for the FAT32 partition)
partition size: 20856304 (from the length column for the FAT32 partition)

You can verify what you've entered using the print command:

         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: AF    0   0   2 -    0   1   1 [         1 -         63] HFS+        
 2: AF   16  82   3 - 1023 192  19 [    262208 -   37486592] HFS+        
 3: 0C 1023 192  20 - 1023 254  47 [  37748800 -   20856304] Win95 FAT32L
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
Nothing is written to the partition table yet so use the write command to do that. Then quit to exit fdisk.

You're done. If you compare this process to the one described by simoncha, you'll see that it's basically the same except that I left out steps 5 and 7 through 10. This is because I was getting "invalid argument" at step 10 and nothing was being written back to the partition table. Since step 10 wasn't really doing anything, the other steps aren't needed.

Compatibility Information

Windows
All the versions of Windows I tried can read and write to the FAT32 partition. I tested 98SE, Millennium, 2000, and XP. ScanDisk and chkdsk don't report any problems with the partition. I reformatted the FAT32 partition using Disk Management in Windows XP. I then examined the Apple partition table with pdisk and the MBR with fdisk. They appeared to be unchanged. Disk Management also shows unallocated space and an unknown partition. Don't format those.

Mac OS X 10.2
I have not been able to create the MBR using fdisk on 10.2. I also have not been able to install from a 10.2 CD to the HFS+ partition. It may be possible to clone 10.2 using Carbon Copy Cloner but I have not tested this. Otherwise, 10.2 reads and writes to the drive without issues. Disk Utility can be used to erase the HFS+ partition and it does not seem to alter the Apple partition table or the MBR.

Mac OS X 10.3 (and beyond)
Everything appears to work with 10.3. It can create the partitions and the MBR. It can read and write to both partitions. Sometimes the FAT32 partition doesn't appear in the Finder even though it is mounted. Unmounting and mounting it with Disk Utility will make it show up. 10.3 can be installed to the HFS+ partition and it is bootable. Disk Utility can be used to erase the HFS+ partition and it does not seem to alter the Apple partition table or the MBR. Additional testing suggests that things will continue to work, even after April 29th.

Occasionally, repairing the FAT32 partition with Disk Utility will show something like:

Next free cluster in FSInfo block (3) not free
fix? yes
It always fixes it and the next scan finds nothing wrong.

Mac OS 9
OS 9 can read and write to the HFS+ partition only. Disk First Aid can be used to erase the HFS+ partition and it does not seem to alter the Apple partition table or the MBR. Because OS 9 drivers were not installed when the partitions were created, it cannot be used as an OS 9 startup disk. I tried using the OS9Drivers argument when I created the partitions with diskutil but this made the partition table much more complex. I don't think it will be possible to make it bootable with OS 9.

I also tested the disk with three third-party Mac disk utilities: DiskWarrior, Drive 10, and Norton Disk Doctor. Norton was the only one that reported any problems. They were invalid creation dates for the volume header block and alternate volume header block. These problems were fixed. The Apple partition table and the MBR appear to be unchanged.

[ Reply to This | # ]

Create a bootable HFS+ partition and a FAT32 partition on one external drive.
Authored by: simoncha on Apr 20, '05 09:02:57AM

silentaccord made a great job !!!
- he is right : a plain MBR on the first block doesn'n prevent the Mac from booting .... so forgot my useless "dd things"
- the solution is thoroughly tested
- and the article is clear ... I would have loved to find something like that on the web a few weeks ago.



[ Reply to This | # ]
How to work with MacOS 10.2
Authored by: decelerate on Apr 21, '05 04:55:31AM

In OS 10.2, the "diskutil" command does not support the important parameter "MBRFormat" meanwhile the "fdisk" command does not work with external drive as described in OS 10.3 with the option "-e". Therefore, the previous posts said their method only work with OS 10.3. Here is my solution, upgrade the "fdisk" command from the opensource project at apple.com.

Here is the link for open source project
<url>http://www.opensource.apple.com/darwinsource/10.3.9/</url>

1. From the above link, click the link "diskdev_cmds-277.4"
2. From the link, click the link "fdisk.tproj"
3. From the link, download the files in the link.
4. Type "make" in the directory containing the downloaded files
5. [Optional] You may backup the file "fdisk" in the directory "/usr/sbin"
6. Type "make install", the new "fdisk" command is ready. :-)

Note that the "make install" command statement should be run as the "root" user.



[ Reply to This | # ]
NTFS?
Authored by: dhdeeg on Oct 29, '05 11:23:56PM

This method is fantastic!

I had a question though. I changed the FAT32 partition to NTFS via Windows (simply re-formated it). Mostly because I have to store and share large disk images from it which FAT32 couldn't handle.

Now, the only problem is that it won't automount within MacOS. It has to be manually mounted via the hdid command. I know – not a big deal but I was wondering if there is anyway to make it automount like the FAT32 partition used to.

I tried changing the partition id to 87 (NTFS VS) but it didn't seem to help. I'm guessing because it has something to do with pdisk still thinking it's a FAT32 drive as when you check it in there it still comes up as "DOS_FAT_32 DOS_FAT_32_Untitled_3 72481856 @ 83886144 ( 34.6G)".

Any ideas? I'm pretty happy though. I thought a bootable/shareable HFS+ and NTFS partition would be impossible.



[ Reply to This | # ]
NTFS?
Authored by: scared on Dec 08, '05 01:25:32PM

i'm a bit late in replying here, but i just faced the same problem. i used silentaccord's method for setting up a firewire drive with two partitions: hfs+ and fat32. then i plugged it into a windows xp box and reformatted the fat32 partition as ntfs. this worked perfectly in windows, but the mac wouldn't recognize the drive.

the problem, as you were guessing is that the apple partition map still think it's fat32, so it doesn't line up properly. to fix this, i unmounted the drive and used sudo pdisk.

first use e (edit device's map) and your particular drive.

then use p (print the partition table) to get the current setup. the partition that has been reformatted to ntfs should be listed as type: DOS_FAT_32.

use t (change a partition's type) and enter the appropriate partition number. it took me a while to find this part, but the correct type should be Windows_NTFS.

next use w (write the partition table) and q followed by q again to quit out of pdisk.

the drive should automount now



[ Reply to This | # ]
NTFS?
Authored by: dhdeeg on Dec 21, '05 09:34:07AM
I gave it a shot though and it keeps saying it can't write to the partition map when I give the 'w' command... Not sure why, made to sure unmount it and tried many times. This is a 10.3.8 machine.
Last login: Wed Dec 31 17:40:00 on ttyp1
Welcome to Darwin!
Put-Workstation-ID-Here-X38-GM:~ schooladmin$ sudo pdisk
Password:
Top level command (? for help): e
Name of device: /dev/rdisk1
/dev/rdisk1
Command (? for help): p
/dev/rdisk1  map block size=512
   #:                 type name                  length   base      ( size )
   1:  Apple_partition_map Apple                     63 @ 1        
   2:           Apple_Free                            0+@ 64       
   3:            Apple_HFS Apple_HFS_Untitled_2  83623936 @ 262208    ( 39.9G)
   4:           DOS_FAT_32 DOS_FAT_32_Untitled_3  72481856 @ 83886144  ( 34.6G)
   5:           Apple_Free                            0+@ 156368000

Device block size=512, Number of Blocks=156368016
DeviceType=0x0, DeviceId=0x0

Command (? for help): t
Partition number: 4
New partition type: Windows_NTFS
Command (? for help): w
The map has not been changed.
Command (? for help): q
Top level command (? for help): q
The end
Put-Workstation-ID-Here-X38-GM:~ schooladmin$ 


[ Reply to This | # ]
NTFS?
Authored by: Ruahrc on Jan 03, '06 11:59:25PM

I too wanted NTFS and HFS+ on my external HD. Here's my situation:

I have a 200GB external HD that I wanted to use to back up both my laptop (Powerbook) and desktop (Windows XP PC). The PC is formatted NTFS, the laptop is HFS+, and I had 20GB spare (200GB - 120GB PC - 60GB laptop = 20GB spare) on the external that I wanted to partition as FAT32 for common access.

I followed the instructions above (tiger, 10.4.3) and it all worked fine. Then I mounted the drive in Windows and reformatted my 120GB partition into NTFS. As you said I can no longer see the NTFS volume from OS X (or at least it doesn't automount) nor do I see the HFS+ volume in Windows. For me though this was no issue. Since the NTFS and HFS+ volumes are for backup only, I only need access to the appropriate volume on the appropriate platform, which happens. The FAT32 volume shows up on both platforms. This way, in fact, is even a little cleaner since connecting the drive to either computer will now only automount the appropriate 2 volumes! Maybe this wasn't working for you though since you needed to access your NTFS volume on OS X (but read-only? OS X cannot natively write to NTFS volumes)

Should I be wary of any other effects I may have incurred by switching from FAT32 to NTFS in Windows? I'm worried about bootability. My current external hard disk is (was) USB, but since I learned here that OS X needs Firewire to boot from, I have since returned my HD and will get a firewire one instead. If I follow these same procedures AND reformat the big FAT32 into NTFS in windows, will I have trouble making a bootable HFS+ clone of my current PB disk?

Thanks for the tip- this one was great! Now I need to go back and better understand the logic behind it all hehe...



[ Reply to This | # ]
Making an OS9 bootable volume.
Authored by: DarkVenegance on Dec 16, '05 07:35:47AM
Another late addiotion and just for the record.

Making the sheme work with a OS9 bootable volume is actually rather easy.

Use diskutil with OS9Drivers and proceed as mentioned.

The only change happens when you create the PC partition 1.
The start is still the base of the Apple_partition_map volume, but for the length sum up all lenghts from Apple_partition_map to Apple_Boot. This makes Windows think it's just one partition, which is okay since it wouldn't know about its contents anyway.

[ Reply to This | # ]

Create a bootable HFS+ partition and a FAT32 partition on one external drive.
Authored by: xtremesniper on Oct 04, '06 06:31:31PM

I have a problem. When I try to follow silentaccord's instructions on OS X 10.4.8, I run into this:

$ diskutil partitionDisk disk1 3 HFS+ Mac 125G MS-DOS Win 75G MS-DOS Common 32.6G
Started partitioning on disk disk1
Creating Partition Map
5% ..Formatting Disk 10% ..Formatting Disk 32% ..Formatting Disk 100% ..
Finished partitioning on disk disk1
/dev/disk1
#: type name size identifier
0: GUID_partition_scheme *232.9 GB disk1
1: EFI 200.0 MB disk1s1
2: Apple_HFS Mac 124.9 GB disk1s2
3: Microsoft Basic Data WIN 75.0 GB disk1s3
4: Microsoft Basic Data COMMON 32.7 GB disk1s4

What went wrong? It makes an EFI partition (I'm running Intel Macbook) without me telling it to, and partition #0 is a different name than what the instructions point out. On top of that, when I try to run pdisk this is what happens:

$ pdisk
Top level command (? for help): l
Name of device: /dev/disk1
pdisk: No valid block 1 on '/dev/disk1'

Somebody please help me! =(



[ Reply to This | # ]
Create a bootable HFS+ partition and a FAT32 partition on one external drive.
Authored by: xtremesniper on Oct 04, '06 06:45:08PM

Okay soo even though things were looking messed up and I couldn't run fdisk, it still works fine on Windows sooooo I don't know why it's working but hey I'm not complaining... Off to reformat one of them to NTFS!



[ Reply to This | # ]
Create a bootable HFS+ partition and a FAT32 partition on one external drive.
Authored by: xtremesniper on Oct 04, '06 06:48:42PM

Okay nevermind again, Partition Magic is labelling my entire drive as "BAD"... Bah, help please!



[ Reply to This | # ]
Intel method
Authored by: silentaccord on Dec 21, '06 09:18:53PM
It's been awhile since you asked so I hope you figured it out. I'll post what I know in case anyone else with an Intel Mac has trouble. All you should have to do are steps 1 and 2 from my previous post.

The default setting on Intel Macs when using the diskutil partitionDisk command is to create a GUID partition table (aka GPT). The FAT32 partition created this way should be recognized by Windows without having to create a master boot record. I was able to successfully reformat the FAT32 partition as NTFS from Windows (I'm not sure why you had trouble; maybe Partition Magic just doesn't like the GPT). The NTFS partition can then be mounted on the Mac but as always, it's read-only. Macs running OS X 10.3 or 10.4 can read and write to the HFS+ and FAT32 partitions but only Intel Macs will be able to boot from the HFS+ partition because of the GPT. OS X 10.2 seems to read both partitions fine but locks up when trying to write. OS 9 won't recognize the disk at all.

It's still possible to do the old method with an Apple partition map on Intel Macs. You just have to add APMFormat to the command in step 2:

diskutil partitionDisk disk1 2 APMFormat HFS+ Mac 18G MS-DOS PC 10G
The rest of the instructions remain the same except that I had to sudo the pdisk and fdisk commands. The advantage of doing it this way is that the HFS+ partition(s) will be bootable for PowerPC and Intel Macs (although an Intel system must be cloned to the drive since the Intel installer doesn't like APM disks). This method also retains OS 9 and OS X 10.2 compatibility.

[ Reply to This | # ]
Intel method, part 2
Authored by: silentaccord on Dec 21, '06 10:58:36PM

I forgot to mention that if the GPT scheme suits your needs, you can set it up from the Partition tab in Disk Utility without entering any Terminal commands. Just make sure GUID Partition Table is selected in Options, then choose Mac OS Extended (journaling optional) and MS-DOS File System for the partition formats.



[ Reply to This | # ]
couple notes for smooth sailing
Authored by: eitchbar on Feb 13, '09 12:18:52PM
three years down the line, this still works great. couple notes:

in step 2: diskutil partitionDisk took disk1 as the device name, though the device name I got from the ls (original post's step 2) was /dev/rdisk1 (maybe I'd have known that right off if I was a more seasoned terminal user?)

in step 3: ejecting from the finder (at least with the usb drive I used, but I assume with firewire too) will eject the disks, leaving pdisk and fdisk nothing to run on. use disk utility to unmount the partitions you're working on

in step 4, that's pdisk -l not pdisk l (there's a dash before the lowercase L)

[ Reply to This | # ]

Tiger Compatibility
Authored by: filburt on May 03, '05 05:07:58PM
I just want to point out that while diskutil works under Tiger, the original hint of using newfs_hfs and newfs_msdos do not. Specifically, mounting the hard disk via hdid will fail.

[ Reply to This | # ]
Tiger Compatibility
Authored by: greigd on May 09, '05 04:02:33PM

Running Tiger - I carried out silentaccord's tip today on my Maxtor OneTouch 300Gb External drive - 2 HFS+ Partitions and 1 FAT32. They work fine as drives, I can read and write to FAT32 from windows and mac, read and write to my HFS+ partitions from the macs, but when I tried to install Tiger on one of the mac partitions the install program said neither were bootable. Back to the drawing board?



[ Reply to This | # ]
Tiger Compatibility
Authored by: silentaccord on May 09, '05 07:54:53PM

Is your drive USB or FireWire? OS X won't boot from USB drives so the installer won't let you install to one.



[ Reply to This | # ]
Tiger Compatibility
Authored by: greigd on May 10, '05 11:40:22AM

I am using it in firewire mode I'm afraid. It has both USB and Firewire connections but I always use it with firewire on the Macs. It's not really a big issue for me personally, the one occasion I couldn't boot my powerbook I simply booted it off my other mac! I just thought you'd appreciate the information. There's a chance I did something wrong, but I followed the instructions by the letter and triple-checked the results!
G



[ Reply to This | # ]
Tiger Compatibility
Authored by: silentaccord on May 10, '05 10:14:50PM

I think I was able to reproduce the problem. It seems that when there are two HFS+ partitions and the MBR has been created, the OS X installer only recognizes the first one as a bootable partition. It's nothing new in Tiger--just something I failed to notice earlier. I'm still not sure why greigd had this problem with both HFS+ partitions.

Even though the installer says the second partition isn't bootable, I was able to clone a working system to it using the restore tab in Disk Utility. I also noticed that Disk Utility won't erase this second HFS+ partition. I'm not sure what the issue is but I'd recommend just one HFS+ partition to be safe.



[ Reply to This | # ]
Tiger Compatibility
Authored by: lukep on May 12, '05 12:53:10AM

I've verified that using hdid to mount the HFS+ partition does indeed fail under Tiger. Same failure with "hdiutil attach". So, what is the workaround? Is there any way to use disks that have been set up this way with Tiger?



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: lukep on May 12, '05 12:44:59AM

I was using my external firewire drive formatted according to these instructions with 10.2, and I just upgraded to 10.4 (Tiger). To my surprise, the HFS+ partition seems to have vanished! When I type "hdid /dev/disk1s1" the response is "hdid: attach failed - not recognized".

Disk Utility thinks that the HFS+ partition is formatted with FAT16, and when I verify the partition it says "Invalid BS_jmpBoot in boot block: 000000" and recommends repair. When I look at the disk under Windows with Disk Management, it thinks the space is unformatted!

Any diagnostic ideas you can provide would be greatly appreciated as I need the files on this disk. Thank you!



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: silentaccord on May 12, '05 06:45:21PM

If you have access to a Mac with 10.2 or 10.3, you can use it to recover the data you need from the drive, then use the instructions I posted (the really long post) to recreate the partitions with diskutil and fdisk. The new method works with 10.3 and 10.4. If you need to recreate the partitions on 10.2, you should use the instructions provided by decelerate to upgrade the version of fdisk in 10.2.



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: salvatore on May 17, '05 04:35:33PM

I had the same problem. You can still read the partition by mounting it with mount_hfs:


$ diskutil list
   1:             DOS_FAT_16                    26.6 GB   disk2s1
$ mkdir /mydata
$ sudo mount_hfs /dev/disk2s1 /mydata
$ ls /mydata
I suggest that you backup the data and reformat the drive using the instructions posted above.

[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: doctorcaligari on Jan 11, '06 12:31:38PM
IT WORKS!!!

I have absolutely ZERO knowledge of the UNIX command line, but I followed Silentaccord's instructions and it WORKED! They were very well written, and I was not confused for one minute...except at the end.

In the post, it said after you finish the

edit
commands in
fdisk
, you can "verify what you've entered using the
print
command. After that, you can use the
write
command to write to the partition table.

However, when I use the

print
command, it mounted the disks, causing the following error:
fdisk: /dev/rdisk1: Device busy
This would throw me out of fdisk, and while the Mac could read the disks fine, Windows XP saw it as unformatted.

I slowed down, got some lunch, and when I came back, I started the process again, but this time I didn't type

print
. I went straight to
write
and everything worked PERFECTLY.

I now have a 100GB FAT32 partition for Win/Mac and a 60GB HFS+ partion exclusively for my iBook.

Thanks everyone on a thorough, well documented thread!

---
12" iBook G4 (1.0GHz)
1.25 GB DDR266 SDRAM
Mac OS X Panther 10.3.9

[ Reply to This | # ]

Create HFS+ and FAT32 partitions on one external drive.
Authored by: Garfke on Jan 29, '06 04:53:57AM
In OSX Tiger
diskutil partitionDisk disk1 2 MBRFormat HFS+ Mac 200G MS-DOS PC 79,46G
works perfect! (Only tested with win2k)
So far, I didn't find how I can specify that the last partition should take the remainder of the disk. Anyone?

[ Reply to This | # ]
works but...
Authored by: silentaccord on Mar 05, '06 04:09:51PM

The HFS+ partition won't be bootable with this method since there's no Apple partition map.

To make the last partition fill the remainder of the disk, just specify a size that exceeds the space available (e.g., 1000G).



[ Reply to This | # ]
Working strategy for Tiger
Authored by: DrLex on Jun 14, '06 07:10:08PM
This method indeed seems to fail on Tiger, the HFS partition doesn't mount and isn't even recognized in Disk Utility.
However, I have tried a slightly different strategy (in 10.4.6) which produces not just a working Mac partition, but also one that mounts automatically!

I started out in the same way as the article described, i.e. partition in Windows (2 primary partitions), and create the FAT partition in the terminal (I put the FAT partition first, I don't know if this matters). After the failed attempt to create a working HFS partition in the terminal, I simply fired up Disk Utility, selected the second partition, and chose 'Erase' with as disk type 'OS X journaled'. It works!

However, be warned that I tried this before on a disk with a more complex partition scheme, with a corrupted partition table as result (which is practically the same as erasing the entire disk). The cause of the failure was probably because I tried to turn a Linux ext2 partition into HFS+ by erasing it in Disk Utility, and this was an extended partition. The morale of the story is: only use this procedure on a 'fresh' disk, with only primary partitions, and make sure there's nothing of any importance on the disk.

The reason why this works so well may be due to Boot Camp, which requires PC and Mac filesystems to coexist on one disk. It is possible that a HFS+ partition created this way will only be mountable in newer versions of Tiger, so some testing is advised if you want to use such a disk on older systems.

[ Reply to This | # ]
This works!
Authored by: jordan314 on Jun 23, '06 01:00:12PM

Thanks for this last comment. This is by far the easiest way to get both partitions to mount, follow the initial instructions and then just use disk utility to erase the HFS+ volume. I used Extended Journaled becase Extended Journaled Case Sensitive seems to give some programs (like the adobe CS installer) some problems.
I'm glad I read all the way to the bottom before trying anything else!



[ Reply to This | # ]
Create HFS+ and FAT32 partitions on one external drive.
Authored by: tikimojo on May 11, '08 12:53:15AM
I found an easier way to do this. OSX 10.4 and Windows XP.
  1. Start Disk Utility (the GUI program, not the command-line version) on your mac.
  2. Select your external drive, using the partition GUI setup two FAT32 (aka MS-DOS) partitions on your drive.
  3. Connect your external drive to your XP pc. The partitions should appear.
  4. Start Windows Explorer, highlight one of those partitions
  5. go under the "file" menu, select "format"
  6. now you can format that partition as NTFS
  7. once it's done with that, disconnect the external drive from your PC and connect it to your mac
  8. now in Disk Utility you'll see your two partitions. Select the remaining FAT32 (MS-DOS) partition and reformat that partition as Mac OS extended (aka HFS+)
Now you've got a working NTFS (what windows likes) partition and a working HFS+ partition (what mac likes) on the same hard drive, and without any additional software or using the command line tools.

Keep in mind that without additional software the PC won't read the mac partition, and the mac won't read the NTFS partition. You can leave the partitions as FAT32 which both will read, but there are limitations to that which you can read about elsewhere.

[ Reply to This | # ]