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


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