Subject: Re: Making a disk bootable
To: Tsubai Masanari <tsubai@iri.co.jp>
From: Erik Bertelsen <erik@mediator.uni-c.dk>
List: port-macppc
Date: 09/03/1998 22:46:11
On Fri, Aug 28, 1998 at 07:14:09PM +0900, Tsubai Masanari wrote:
> >I've tried to partition the disk (a 105 MB Syquest in case it is relevant)
> >with a mix of several applications (Silverlining, pdisk under Linux, disklabel
> >under netbsd) and made file systems with newfs.
> 
> pdisk is not needed (has no effect) because NetBSD/macppc currently
> don't use Apple partition map.
> 
> >My problem is how to make the disk bootable. I've tried using installboot
> >and installing the boot code present in arch/macppc/stand, but without
> >success -- Open Firmware insists that the partition is not bootable.
> 
> # /usr/mdec/installboot /mnt/boot /usr/mdec/bootxx /dev/rsdXX  should work.
> 
> installboot writes boot block and *fake* Apple partition map entry for
> Open Firmware.

Maybe I'm just plain stupid, but I cannot get it working. I have succeeded to
make one disk bootable by copying a miniroot onto it while the machine was
running Linux/ppc.

With this disk, I can run NetBSD, and while running Linux/ppc, I can build
new NetBSD kernels which boot happily giving me a working single-user environment.

This was on a Conner disk (about 1280MB), and the fake label from the miniroot
looks like being generated on a 2GB Conner disk -- is this just coincidence ?

I have not succeeded to make my other disk bootable (and I have replaced the
105MB Syquest by a Quantum Maveric 270MB disk in case removables were a problem).

I have tried to run disklabel after copying the root image (from nandra) onto
it. This did not make it bootable as it did on the Conner disk. I have then
tried to install boot blocks with disklabel, but to no success.

I have also tried to start with the disk having no disklabel (by copying something
else onto it) and then using disklabel to create a new disklabel and then
running installboot, but still no boot... -- this was only possible with the
very recent fix to the kernel to allow writing a disklabel to a non-labelled 
disk.

Is there something magical about the Conner disks ?

I hate to ask this, but I'd really like a cookbook description, e.g.

     1. destroy the disklabel by copying something else to the start of the disk
     2. while running netbsd on the working disk, label the new disk by
        running disklabel -i sd1 and then creating a 4.2BSD a partition
     3. newfs /dev/rsd1a
     4. mount /dev/sd1a /mnt
     5. copy /netbsd and /boot to /mnt
     6. /stand/installboot -v /mnt/boot /stand/bootxx /dev/rsd1a
     7. umount /mnt and reboot

If this looks correct, my next request is to get a copy of a workinginstallboot, boot,
and bootxx in a personal mail message (not to the list :-) )

very confused, 
Erik Bertelsen