AFDISK 0.03 (still alpha!)

This is an fdisk program for partioning harddrives using Amiga-RigidDiskBlocks.
It's in a very early stage.

The most actual release of afdisk can be obtained from my WWW-Homepage:

http://www.schokola.de/~stepan

It ought to work on *ALL* Linux-Systems with Kernel >2.0.10, but
also with the m68k Kernel (1.2.13pl10). I need reports on this.
Please mail me, no matter wether you got this piece of code to work or not.
Anyone tested Linux/m68k 2.0.x???

Be careful! It is easy to destroy your whole data with one touch!

If you have a MBR on your harddisk, too, you should *NEVER* reorganize rdb to
block 0  (or 1?) or the MBR gets lost. If you do not know what MBR is, this is
not interesting for you.

Usage: afdisk [device]
  device default to /dev/hdc, enter similiar as desired.

I was to lazy to create a new manpage so I included the fdisk-3.0
page. Note: fdisk 3.0 has a lot of functions AFDISK still doesn't have.

It's not the exact usage. I plan to make afdisk behave like the original 
Linux-fdisk, but this is still a long way.

Thabks to Frank Neumann and Leland for their ideas and help.

***** NOTE: *********************************************************************

   Joerg Dorchain, dorchain@cip50.cscip.uni-sb.de

made the first try to write an fdisk for RDBs. His initial work was a big
help for me (I do not have much documentation about the RDB stuff). Thanks Joerg.

*********************************************************************************

Look at the TODO-file if you feel inspired.
Feel free to ask me anything about RDB how and why.
Don't flame me for bugs, you've been warned about.
Improve them or report them.

Since I hardly do anything with my old bare boned Amiga 1200
(which does not run Linux at all ;-< ) I had to develop this
tool on my intel-linux workstation. it workes fine for me and
partitions got recognized when giving an fdisk'ed hd back to an
Amiga.
Please report any tests on any machine/configuration you can get.
It's up to you to find some bugs for me to fix them...

This version is still ALPHA. It's to your responsibility
if your data gets lost.


For the Dostype-Choice, I have a (tested) proposal:

Cite from 'The Amiga Guru Book' from Ralph Babel, Page 561:

de_DosType - The DOS type determines a disk's block structure; $444F5300
  ('DOS\0')identifies the old filesystem (default), $444F5301 ('DOS\1') the
  FastFileSystem, and $444F5302 ('DOS\2') and $444F5303 ('DOS\3') the new
  "international" versions thereof. It is used as the default DOS type by
  Format, as the 2.0 ROM filesystem is able to handle different formats
  (see section 17.1.50). The filesystem-private DOS-type identifier as
  stored in block 0 of a partition determines the actual block structure
  (see section 15.3.9).

  For DosEnvec structures that are part of the RDB, de_DosType is also used
  to indicate the type of partition data, e.g under Amiga-UNIX ( :-) ):

  UNI\0 - classic AT&T System-V filesystem
  UNI\1 - UNIX boot "filesystem" (dummy entry for Amiga OS's boot menu)
  UNI\2 - Berkeley filesystem for System V
  RESV  - reserved (e.g. swap space)

  Under 2.0, FileSystem.resource entries exist for DOS\1, DOS\2, DOS\3 and
  UNI\1 (i.e all bootable "filesystems" other than DOS\0, which is always
  considered to be available as boot filesystem). As different revisions of
  Commodore's filesystems can handle different sets of partition formats,
  it is unclear wether de_DosType is used as an alias for the filesystem
  code to be used (e.g. during autobooting) or as an indicator as to which
  format the partition is in. Neither of these interpretations is fully
  consistent with the current usage and existing filesystems and may
  therefore cause problems.

What follows from this for now is:

set the DosType of all your Linux partitions to RESV and Flags
to noboot,nomount. So they will not appear in the boot menu nor 
show up anyhow under Amiga OS.

set the DosType to RESV and Flags to noboot,mount if you want to share a
partition (e.g swap) between Linux and AmigaDos without an appropriate
filesystem (e.g. for use with VMM). This gives only the device name
without a volume node -> no annoying "Not a Dos disk" icon.
set the DosType to UNI\1, Flags to boot,mount (priority as desired) and
BootBlocks to 2 of your Linux root partition for use of Amiga-LILO.
So the partion will show up in the bootmenu but dissappear silently
when booting AmigaDos from another partition.



Stefan Reinauer, <stepan@matrix.kommune.schokola.de>

