NetBSD/distrib/notes/sparc/install

466 lines
17 KiB
Plaintext
Raw Normal View History

.\" $NetBSD: install,v 1.29 2000/10/10 12:55:22 lukem Exp $
1999-01-13 10:30:01 +03:00
.\"
.\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
1999-01-13 10:30:01 +03:00
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the NetBSD
.\" Foundation, Inc. and its contributors.
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.
Installing
.Nx
is a relatively complex process, but if you have
1994-10-25 09:48:14 +03:00
this document in hand it shouldn't be too much trouble.
1999-01-13 10:30:01 +03:00
.Pp
.Nx*M
has two installation systems, an easy to use 'sysinst',
and a more flexible miniroot script based system.
.Pp
There are several ways to install
.Nx
onto a disk. The easiest way is to use the 'syboot.fs' image copied to
a floppy or your local disk's swap partition.
More advanced users may prefer booting the
.Nx
miniroot from the local disk's swap partition.
Alternatively, if your Sparcstation is hooked up in a network you
can find a server and arrange for a diskless setup which is a
convenient way to install on a machine whose disk does not currently
hold a usable operating system (see the section `Installing
.Nx
by using a diskless setup' below). There is
also a bootable 1.44 MB floppy available that contains a slightly less
featureful miniroot environment.
1999-01-13 10:30:01 +03:00
.
.Ss2 Installing NetBSD by using the NetBSD miniroot
1999-01-13 10:30:01 +03:00
.
If you wish to use the more flexible 'miniroot.fs', use in place
of 'syboot.fs' below.
.Pp
The miniroot is a self-contained
.Nx
filesystem holding all utilities
necessary to install
.Nx
on a local disk. It is distributed as a plain
1996-10-16 03:29:40 +04:00
file designed to be transferred to a raw disk partition from which it can
be booted using the appropriate PROM command. Usually, the miniroot will
be loaded into the swap partition of a disk. If needed, you can use any
other unused partition, but remember that in the case of 'miniroot.fs'
the partition will then not available during the installation process.
1999-01-13 10:30:01 +03:00
.Pp
Loading the miniroot onto your raw partition is simple. On
.Nx
as well as SunOS you use a command like:
.Dl # Ic dd if=syboot.fs of=/dev/rsd0b bs=4k conv=sync
1999-01-13 10:30:01 +03:00
(Here, `/dev/rsd0b' is assumed to be your swap partition.) There's a
1996-10-16 03:29:40 +04:00
potential problem here if /dev/rsd0b is actually in use as a swap
partition by your currently running system. If you don't have another
disk or partition to spare, you can usually get away with running this
command anyway after first booting into single-user mode to ensure a
quiet system.
1999-01-13 10:30:01 +03:00
.Pp
1996-10-16 03:29:40 +04:00
After transferring the miniroot to disk, bring the system down by:
1999-01-13 10:30:01 +03:00
.Dl # Ic halt
.Pp
1996-10-16 03:29:40 +04:00
Then boot the miniroot by typing the appropriate command at the PROM:
1999-01-13 10:30:01 +03:00
.Dl \*> Ic "b sd(,,1)netbsd -s # for sun4 monitors
.Dl ok Ic "boot sd(,,1)netbsd -s # for version 1 OpenBOOT ROMs
.Dl ok Ic "boot disk:b netbsd -s # for version 2 OpenBOOT ROMs
.Pp
1996-10-16 03:29:40 +04:00
If you've loaded the miniroot onto some other disk than `sd0' adapt
the boot specifier accordingly, e.g.:
1999-01-13 10:30:01 +03:00
.Dl ok Ic boot disk1:b netbsd -s
1996-10-16 03:29:40 +04:00
to boot from SCSI disk target 1 from a version 2 OpenBOOT ROM.
1999-01-13 10:30:01 +03:00
If you have to use the old-style
.Ic sd( Ns Ar c,u,p Ns Ic \&)
syntax to boot from a
SCSI disk, you can calculate the parameters as follows:
.(tag xcc
.It Ar c
1999-01-13 10:30:01 +03:00
specifies the controller number
.It Ar u
1999-01-13 10:30:01 +03:00
the hexadecimal number obtained from evaluating
the expression `(8 * TARGET) + LUN'
.It Ar p
1999-01-13 10:30:01 +03:00
the partition number from which to boot (0=`a', 1=`b', etc).
.tag)
1999-01-13 10:30:01 +03:00
.Pp
The monitor boot command will cause the
.Nx
kernel contained in the
miniroot image to be booted. After the initial probe messages you'll be
asked to start the install or upgrade procedure. Proceed to the section
.Sx Running the installation scripts.
1999-01-13 10:30:01 +03:00
below.
.
.Ss2 Installing NetBSD by using the bootable floppy
.
The
.Nx
install floppy works only on the sun4c and sun4m class.
Making the install floppy is simple:
.Pp
If you wish to use the more flexible 'boot.fs', use in place
of 'syboot.fs' below.
.Pp
On
.Nx
2000-09-26 18:11:02 +04:00
as well as SunOS you use the following three commands:
.Dl # Ic "fdformat"
2000-09-26 18:11:02 +04:00
.Dl # Ic "gunzip syboot.fs.gz"
.Dl # Ic "dd if=syboot.fs of=/dev/rfd0a bs=36k"
(Be sure that the `fdformat' command completes successfully before proceeding
to the `dd' step; on
.Nx
, a string of all `V's, and on SunOS, a string of
all `.'s.).
.Pp
On a Windows system you can use the
.Nm rawrite.exe
command provided with the NetBSD/i386 install tools.
.Pp
From the OpenBOOT prompt, the following should boot the floppy.
.Dl ok Ic "boot fd(,,1) # Version 1 OpenBOOT ROMs
.Dl ok Ic "boot /fd # or
.Dl ok Ic "boot floppy # Version 2 OpenBOOT ROMs
.Pp
After the initial probe messages you'll be asked to start
the install or upgrade procedure. Proceed to the section
.Sx Running the installation scripts.
below.
.
.Ss2 Installing NetBSD by using a diskless setup
1999-01-13 10:30:01 +03:00
.
1995-11-17 01:54:47 +03:00
First, you must setup a diskless client configuration on a server. If
you are using a
.Nx
system as the boot-server, have a look at the
1999-01-13 10:30:01 +03:00
.Xr diskless 8
manual page for guidelines on how to proceed with this.
1995-11-17 01:54:47 +03:00
If the server runs another operating system, you'll have to consult
1999-01-13 10:30:01 +03:00
documentation that came with it. (On SunOS systems, add_client(8) is a
good start.)
.Pp
1995-11-30 02:51:24 +03:00
Your Sparcstation expects to be able to download a second stage bootstrap
1996-10-16 03:29:40 +04:00
program via TFTP after having acquired its IP address through RevARP when
1995-11-30 02:51:24 +03:00
instructed to boot "over the net". It will look for a filename composed of
the machine's IP address followed by the machine's architecture, separated
by a period. For example, a sun4c machine which has been assigned IP
address 130.115.144.11, will make an TFTP request for `8273900B.SUN4C'.
1996-10-16 03:29:40 +04:00
Normally, this file is a symbolic link to an appropriate second-stage
1995-11-30 02:51:24 +03:00
boot program, which should be located in a place where the TFTP daemon
can find it (remember, many TFTP daemons run in a chroot'ed environment).
1999-01-13 10:30:01 +03:00
You can find the boot program in
.Pa /usr/mdec/boot.net
in the
.Nx*M
distribution.
1999-01-13 10:30:01 +03:00
.(Note
The only difference between
.Pa /usr/mdec/boot.net No and Pa /usr/mdec/boot
is in the a.out header, which has been magically
transformed in a way that makes it usable on all versions of Sparc PROMs.
.Note)
.Pp
1996-10-16 03:29:40 +04:00
After the boot program has been loaded into memory and given control by
the PROM, it starts locating the machine's remote root directory through
the BOOTPARAM protocol. First a BOOTPARAM WHOAMI request is broadcast
on the local net. The answer to this request (if it comes in) contains
the client's name. This name is used in next step, a BOOTPARAM GETFILE
request -- sent to the server that responded to the WHOAMI request --
requesting the name and address of the machine that will serve the client's
root directory, as well as the path of the client's root on that server.
1999-01-13 10:30:01 +03:00
.Pp
1996-10-16 03:29:40 +04:00
Finally, this information (if it comes in) is used to issue a REMOTE MOUNT
request to the client's root filesystem server, asking for an NFS file
handle corresponding to the root filesystem. If successful, the boot
program starts reading from the remote root filesystem in search of the
kernel which is then read into memory.
1999-01-13 10:30:01 +03:00
.Pp
As noted above in the section
.Pa Preparing your System for NetBSD Installation
1995-11-17 01:54:47 +03:00
you have several options when choosing a location to store the installation
1999-01-13 10:30:01 +03:00
filesets. However, the easiest way is to put the
.Pa *.tar.gz
files you want
1995-11-17 01:54:47 +03:00
to install into the root directory for your client on the server.
1999-01-13 10:30:01 +03:00
.Pp
Next you must select whether to use the easier 'sysinst' or more flexible
script based install.
.
.Ss2 Diskless sysinst installation
.
Follow this section and skip the next if you wish to use the easier 'sysinst'
installation method.
.Pp
Copy the installation/netboot/netbsd.syram.gz image into the exported
root directory for your machine, then boot your workstation from the
server by entering the appropriate `boot' command at the monitor prompt.
Depending on the PROM version in your machine, this command takes one of
the following forms:
.Dl "\*> b le()netbsd.syram.gz # for sun4 monitors
.Dl "ok boot le()netbsd.syram.gz # for version 1 OpenBOOT ROMs
.Dl "ok boot net netbsd.syram.gz # for version 2 OpenBOOT ROMs
.Pp
This will boot the
.Nx
kernel in single-user mode.
.(Note
The latter two examples assume you operate the OpenBOOT ROM in
"new command mode". If your machine comes up and gives you a `\*>' prompt
instead of `ok', type:
.Dl "\*>n # enter native OpenBOOT mode
.Dl "ok setenv sunmon-compat? false # make it permanent
.Dl "ok
.Note)
.
.Ss2 Diskless script installation
.
Follow this section and skip the previous if you wish to use the more
flexible 'miniroot' script installation method.
.Pp
Unpack `base.tar.gz', `etc.tar.gz', and 'kern.tgz' on the server in
2000-08-22 17:44:45 +04:00
the root directory for your machine. If you elect to use a separately
NFS-mounted filesystem for `/usr' with your diskless setup, make sure the
"./usr" base files in base.tar.gz end up in the correct location. One way
to do this is to temporarily use a loopback mount on the server, re-routing
1999-01-13 10:30:01 +03:00
.Ar root Ns Pa /usr
to your server's exported
.Nx
1999-01-13 10:30:01 +03:00
.Pa /usr
2000-08-22 17:44:45 +04:00
directory. Also put 'install.*' and 'upgrade.sh' from the
.Pa installation/netboot/
directory into the root directory.
1999-01-13 10:30:01 +03:00
.Pp
1995-10-08 05:05:46 +03:00
A few configuration files need to be edited:
.(tag indent
.It Ar root Ns Pa /etc/hosts
1999-01-13 10:30:01 +03:00
Add the IP addresses of both server and client.
.It Ar root Ns Pa /etc/myname
1999-01-13 10:30:01 +03:00
This files contains the client's hostname; use the same
name as in \*<root\*>/etc/hosts.
.It Ar root Ns Pa /etc/fstab
1999-01-13 10:30:01 +03:00
Enter the entries for the remotely mounted filesystems.
For example:
.Dl server:/export/root/client / nfs rw 0 0
.Dl server:/export/exec/sun4.netbsd /usr nfs rw 0 0
.tag)
1999-01-13 10:30:01 +03:00
.Pp
2000-08-22 17:44:45 +04:00
Now you must populate the `/dev' directory for your client. If your server
1999-01-13 10:30:01 +03:00
runs SunOS 4.x, you can simply change your working directory to
.Ar root Ns Pa /dev
and run the MAKEDEV script:
.Ic sh MAKEDEV all .
.Pp
1995-10-20 04:55:38 +03:00
On SunOS 5.x systems, MAKEDEV can also be used, but there'll be error
messages about unknown user and groups. These errors are inconsequential
for the purpose of installing
.Nx .
However, you may want to correct them
1996-10-16 03:29:40 +04:00
if you plan to use the diskless setup regularly. In that case, you may re-run
MAKEDEV on your
.Nx
machine once it has booted.
1999-01-13 10:30:01 +03:00
.Pp
1995-10-08 05:05:46 +03:00
Boot your workstation from the server by entering the appropriate `boot'
command at the monitor prompt. Depending on the PROM version in your machine,
this command takes one of the following forms:
1999-01-13 10:30:01 +03:00
.Dl "\*> b le()netbsd -s # for sun4 monitors
.Dl "ok boot le()netbsd -s # for version 1 OpenBOOT ROMs
.Dl "ok boot net netbsd -s # for version 2 OpenBOOT ROMs
.Pp
This will boot the
.Nx
kernel in single-user mode.
1999-01-13 10:30:01 +03:00
.(Note
The latter two examples assume you operate the OpenBOOT ROM in
"new command mode". If your machine comes up and gives you a `\*>' prompt
1995-10-08 05:05:46 +03:00
instead of `ok', type:
1999-01-13 10:30:01 +03:00
.Dl "\*>n # enter native OpenBOOT mode
.Dl "ok setenv sunmon-compat? false # make it permanent
.Dl "ok
.Note)
.Pp
1995-10-20 04:55:38 +03:00
If you use a diskless setup with a separately NFS-mounted /usr filesystem,
1999-01-13 10:30:01 +03:00
mount
.Pa /usr
by hand now:
.Dl netbsd# Ic mount /usr
.Pp
.(Note
For floppy installs, the text editor provided is ed.
For miniroot installs, the text editor is vi.
.Note)
.Pp
1999-06-27 15:24:35 +04:00
When using
.Xr disklabel 8
to edit disklabels the -e switch will invoke the editor on the
label. The -i switch will run an interactive session.
.Pp
1995-10-31 00:19:42 +03:00
At this point, it's worth checking the disk label and partition sizes on
the disk you want to install
.Nx
onto.
.Nx
understands SunOS-style
1995-10-31 00:19:42 +03:00
disklabels, so if your disk was previously used by SunOS there will be
1999-06-27 15:24:35 +04:00
a usable label on it. Use `disklabel -e \*<disk\*>' or `disklabel -i
\*<disk\*>' (where \*<disk\*> is the device name assigned by the
.Nx
kernel, e.g. `sd0') to view and modify the partition sizes. See
the section
1999-01-13 10:30:01 +03:00
.Sx Preparing your System for NetBSD Installation
above for suggestions about disk partition sizes.
.Pp
If you are installing on a SCSI disk that does
.Em not
have a SunOS or
.Nx
label on it, you may still be able to use disklabel(8) but you'll
1995-10-31 00:19:42 +03:00
have to create all partitions from scratch. If your disk is listed in
`/etc/disktab', you may use the entry (which in most cases only defines
a `c' partition to describe the whole disk) to put an initial label on
1999-06-27 15:24:35 +04:00
the disk. Then proceed with `disklabel -e \*<disk\*>' or `disklabel -i
\*<disk\*>' to create a partition layout that suits your needs.
1999-01-13 10:30:01 +03:00
.(Note
Because of the built-in compatibility with SunOS-style labels,
.Em Always make sure all your partitions
.Em start and end on cylinder boundaries.
.Note)
.Pp
1995-11-17 01:54:47 +03:00
Here follows an example of what you'll see while in the dislabel editor.
Do not touch any of the parameters except for the `label: ' entry and
the actual partition size information at the bottom (the lines starting
with `a:', `b:', ...).
1999-01-13 10:30:01 +03:00
.Pp
1995-11-17 01:54:47 +03:00
The size and offset fields are given in sector units. Be sure to make
these numbers multiples of the of the number of sectors per cylinder:
the kernel might be picky about these things, but aside from this you'll
have the least chance of wasting disk space.
1996-10-16 03:29:40 +04:00
Partitions on which you intend to have a mountable filesystem, should
1995-11-17 01:54:47 +03:00
be given fstype `4.2BSD'. Remember, the `c' partition should describe
the whole disk.
The `(Cyl. x - y)' info that appears after the hash (`#') character is
treated as a comment and need not be filled in when altering partitions.
1999-01-13 10:30:01 +03:00
.(Note
The line containing `8 partitions:' is best left alone,
1995-11-17 01:54:47 +03:00
even if you define less then eight partitions. If this line displays
a different number and the program complains about it (after you leave
the editor), then try setting it to `8 partitions:'.
1999-01-13 10:30:01 +03:00
.Note)
.
.Ss2 Sample disklabel screen
.(disp
1995-11-17 01:54:47 +03:00
netbsd# disklabel sd2
# /dev/rsd2c:
type: SCSI
1995-11-17 01:54:47 +03:00
disk: SCSI disk
label: Hold Your Breath
flags:
bytes/sector: 512
sectors/track: 64
tracks/cylinder: 7
1995-11-17 01:54:47 +03:00
sectors/cylinder: 448
cylinders: 1429
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # milliseconds
track-to-track seek: 0 # milliseconds
drivedata: 0
8 partitions:
1999-01-13 10:30:01 +03:00
# size offset fstype [fsz bsz cpg]
a: 50176 0 4.2BSD 0 0 0 # (Cyl. 0 - 111)
b: 64512 50176 swap # (Cyl. 112 - 255)
c: 640192 0 unknown # (Cyl. 0 - 1428)
d: 525504 114688 4.2BSD 0 0 0 # (Cyl. 256 - 1428)
.disp)
1999-01-13 10:30:01 +03:00
.Pp
If you are upgrading a
.Nx
installation, start the upgrade script:
1999-01-13 10:30:01 +03:00
.Dl netbsd# Ic sh upgrade.sh
1995-11-17 01:54:47 +03:00
else, start the installation script:
1999-01-13 10:30:01 +03:00
.Dl netbsd# Ic sh install.sh
.
.Ss2 Running the installation scripts
1999-01-13 10:30:01 +03:00
.
The installation system will do most of the work of transferring the
1996-10-16 03:29:40 +04:00
system from the distribution sets onto your disk. You will frequently be
asked for confirmation before the system proceeds with each phase of the
1996-10-16 03:29:40 +04:00
installation process.
1999-01-13 10:30:01 +03:00
.Pp
Occasionally, you will have to provide a piece of information such as the
1995-10-08 05:05:46 +03:00
name of the disk you want to install on or IP addresses and domain names
1995-11-17 01:54:47 +03:00
you want to assign. If your system has more than one disk, you may want
to look at the output of the dmesg(8) command to see how your disks
have been identified by the kernel.
1999-01-13 10:30:01 +03:00
.Pp
1995-10-08 05:05:46 +03:00
The installation script goes through the following phases:
.(bullet -compact
determination of the disk on to install
.Nx
.It
checking of the partition information on the disk
.It
creating and mounting the
.Nx
filesystems
.It
setup of IP configuration
.It
extraction of the distribution tar files
.It
installation of boot programs
.bullet)
1999-01-13 10:30:01 +03:00
.Pp
1996-10-16 03:29:40 +04:00
Now try a reboot. Initially I'd suggest you "boot sd()netbsd -bs", then
try multiuser after that. If you boot single-user the
.Nx
incantation to make the root filesystem writable is
1999-01-13 10:30:01 +03:00
.Dl netbsd# Ic mount -u /dev/sd0a /
1996-10-16 03:29:40 +04:00
The Sun monitor might have been setup to instruct the boot program to load
a file called "vmunix". On OpenBOOT ROM systems you can change it to load
"netbsd" instead using the following commands:
1999-01-13 10:30:01 +03:00
.Pp
1995-10-08 05:05:46 +03:00
On version 1 OpenBOOT ROMs:
1999-01-13 10:30:01 +03:00
.Dl \*>n
.Dl ok Ic setenv boot-from sd(0,0,0)netbsd
.Dl ok
.Pp
1995-10-08 05:05:46 +03:00
On version 2 OpenBOOT ROMs:
1999-01-13 10:30:01 +03:00
.Dl ok Ic setenv boot-file netbsd
.Dl ok Ic setenv boot-device /sbus/esp/sd@0,0
.Pp
.Em Congratulations ,
you have successfully installed
.Nx \*V.