Subject: install/9608: mac68k sysinst test drive crashes in flames
To: None <gnats-bugs@gnats.netbsd.org>
From: None <hauke@Espresso.Rhein-Neckar.DE>
List: netbsd-bugs
Date: 03/12/2000 15:48:41
>Number:         9608
>Category:       install
>Synopsis:       mac68k sysinst trashes disk contents
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    install-manager (NetBSD system installation bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 12 15:48:00 2000
>Last-Modified:
>Originator:     Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
>Organization:
Einzeln auftretender Radfahrer
>Release:        NetBSD 1.4.2_ALPHA
>Environment:
	
NetBSD 1.4.2_ALPHA (INSTALL) #7: Wed Jan 12 16:49:44 CST 2000
    fredb@corwin.home:/usr/src/sys/arch/mac68k/compile/INSTALL

>Description:
	Trying to test drive sysinst on a NetBSD installation on a 
Macintosh IIcx, I found that it gets the native Macintosh partition 
table wrong and, if you let it have its way, trashes non-NetBSD partitions.

First try with one disk:

scsibus0 at ncrscsi0: 8 targets, 8 luns per target
sd0 at scsibus0 targ 0 lun 0: <DEC, DSP3107LS, 440C> SCSI2 0/direct fixed
sd0: 1021MB, 3117 cyl, 8 head, 83 sec, 512 bytes/sect x 2091144 sectors

sysinst said

 Edit Disk Partition Map: The Map on the disk has been scanned for all
 user-level partitions, but only those usable by NetBSD are displayed.
 The partition table currently looks like:

 Part        size      offset  fstype      use  mount point (name)
 sd0d      119476          96     HFS    MacOS   (Schnurrrps)
 sd0a       60806      119572  4.2BSD     Root  /
 sd0b      158490      180378  4.2BSD     swap
 sd0g      616350      338868  4.2BSD      Usr
 sd0d      422640      955218  4.2BSD      Usr
 sd0e      193732     1377858  4.2BSD      Usr
 sd0f      519554     1571590  4.2BSD      Usr

(note that 'd' shows up twice!) 
but the disklabel output was

8 partitions:
#        size   offset     fstype   [fsize bsize   cpg]
  a:    60806   119572     4.2BSD        0     0     0   # (Cyl.  180*- 271*)
  b:   158490   180378       swap                        # (Cyl.  271*- 510*)
  c:  2091144        0     unused        0     0         # (Cyl.    0 - 3149*)
  d:   119476       96        HFS                        # (Cyl.    0*- 180*)
  e:   422640   955218     4.2BSD        0     0     0   # (Cyl. 1438*- 2075*)
  f:   193732  1377858     4.2BSD        0     0     0   # (Cyl. 2075*- 2366*)
  g:   616350   338868     4.2BSD        0     0     0   # (Cyl.  510*- 1438*)
  h:   519554  1571590     4.2BSD        0     0     0   # (Cyl. 2366*- 3149*)

When I proceeded, sysinst said something to the effect "Partition f 
extends beyond end of disk". At that point I decided to play it safe 
and try the actual install on a disposable disk.

scsibus0 at ncrscsi0: 8 targets, 8 luns per target
sd0 at scsibus0 targ 0 lun 0: <DEC, DSP3107LS, 440C> SCSI2 0/direct fixed
sd0: 1021MB, 3117 cyl, 8 head, 83 sec, 512 bytes/sect x 2091144 sectors
sd1 at scsibus0 targ 2 lun 0: <QUANTUM, LP240S GM240S01X, 6.3> \
	SCSI2 0/direct fixed
sd1: 234MB, 1818 cyl, 4 head, 65 sec, 512 bytes/sect x 479350 sectors

The disklabel showed the layout as 

3 partitions:
#        size   offset     fstype   [fsize bsize   cpg]
  a:    50856       96        HFS                        # (Cyl.    0*- 195*)
  b:   428398    50952        HFS                        # (Cyl.  195*- 1843*)
  c:   479350        0     unused        0     0         # (Cyl.    0 - 1843*)

which I split in sysinst like

 Edit Disk Partition Map: The Map on the disk has been scanned for all
 user-level partitions, but only those usable by NetBSD are displayed.
 The partition table currently looks like:

 Part        size      offset  fstype      use  mount point (name)
 sd1d       50856          96     HFS    MacOS   (Mac HD 2)
 sd1a       60000       50952  4.2BSD     Root  /
 sd1b       61728      110952  4.2BSD     swap
 sd1g      220000      172680  4.2BSD      Usr  /usr
 sd1d       80000      392680  4.2BSD      Usr  /home

-- note again that 'd' is mapped to the HFS partition as well as the /home 
partition. When I proceeded I got

                                 Setting up the Disk Partition Map ...

[...]

     Status: Finished
    Command: /sbin/newfs /dev/rsd1a

[...]

     Status: Failed
    Command: /sbin/newfs /dev/rsd1d
     Press any key to continue

i.e., sysinst was actually trying to newfs the HFS partition, and 
after a reboot to MacOS I found indeed that the first (HFS) partition 
was trashed.


Additional minor quirk: When booting the install kernel to the raster console,
the cursor keys do not work.


>How-To-Repeat:
	Try to install NetBSD on a Macintosh by using sysinst. Have it trash 
your boot disk, reinstall System 7.0.1 or whatever there was before, and 
curse the i386 yuckage compatibility that apparently has leaked through.

>Fix:
	None, sorry - I am not really familiar with sysinst. I haven't exactly 
grown to like it on i386...

>Audit-Trail:
>Unformatted: