1Product name: pdisk 2Version: 0.8 3Ship date: 16 May 2000 4Company name: n/a 5Author name: Eryk Vershen 6 7Description: A low-level Apple partition table editor for Linux. 8 A MacOS version exists for "standalone" use. 9 10What's New: Clean up sources - fix naming, delete old email addresses 11 Added support for display of Mac volume names 12 Added cvt_pt target (for LinuxPPC team) 13 Fix block 0 display to show logical offset of drivers 14 Require confimation of quit without write 15 Fix iteration to not complain about missing devices 16 Warn when creating/writing a map with more than 15 entries 17 Make initial window larger in Mac version 18 Fix ATA support to scan buses correctly 19 Fix linux names (in MacOS) to work right when many devices 20 Change so WORM devices are considered 'CDs' 21 22Last time: Added support for ATA/IDE disks without LBA capability 23 Fixed bug - create partition with unmodified size failed 24 Added support for new (DR3) MkLinux names - show MkLinux 25 name when displaying under another name and allow the 26 MkLinux name to be used on input. 27 28Requirements: Linux PPC - just run the binary 29 MacOS - Distributed binaries for PowerPC or 68000 30 I haven't tried it except on 7.6.1 and 8.0 31 32Price: Free 33 34Legalese: 35 Modifications copyright 2000 by Eryk Vershen 36 37 Copyright 1996,1997,1998 by Apple Computer, Inc. 38 All Rights Reserved 39 40 Permission to use, copy, modify, and distribute this software and 41 its documentation for any purpose and without fee is hereby granted, 42 provided that the above copyright notice appears in all copies and 43 that both the copyright notice and this permission notice appear in 44 supporting documentation. 45 46 APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE 47 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 48 FOR A PARTICULAR PURPOSE. 49 50 IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR 51 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 52 LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, 53 NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 54 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 55 56 57Contact Info: You can send mail to the author. There is no guarantee of 58 a response, but it is your best hope of getting a bug fixed 59 or a feature added. 60 61 62Other info: 63 64 65READ the html file or the man page. 66 67 68Finding out about apple partitioning 69------------------------------------ 70The best curently available documentation on the Apple disk partitioning scheme 71is "Technote 1189: The Monster Disk Drive Technote". This release is not 72completely in sync with that technote. Maybe next time. 73 74 75Building the macintosh application 76---------------------------------- 77I have only built this under Code Warrior Pro. The project file is included. 78Thanks to Martin Minow for the SCSI support code. 79 80 81Some notes on the apple partitioning 82------------------------------------ 83The apple disk partitioning scheme was developed in 1986. It attempted to 84be forward thinking as it was intended to handle drives of sizes up to several 85hundred megabytes. There was a design document, but like most such documents 86it was neither complete nor unambiguous. 87 88While the original intent was to handle various block sizes, in practice 89most devices use a partitioning block size of 512 bytes. 90Since the various address fields are 32 bits unsigned this means the format 91can handle disks up to 2 Terabytes in size. (32bits + 9 bits = 41 bits) 92Because the format was designed around SCSI, there is no knowledge of 93cylinders or heads, all block address are in absolute sector form. 94A correct map should describe every block on the disk except for block zero. 95 96An aside on CDROMs. Most old apple CDROMs have incorrect data in block zero. 97Since the HFS file-system could only handle 512 byte blocks, apple drives had 98a special mode where they would do deblocking (i.e. converting 2k blocks 99into four 512byte blocks and accepting 512byte block addresses.) The partition 100maps laid down on these disks are for the deblocked form. In many cases the 101partition maps they contain have only the minimum number of fields correct. 102At least one CDROM I have seen doesn't even contain a partition map at all, 103but is simply an HFS volume. 104Bootable CD-ROMs have even stranger partition maps since two are laid down: 105one at 2K offsets and one at 512-byte offsets. If you notice that these 106overlap then you begin to get an idea of how wierd these maps can be. 107Apple refers to this "technique" as ghost partitioning. 108 109The documentation in Inside Macintosh is only partially correct. 110The boot-arguments field was left out. A/UX used the boot arguments field 111for something that was called the bzb (block zero block - don't ask me why). 112This structure evolved over the course of A/UX. I have recapitulated this 113in the dpme.h header file. 114 115 116Making a disk with Apple & Intel partitioning 117--------------------------------------------- 118Don't cringe. I know it is an awful hack, but sometimes... 119While I don't recommend doing this, it can be useful. 120The procedure below is what we did. 121 122The intel map can contain NO MORE THAN FOUR PRIMARY PARTITIONS. 123You can't have any extended or logical partitions. (Well, you might get it 124to work but I wouldn't want to try it.) The disk will NOT BE INTEL BOOTABLE. 125 1261) Use pdisk to initialize an apple partition map. Don't add any partitions 127 yet, just write the map out and quit. 128 1292) Use fdisk to create the primary partitions. Go into the expert 'x' menu 130 in fdisk and print out the table with the sector addresses. Write the 131 start and lengths down some where. Write the table out. 132 1333) Use pdisk again. Shrink the partition map down, if necessary, so it 134 does not overlap any intel partition. Create an apple partition for each 135 intel partition using the start and length value you got from fdisk. 136 Write out the map and quit. 137 138At present file systems are not compatible between Linux & MkLinux, but you 139can tar stuff into these partitions and tar them out on another machine. 140 141 142 143Good luck, 144 145-eryk vershen 146 software mechanic 147 eryk@cfcl.com 148