Subject: Re: disklabel in mac68k port.
To: Takeshi Shibagaki <ie9t-sbgk@asahi-net.or.jp>
From: Bob Nestor <rnestor@augustmail.com>
List: port-mac68k
Date: 09/24/2000 11:12:12
Takeshi Shibagaki wrote:

>Hi, 
>
>From: Bob Nestor <rnestor@augustmail.com>
>Subject: Re: disklabel in mac68k port.
>Date: Sun, 24 Sep 2000 08:32:59 -0500
>Message-ID: <m13dBtr-0002QXC@mail.augustmail.com>
>
>rnestor> Native disklabels are not supported in the mac68k port right now, 
>just 
>rnestor> faked incore bsd style disklabels which are constructed from the 
>Apple 
>rnestor> Disk Partition Map on boot.  So the only thing the disklabel 
>command will 
>rnestor> do is display the current disklabel; it won't let you modify them.
>
>OK, I see, but how fake? I cannot boot up kernel from native BSD partition, 
>because I cannot change fstype from HFS to 4.2BSD.
>
The incore label is faked in that there is no identical copy of it that 
exists ondisk. The disklabel program usually lets you edit the ondisk 
label and forces this back into memory as the incore version when you 
exit to insure both copies are identical. Normally a BSD UNIX system just 
reads the ondisk label into memory to create the incore copy. In the 
mac68k port the incore BSD label is constructed by the kernel when the 
system boots. It does this by reading and parsing the Apple Disk 
Partition Map.  The disklabel application has no knowledge of the Apple 
Disk Partition Map and lets you edit a copy of the incore label then 
calls a special kernel routine to rewrite this onto the disk which then 
forces the kernel's incore copy to be updated.  In the mac68k port this 
kernel routine does nothing because there is no ondisk copy of the label. 
 The result is your edit changes don't get written to the disk or updated 
in the kernel's incore version, which is good since you want the system 
to see the same disk setup on the next boot!

>I would like to boot up from ATA disk, but not apply Mkfs, so I am 
>embarrassed.

This is correct.  Mkfs does not support IDE/ATA disks, only SCSI disks on 
the internal Bus. The Installer application uses the same disk I/O 
routines so it is also limited to SCSI disks on the internal Bus.  So if 
you are trying to get the disk partitions changed so you can run the 
Installer you have another problem waiting for you.

You'll have to use a 3rd party disk formatter to try to fix the partition 
types making sure the formatter correctly sets the useage bits - not all 
disk formatters do. Without the proper usage bits set the partition can't 
be seen by the kernel on boot and thus won't be parsed correctly when 
trying to create the fake incore disklabel.   Or if someone has built an 
Installation kernel with ATA disk and sysinst support for the mac68k port 
you should be able to use sysinst to convert the partitions.  If you do 
this make sure you have a good backup of your disk before you try!  
People have had disk corruption problems with the version of sysinst that 
is currently in the source tree.

-bob