Creating Mac and PC partitions on the same disk
As my frequent readers know, I’ve been fighting with my PowerBook, Sony VAIO and LaCIE BigDisk combination. The aim has been to get a native partition for both computers; Mac needs a backup drive and VAIO needs space to store my photographs.
My fair share of troubles have included NTFS issues and destroying the whole disk partition map with Mac’s tools. Finally I found decent instructions to set things right. Of course, these instructions were not perfect and I had to fiddle with them to get things working.
I have a 500GB external disk. I would like to have two partitions, both 100GB and the rest would be reserved for future extensions. The following path took me to the completion:
1. Boot up Mac.
2. Open a terminal window.
3. Write the following command:
ls /dev/disk?
You should see list of the current drives, such as /dev/disk0
4. Attach external disk.
5. Eject current drives from the desktop (or use Finder).
6. Write the previous command (ls /dev/disk?) again.
7. There should be a new drive, in my case /dev/disk1. Mark the number down and use it instead of 1 when following these instructions.
8. Create the required partitions:
diskutil partitionDisk disk1 3 HFS+ MacBackup 100G MS-DOS Lacie 100G MS-DOS Empty 270G
This will take a while. Now you have three partitions, and the last one fills the disk. This is the partition to be deleted in a while. For some odd reason, Mac diskutil always fills the disk with the last partition, and you may end up to have too large FAT32 partition.
9. Start pdisk in the terminal.
9a. Check the partition table with “l” (lowercase L). Write /dev/disk1 as the device. You should see the following listing or similar:
/dev/disk1 map block size=512 #: type name length base 1: Apple_partition_map Apple 63 @ 1 2: Apple_Free 0+@ 64 3: Apple_HFS Apple_HFS_Untitled_2 209453056 @ 262208 4: DOS_FAT_32 DOS_FAT_32_Untitled_3 209715200 @ 209715264 5: DOS_FAT_32 DOS_FAT_32_Untitled_4 561039039 @ 419430464 6: Apple_Free Extra 0+@ 980469496 Device block size=512, Number of Blocks=980469496 DeviceType=0x0, DeviceId=0x0
9b. Enter editing mode by pressing “e”. Enter /dev/disk1 as the device.
9c. Delete last partition by pressing “d”. Enter the number of the partition, in my case “5″.
9d. Check the results by pressing “p”. The partition 5 should have been deleted and merged with partition 6:
/dev/disk1 map block size=512 #: type name length base 1: Apple_partition_map Apple 63 @ 1 2: Apple_Free 0+@ 64 3: Apple_HFS Apple_HFS_Untitled_2 209453056 @ 262208 4: DOS_FAT_32 DOS_FAT_32_Untitled_3 209715200 @ 209715264 5: Apple_Free Extra 0+@ 419430464 Device block size=512, Number of Blocks=980469496 DeviceType=0x0, DeviceId=0x0
9e. Write the partition table to disk with “w”.
9f. Quit the editing mode and pdisk by pressing twice “q”.
10. Reboot the computer. I read from some tech-savvy sites that pdisk doesn’t flush all caches, so it’s best to reboot before continuing.
11. After reboot, eject drives and open terminal.
12. Start pdisk and print out the partition table with “p”. You should see the same table as above.
13. Open another terminal window.
14. Write MBR (master boot record) for Windows computers:
fdisk -e /dev/rdisk1
15. Answer “y” for initialising the partition table.
16. Now edit all partitions for Windows use, too. Copy the partition offset from the column “base” from the pdisk listing. Copy the partition length in similar fashion from the column “length”. You may want to use clipboard to avoid typos. Use “af” as Mac partition id and “c” as FAT32 id. Answer “n” for question about editing in CHS mode.
edit 1 Partition id (’0′ to disable) [0 - FF]: [0] (? for help) af Do you wish to edit in CHS mode? [n] n Partition offset [0 - 980469503]: [63] 1 Partition size [1 - 980469502]: [980469502] 63 edit 2 Partition id (’0′ to disable) [0 - FF]: [0] (? for help) af Do you wish to edit in CHS mode? [n] n Partition offset [0 - 980469503]: [64] 262208 Partition size [1 - 980207295]: [980207295] 209453056 edit 3 Partition id (’0′ to disable) [0 - FF]: [0] (? for help) c Do you wish to edit in CHS mode? [n] n Partition offset [0 - 980469503]: [209715264] 209715264 Partition size [1 - 770754239]: [770754239] 209715200
17. Check the results with print command:
Disk: /dev/rdisk1 geometry: 61031/255/63 [980469503 sectors]
Offset: 0 Signature: 0xAA55
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 43 45 [ 262208 - 209453056] HFS+
3: 0C 1023 43 46 - 1023 86 26 [ 209715264 - 209715200] Win95 FAT32L
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
18. Save the partition changes with write and then exit by typing quit.
19. Now you should be done.
Note that even if this worked for me, it can screw your disks. I don’t take any responsibility whatsoever about any damages. You do this at your own risk.
1. Sorenmd — Tuesday, Oct 17 2006
It is much easier to create multiple partitions (of different format) by using the free lunix utility “GPartedLiveCD”. It boots to a linux patition manager and allows you to create and split partitions in over 8 formats. Cheers from OSx86SMD