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


Click here to return to the 'Create a bootable HFS+ partition and a FAT32 partition on one external drive.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
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 | # ]