MAC-FDISK(8)	Linux Programmer's Manual	MAC-FDISK(8)


NAME
       mac-fdisk - Apple partition table editor for Linux

SYNOPSIS
       mac-fdisk   [-h|--help]	[-v|--version]	[-l|--list  [name
       ...]]
       mac-fdisk [-r|--readonly] device ...

DESCRIPTION
       mac-fdisk is a menu driven program which partitions  disks
       using   the   standard	Apple  disk  partitioning  scheme
       described in "Inside Macintosh:	Devices".   It	does  not
       support	the  intel/dos	partitioning  scheme supported by
       fdisk.  The device is usually one of the following:

	      /dev/sda
	      /dev/sdb
	      /dev/sdc
	      /dev/sdd
	      /dev/sde
	      /dev/sdf
	      /dev/sdg
	      /dev/hda
	      /dev/hdb

       MkLinux interprets device names differently than	standard
       Linux.	In  MkLinux  /dev/sda is the device at SCSI id 0,
       /dev/sdb is the device at SCSI id 1, and so on.	In  stan
       dard Linux /dev/sda is the first hard disk on the SCSI bus
       (i.e. the one with the lowest id), /dev/sdb is the  second
       hard disk, and so on.  The partition is a device name fol
       lowed by a partition number.  The partition number is  the
       index  (starting	from  one) of the partition map entry in
       the partition map.  For example, /dev/sda2 is  the  parti
       tion  described by the second entry in the partiton map on
       /dev/sda.


OPTIONS
       -v | --version
	      Prints version number of the mac-fdisk program.

       -h | --help
	      Prints a rather lame set of help messages	for  the
	      mac-fdisk program.

       -l | --list
	      If  no  names  are present then lists the partition
	      tables for /dev/sda, /dev/sdb, /dev/sdc,	/dev/sdd,
	      /dev/sde, /dev/sdf, and /dev/sdg.	Otherwise, lists
	      the partition tables for the specified names.

       -r | --readonly
	      Prevents mac-fdisk from writing to the device.



MkLinux DR2		20 December 1996			1





MAC-FDISK(8)	Linux Programmer's Manual	MAC-FDISK(8)


Editing Partition Tables
       An argument which is simply the name of a device indicates
       that  mac-fdisk	should	edit  the partition table of that
       device.

       The current top level editing commands are:

	      h	command help
	      p	print the partition table
	      P	(print ordered by base address)
	      i	initialize partition map
	      s	change size of partition map
	      c	create new partition
	      C	(create with type also specified)
	      d	delete a partition
	      r	reorder partition entry in map
	      w	write the partition table
	      q	quit without saving changes

       Commands which take arguments prompt for each argument  in
       turn.  You can also type any number of the arguments sepa
       rated by spaces and those prompts will  be  skipped.   The
       only  exception	to typeahead are the confirmation prompts
       on the i and w commands.	The idea being that if we expect
       you to confirm the decision we shouldn't undermine that by
       allowing you to be precipitate about it.

       Partitions are always specified by their number, which the
       index  of  the partition entry in the partition map.  Most
       of the commands will change the index numbers of all  par
       titions	after the affected partition.  You are advised to
       print the table as frequently as necessary.

       Creating more than  fifteen  partitions	is  not	advised.
       There is currently a bug in the some (all?) of the kernels
       which causes access to the whole disk fail  if  more  than
       fifteen partitions are in the map.

       The  c (create new partition) command is the only one with
       complicated arguments.  The first  argument  is	the  base
       address	(in blocks) of the partition.  Besides a raw num
       ber, you can also specify a partition number  followed  by
       the letter 'p' to indicate that the first block of the new
       partition should be the same as the first  block	of  that
       existing	free	space  partition.  The second argument is
       the length of the partition in blocks.  This can be a  raw
       number or can be a partition number followed by the letter
       'p' to use the size of that partition or can be	a  number
       followed by 'k', 'm', or 'g' to indicate the size in kilo
       bytes, megabytes, or gigabytes respectively.   (These  are
       powers  of 1024, of course, not powers of 1000.)	The last
       argument is the name of the partition.  This can be a sin
       gle  word without quotes, or a string surrounded by single
       or double quotes.



MkLinux DR2		20 December 1996			2





MAC-FDISK(8)	Linux Programmer's Manual	MAC-FDISK(8)


       The C command is identical to  the  c  command,	with  the
       addition	of  a	partition  type	argument after the other
       arguments. The partition type used for Linux swap and data
       partitons  is  APPLE_UNIX_SVR2 (this partition type is set
       by the c command automatically when the partition name  is
       one of the typical A/UX partition names as root&usr, root,
       usr or swap). Under normal circumstances, you  should  not
       need to use this command.

       The  r (reorder) command allows the index number of parti
       tions to be changed.  The index numbers are constrained to
       be a contiguous sequence.

       The  i  (initalize)  command  prompts  for the size of the
       device.	This was done to get around a bug in  the  kernel
       where it reports the wrong size for the device.

       The  w  (write)	command does write the partition map out,
       but there is currently a bug in	the  interaction  between
       MkLinux	and Mach which causes the partition map not to be
       reinterpreted.  In order to use the new partition map  you
       must reboot.


BUGS
       Some  people  believe there should really be just one disk
       partitioning utility.
       mac-fdisk should be able to  create  HFS	partitions  that
       work.  Currently,  if  a	pre-existing  HFS  partition  is
       resized, MacOS will continue to	use  the  partition  size
       stored  in  the HFS 'superblock' instead of using the size
       from the partition table (the MacOS volume on  the  parti
       tion  remains valid even though the sizes don't match any
       more). This can have  undesired	side  effects  especially
       when creating a few Linux partitions in part of the previ
       ous HFS partition space. In order for MacOS to  reinitial
       ize  the volume, the HFS partition needs to be invalidated
       by zeroing the first few megs with dd.
       Even more help should be available during user input.

SEE ALSO
       fdisk(8), mkswap(8), mkfs(8)

AUTHOR
       Eryk Vershen (eryk@apple.com)












MkLinux DR2		20 December 1996			3