Subject: Re: Cannot boot from hard drive
To: Marco <marcotrillo@gmail.com>
From: Iain Dooley <iain@iaindooley.com>
List: port-macppc
Date: 08/13/2006 10:41:26
On Wed, 5 Jul 2006, Marco wrote:

> Hi,
>
> Use pdisk from the installation CD to create the bootstrap partition (
> and the NetBSD partitions ).
>
> See this document:
> http://www.netbsd.org/Ports/macppc/partitioning.html#pdisk
> for an overview of using pdisk.
>
> In example ( for a 50MB size ) :
>
> Command (? for help): C
> First block: 2p
> Length in blocks: 50m
> Name of partition: boot
> Type of partition: Apple_HFS
> Command (? for help):

okay, now i understand, i should use pdisk _before_ installing, then 
install without touching the partions. that's fine, but when i try to make 
a partition with pdisk by doing:

boot cd:,\ofwboot.xcf macppc\binary\kernel\netbsd-GENERIC_MD.gz
pdisk /dev/wd0a

then following the procedure above (and here 
http://www.netbsd.org/Ports/macppc/partitioning.html#pdisk) i get the 
error:

the map is not big enough

p prints out:

1: Apple_partition_map Apple    2 @ 1
2:Apple_Free*Extra          10807961 (5.2G)

so it's obviously huge, but for some reason i just can't create the 
partition.

cheers

iain

>
> The first time you boot into NetBSD after installing you should use
> the "ofwboot.xcf" which comes with the CD:
>
> 0> boot cd:,\macppc\ofwboot.xcf hd:3,/netbsd
>
> Then you need to install the "hfsutils" to format the partition.
> They're available in NetBSD pkgsrc & packages.
>
> Find the HFS partition:
> # disklabel wd0
>
> Format the HFS partition
> # hformat /dev/wd0X
>
> Mount the HFS partition
> # hmount /dev/wd0X
>
> Copy the ofwboot.xcf file:
> # hcopy ofwboot.xcf :
>
> Unmount the HFS partition
> # humount /dev/wd0X
>
> Then you can boot from the HD with a command like this:
>
> 0> boot hd:2,ofwboot.xcf hd:3,/netbsd
>
> If you want to auto-boot NetBSD :
>
> 0> setenv boot-device hd:2,\ofwboot.xcf
> 0> setenv boot-file hd:3,/netbsd
> 0> setenv boot-command " screen" output boot
> 0> setenv auto-boot? true
> 0> reset-all
>
> Hope it helps.
>
> - Marco
>
>
> The
> On 7/5/06, Iain Dooley <iain@iaindooley.com> wrote:
>> hello again,
>> 
>> On Sun, 2 Jul 2006, Marco wrote:
>> 
>> > Hi,
>> >
>> > If you want to be able to boot from the hard drive you need to create
>> > a small bootstrap partition to host the `ofwboot.xcf' file.
>> > That partition need to be on a file system that OpenFirmware
>> > understands; such as HFS, HFS+, etc (not FFS).
>> >
>> > If you have Mac OS installed, you can use the Mac OS partition.
>> 
>> i have already installed NetBSD on the hard drive, now when i try to boot
>> without open firmware, i just get a flashing question mark icon.
>> 
>> reading this section of the install guide (which i apparently completely
>> disregarded the first time through :-S !!):
>> 
>> http://ftp.netbsd.org/pub/NetBSD-daily/netbsd-3-0/200605220000Z/macppc/INSTALL.html#Partitioning%20your%20hard%20drive%20for%20NetBSD
>> 
>> i see that i am able to create these partitions using pdisk. i presume i'm
>> able to do this by booting into the shell from the cd.
>> 
>> i gave it a go, but was a big confused. i deleted existing partitions and
>> tried to make a new one at base 4, 200 blocks long (200 blocks being
>> 100x1024/512 for the HFS partition) but it told me that the partition was
>> not big enough, however it is some 30,000 blocks long.
>> 
>> can anyone tell me the set of commands to use to create these partitions
>> and copy ofwboot.xcf in there from the cd?
>> 
>> cheers
>> 
>> iain
>> 
>> 
>> 
>> > Once you have created this partition, you`ll have a partition map like
>> this:
>> >
>> > # pdisk /dev/wd0c
>> > Edit /dev/wd0c -
>> > Command (? for help): p
>> >
>> > Partition map (with 512 byte blocks) on '/dev/wd0c'
>> > #:                type name     length   base     ( size )
>> > 1: Apple_partition_map Apple        63 @ 1
>> > 2:           Apple_HFS boot     262144 @ 64       (128.0M)
>> > 3:     Apple_UNIX_SVR2 root    4194304 @ 262208   (  2.0G) S0 RUFS k0  /
>> > [...]
>> >
>> > In this example the boot partition is number 2 and the root partiton
>> > is number 3.
>> >
>> > Then the OF command used should be like this one:
>> >
>> > 0> boot hd:2,\ofwboot.xcf hd:3,/netbsd
>> >
>> > Notice that "/netbsd" is the path to the kernel image you want to boot.
>> >
>> >
>> > -Marco
>> >
>> > On 7/2/06, Iain Dooley <iain@iaindooley.com> wrote:
>> >>
>> >> On Sun, 2 Jul 2006, Marco wrote:
>> >>
>> >> > Hi,
>> >> >
>> >> > What error you got when using the commands ?
>> >> .
>> >> > The "hd" alias should work fine for the internal hard drive...
>> >> >
>> >> > In example, if 2 is the number of the ofwboot.xcf partition and 3 is
>> >> > the number of the root partition where the kernel lives, a command
>> >> > like this should work ok :
>> >> >
>> >> > boot hd:2,\ofwboot.xcf hd:3,/netbsd
>> >> >
>> >> > (you can use pdisk to get the numbers)
>> >>
>> >> i booted back into netbsd using:
>> >>
>> >> boot cd:,\ofwboot.xcf macppc\binary\kernel\netbsd-GENERIC_MD.gz
>> >>
>> >> and then did:
>> >>
>> >> ls /dev/
>> >>
>> >> to find that i have several wd0 slices a-p (wd0 is where netbsd
>> >> installed). i tried:
>> >>
>> >> pdisk -l /dev/wd[a-p] #issuing separate commands for each slice
>> >>
>> >> only wd0a and wd0c had listings, and they appear to be identical (i've
>> >> reproduced this manually so excuse me if it's a little messy):
>> >>
>> >> #      type            name       length     base      (size)
>> >> 1: Apple_partition_map Apple           2  @   1
>> >> 2: NetBSD/macppc*      NetBSD 2147483647  @   4        (1024.0G)
>> >>
>> >> 1024G!! what a great laptop ;-) now if i reboot into OFW, i tried:
>> >>
>> >> boot hd:0,\ofwboot.xcf hd:2,\NetBSD\macppc
>> >> boot hd:0,\ofwboot.xcf hd:2,/NetBSD/macppc
>> >> boot hd:0,\ofwboot.xcf hd:2,\NetBSD
>> >> boot hd:0,\ofwboot.xcf hd:2,/NetBSD
>> >>
>> >> the the same with hd:1 for the second partition. the error i get is:
>> >>
>> >> DISK-LABEL: LOAD (noninterposed) not supportedload-size=0 adler32=1
>> >>
>> >> LOAD-SIZE is too small
>> >>   ok
>> >> >
>> >>
>> >> i tried partitions [0-9] for the first argument, ie:
>> >>
>> >> boot hd:1,\ofwboot.xcf ...
>> >>
>> >> etc. but in all cases i get the error:
>> >>
>> >> MAC-PARTS: specified partition is not valid can't OPEN: hd:1,ofwboot.xcf
>> >>
>> >> any clues?
>> >>
>> >> cheers
>> >>
>> >> iain
>> >>
>> >> > -Marco
>> >> >
>> >> > On 7/2/06, Iain Dooley <iain@iaindooley.com> wrote:
>> >> >> Hi, i've succesfully installed netbsd 3.0 on an ibook. This section:
>> >> >>
>> >> >>
>> >>
>> http://ftp.netbsd.org/pub/NetBSD-daily/netbsd-3-0/200605220000Z/macppc/INSTALL.html#Examples%20of%20Open%20Firmware%20boot%20commands
>> >> >>
>> >> >> shows some typical boot commands, but none of them appear to work. i
>> >> can't
>> >> >> boot from the hard drive. when i do devalias there is hd, ide0, ide1,
>> >> >> ultra0, ultra1, scsi... all these are used in various ways in the
>> >> >> examples, but i can't seem to use dir to get a listing and i don't
>> know
>> >> >> how to find out which of these i should use.
>> >> >>
>> >> >> if it's any help, netbsd installed on something called wd0.
>> >> >>
>> >> >> cheers
>> >> >>
>> >> >> iain
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> >
>> >> >
>> >>
>> >
>> >
>> > --
>> > --------------------------------------------------------------
>> > Marco Trillo
>> > marcotrillo@gmail.com
>> > marco@artemis.tmdel.ath.cx
>> > http://artemis.tmdel.ath.cx/
>> >
>> >
>> 
>
>