Subject: A recent disk format saga (with v2.0_RC5 tools/sysinst) **Long**
To: None <port-mac68k@NetBSD.org>
From: Gene ENonymous <yancm@sdf.lonestar.org>
List: port-mac68k
Date: 11/27/2004 19:36:28
Hi All,

By at least one request, I'm posting a report on my most recent disk
formatting success. I'll conclude with a new suggested method (ritual? 8-)
that (I'm pretty sure) worked for me. 

I have a Centris 650 w/48M ram, a 256M Quantum/Apple'ised HW w/sys 7.5 on sd0
and a 2G Seagate on sd1 devoted to netbsd exclusively.

I grabbed the install tools from the latest daily build...
2.0 RC5 (NetBSD-daily/netbsd-2-0/unoficial/200411121400/mac68k):

The last time I installed NetBSD (I ran version 1.5.2 for about 2 years)
on this machine I had a horrible time getting the Seagate properly set up.
(and I've slept a lot of times since then...I'm busy and 44...this is
definitely a hobby)

It installed and ran, but "df" gave really wierd (block counts and used counts
math just didn't work out) looking output and it was impossible to tell if I
was actually using the whole 2G and I knew I was going to need it to create
src and pkgsrc.

My assumption is that it really needs a clean low-level format. So
I hooked the disk to a windows box and made a low-level format with
the Seagate Enterprise disk tool application. Then I put it back into my mac.

I downloaded and did the foreign disk recognition hack for the AppleHD formatter.
I'm pretty sure this was surpurflous since I used a win-app to do the low
level format per the above paragraph. 

*Aside*
I ran this loop a couple of times fighting the scsi read error #5 -
IT SURE WOULD BE NICE if "sysinst" AND "mkfs" would give a hint about this error.
(if any partition is greater that 1G, just pop out a warning about the posibility
of this particular error and that "site documentation outlines a workaround"
would be a HUGE help to newbies.

As we move forward in time I suspect it will be more common to have/try to
use larger disks and partitions - even with mac68k.
I finally found scsi read 5 error in the faq and mailing lists, 
...sigh...I'm old enough to RTFM!
Would putting a port/mac68k condition specific warning message in
sysinst (and mkfs on the mac side maybe), be philosophically allowed? - 
*EndAside*


I downloaded the booter, install kernel, the boot kernel, installer
(g and h version - why two versions? 'td be nice if only one -
one less variable in debugging problems), mkfs, sets, kernel, sysinst-kernel, etc.

Sysinst Kernel:
--------------
I had used the sysinst kernel on i386 and thought it was fantastic, so I figured
I'd give it a try on mac68k...

I followed the obvious branch and tried a clean install on the HD. I was able to
split up my disk (I chose 1.9G for the root and user and about 256M for a swap).

*Aside*
I tried this loop numerous times - at least once with a clean disk format using 
the AppleHD Formatter and at least twice using a clean low-level format using
the Seagate Windows Enterprise tools. I think EITHER formatter will work...
my successful loop was using a clean format from the Seagate Win utility...
*EndAside*

At the next critical step, sometimes I'd get an error that fsck would not run and the 
sysinst was aborting...

  I tried patching this using the utilities menu at /bin/sh...didn;t have much luck...

Sometimes I'd get no error and a report that everything was fine and it would attempt to
fetch the binary sets for ftp install. After I got ftp properly configured (not trivial
to put the full path of a daily/unofficial/dated binaries...but not too bad), it would
start to download the source only to abort after pulling down ~20k of the first
file with a device full error.

What appeared to be happening was that the disk got partitioned and disklabeled, but
not newfs'ed OR mounted. Unfortunately there was no error caught or displayed...
so I figured to fall back to the traditional method.

Traditional Approach for Install:
--------------------------------
I found that the sysinstall produced "format" and "disklabel" were fine.

I could run mkfs on the MacOS side and see the partitions I had created on sysinst.
If I tried to format these partitions, it gave a message saying it didn't
recognize the format type. (I'm trying to summarize 2-3 days of uncontrolled
experimentation from memory...) I changed these partitions to NetBSD Root & USR (1.9G)
and swap (256Mish-the balance), and format ran fine which really looks like a newfs output,
not a true "format".

After I downloaded the binary sets, I next ran the installer and thought I was really
making progress!!!! It recognized and mounted my root partition (which in my case
was the only partition). I made devices and then set to install the sets. It got a ways
into base.tgz and died/locked up with the scsi read #5 error.

The first 5 or 6 times this happened (I don't mean I just kept trying the same thing
...NOoooo...
I tried a factorial combination of format/sysinst/traditional install because I just
figured this was some sort of format issue).

After I determined that nothing I was doing on the format side had ANY effect on the
issue I started searching the mailing lists which also pointed to the netbsd/portmac68k

*** INSTALL FAQ:  http://www.netbsd.org/Ports/mac68k/faq/faq-4.html#ss4.12 .

The scsi read 5 error is known and has resurfaced numerous times (but not for everyone).
Several contributing factors were noted
o trying to have a partition greater than 1G
o using (or even having on the system?) a Quantum manufactured disk
o hardware of type Centris 650

Hmmm...I seem to have hit the trifecta!?!?

The proposed workaround was to only use partitions less than 1G 
or
The procedure listed at the above link

But, being lazy I found this alternative worked fine for me, YMMV

Getting the disks formatted and the latest nightly/unofficial build installed and running:
-----------------------------------------------------------------------------------------
- Format the disk (I used a winXP box and Seagate low-level format tool,
  but I think the AppleHDFormat works too) but don't partition it (sysinst
  appears to ignore existing format if you choose "install to disk".)

- Use booter and the sysinstall kernel to get the partitions
  the way you want using the "install to disk" option,
  then break out of sysint and reboot. (Ctrl^C and reboot)

- In MacOS, use mkfs to "change" the sysinst partitions and "format" then exit mkfs.

- In MacOS, use the install program minishell to verify that you can mount all your
  partitions (mine was trivial since I was using a 1.9G Root&Usr on the /dev/sd1a
  partition which got mounted automatically when I told installer which disk to use.

  "make devices" using the menu pick - This apparently also creates the fstab so
  make sure you have what you need mounted before you run this.

  "install sets" base.tgz, it WILL crash at a scsi read error #5. This will require a hard
  reset back to MacOS.

- Use booter and the sysinstall kernel again. This time choose update or add sets.
  When I chose this option it ran fsck on my file system, marked it clean and it
  was good to go and I was able to install using ftp with no additional issues.
  
  Reboot when install reads as complete.
 
- In MacOS, start booter. I told mine to point to partition 0 and netbsd kernel...
  
  Chose "boot now" and up it comes into NetBSD 2.0 RC5 (GENERIC). ready to configure and run...


Thanks,
gene