Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
README for hfdisk ================= hfdisk is a partition table editor for Linux which understands the Apple disk partitioning format. hfdisk is a fork of mac-fdisk, which in turn is a fork of pdisk. Compared to pdisk, these forks have numerous bug fixes, quality of life improvements, and portability enhancements. See AUTHORS for a list of contributors. Please read the man page. (man ./hfdisk.8) The best curently available documentation on the Apple disk partitioning scheme is "Inside Macintosh: Devices" pages 3-12 to 3-15 combined with the info in "Inside Macintosh - Volume V" pages V-576 to V-582. This, unfortunately, does not cover everything. Some notes on the apple partitioning ------------------------------------ The apple disk partitioning scheme was developed in 1986. It attempted to be forward thinking as it was intended to handle drives of sizes up to several hundred megabytes. There was a design document, but like most such documents it was neither complete nor unambiguous. While the original intent was to handle various block sizes, in practice only 512 byte blocks are supported. Since the various address fields are 32 bits unsigned this means the format can handle disks up to 2 Terabytes in size. (32bits + 9 bits = 41 bits) The program uses 64-bit file offsets even on 32-bit hosts, but it rejects devices larger than the address space representable by the Apple Partition Map format. Because the format was designed around SCSI, there is no knowledge of cylinders or heads, all block address are in absolute sector form. A correct map should describe every block on the disk except for block zero. An aside on CDROMs. Most old apple CDROMs have incorrect data in block zero. Since the HFS file-system could only handle 512 byte blocks, apple drives had a special mode where they would do deblocking (i.e. converting 2k blocks into four 512byte blocks and accepting 512byte block addresses.) The partition maps laid down on these disks are for the deblocked form. In many cases the partition maps they contain have only the minimum number of fields correct. At least one CDROM I have seen doesn't even contain a partition map at all, but is simply an HFS volume. The documentation in Inside Macintosh is only partially correct. The boot-arguments field was left out. A/UX used the boot arguments field for something that was called the bzb (block zero block - don't ask me why). This structure evolved over the course of A/UX. I have recapitulated this in the dpme.h header file. Making a disk with Apple & Intel partitioning --------------------------------------------- Don't cringe. I know it is an awful hack, but sometimes... While I don't recommend doing this, it can be useful. The procedure below is what we did. The intel map can contain NO MORE THAN FOUR PRIMARY PARTITIONS. You can't have any extended or logical partitions. (Well, you might get it to work but I wouldn't want to try it.) The disk will NOT BE INTEL BOOTABLE. 1) Use hfdisk to initialize an apple partition map. Don't add any partitions yet, just write the map out and quit. 2) Use fdisk to create the primary partitions. Go into the expert 'x' menu in fdisk and print out the table with the sector addresses. Write the start and lengths down some where. Write the table out. 3) Use hfdisk again. Shrink the partition map down, if necessary, so it does not overlap any intel partition. Create an apple partition for each intel partition using the start and length value you got from fdisk. Write out the map and quit. At present file systems are not compatible between Linux & MkLinux, but you can tar stuff into these partitions and tar them out on another machine. Good luck, -eryk software mechanic eryk@apple.com