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


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: 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 | # ]