Home | History | Annotate | Line # | Download | only in sparc
install revision 1.10
      1 Installing NetBSD is a relatively complex process, but if you have
      2 this document in hand it shouldn't be too much trouble.
      3 
      4 There are several ways to install NetBSD onto a disk. If your Sparcstation
      5 is hooked up in a network you can find find a server and arrange for a
      6 diskless setup which is a convenient way to install on a machine with
      7 a single disk attached. Alternatively, you could use SunOS (booted from
      8 a local disk) and install NetBSD onto a second disk. For the latter method,
      9 skip to the section "Installing from SunOS" below.
     10 
     11 
     12 Installing using a diskless setup.
     13 
     14 First, you must setup a diskless client configuration on a server. If
     15 you are using a NetBSD system as the boot-server, have a look at the
     16 diskless(8) manual page for guidelines on how to proceed with this.
     17 If the server runs another operating system, you'll have to consult
     18 documentation that came with it (on SunOS systems, add_client(8) is a
     19 good start).
     20 
     21 Your Sparcstation expects to be able to download a second stage bootstrap
     22 program via TFTP after havinf acquired its IP address through RevARP when
     23 instructed to boot "over the net". It will look for a filename composed of
     24 the machine's IP address followed by the machine's architecture, separated
     25 by a period. For example, a sun4c machine which has been assigned IP
     26 address 130.115.144.11, will make an TFTP request for `8273900B.SUN4C'.
     27 Normally, this file is symbolic link to an appropriate second-stage
     28 boot program, which should be located in a place where the TFTP daemon
     29 can find it (remember, many TFTP daemons run in a chroot'ed environment).
     30 You can find the boot program in `/usr/mdec/boot' in the NetBSD/sparc
     31 distribution. Unfortunately, it is necessary to install this file
     32 differently for sun4 and sun4c/sun4m clients: the sun4 version needs to
     33 have its `a.out' header stripped off (otherwise the machine will crash),
     34 while the sun4c/sun4m version must retain it (otherwise the PROM will
     35 complain).
     36 
     37 Luckily, there is a script in /usr/mdec to do all this for you.  You only
     38 need to do this:
     39 
     40     server# cd /<client-root-dir>/usr/mdec
     41     server# ./binstall net /<client-root-dir>
     42 
     43 
     44 As noted above in the section `Preparing your System for NetBSD Installation',
     45 you have several options when choosing a location to store the installation
     46 filesets. However, the easiest way is to put the *.tar.gz files you want
     47 to install into the root directory for your client on the server.
     48 
     49 Next, unpack `base.tar.gz' and `etc.tar.gz' on the server in the root 
     50 directory for your machine. If you elect to use a separately NFS-mounted
     51 filesystem for `/usr' with your diskless setup, make sure the "./usr" base
     52 files in base.tar.gz end up in the correct location. One way to do this is
     53 to temporarily use a loopback mount on the server, re-routing <root>/usr to
     54 your server's exported NetBSD "/usr" directory. Also put the kernel and the
     55 install/upgrade scripts into the root directory.
     56 
     57 A few configuration files need to be edited:
     58 
     59 	<root>/etc/hosts
     60 		Add the IP addresses of both server and client.
     61 
     62 	<root>/etc/myname
     63 		This files contains the client's hostname; use the same
     64 		name as in <root>/etc/hosts.
     65 
     66 	<root>/etc/fstab
     67 		Enter the entries for the remotely mounted filesystems.
     68 		For example:
     69 			server:/export/root/client       /     nfs  rw 0 0
     70 			server:/export/exec/sun4.netbsd  /usr  nfs  rw 0 0
     71 
     72 Now you must populate the the `/dev' directory for your client. If you server
     73 runs SunOS 4.x, you can simply change your working directory to `<root>/dev'
     74 and run the MAKEDEV script: `sh MAKEDEV all'.
     75 
     76 On SunOS 5.x systems, MAKEDEV can also be used, but there'll be error
     77 messages about unknown user and groups. These errors are inconsequential
     78 for the purpose of installing NetBSD. However, you may want to correct them
     79 if you plan to the diskless setup regularly. In that case, you may re-run
     80 MAKEDEV on your NetBSD machine once it has booted.
     81 
     82 Boot your workstation from the server by entering the appropriate `boot'
     83 command at the monitor prompt. Depending on the PROM version in your machine,
     84 this command takes one of the following forms:
     85 
     86 	> b le()netbsd -s		# for sun4 monitors
     87 	ok boot le()netbsd -s		# for version 1 OpenBOOT ROMs
     88 	ok boot net netbsd -s		# for version 2 OpenBOOT ROMs
     89 
     90 This will boot the NetBSD kernel in single-user mode.
     91 
     92 [[
     93 NOTE: the latter two examples assume you operate the OpenBOOT ROM in
     94 "new command mode". If your machine comes up and gives you a `>' prompt
     95 instead of `ok', type:
     96 
     97     >n					# enter native OpenBOOT mode
     98     ok setenv sunmon-compat? false	# make it permanent
     99     ok
    100 ]]
    101 
    102 If you use a diskless setup with a separately NFS-mounted /usr filesystem,
    103 mount /usr by hand now:
    104 
    105 netbsd# mount /usr
    106 
    107 At this point, it's worth checking the disk label and partition sizes on
    108 the disk you want to install NetBSD onto. NetBSD understands SunOS-style
    109 disklabels, so if your disk was previously used by SunOS there will be
    110 a usable label on it. Use `disklabel -e <disk>' (where <disk> is the
    111 device name assigned by the NetBSD kernel, e.g. `sd0') to view and
    112 modify the partition sizes. A comfortable size for the root filesystem
    113 partition is about 20MB; a good initial size for the swap partition is
    114 twice the amount of physical memory in your machine (though, unlike
    115 SunOS 4.x, there are no restrictions on the size of the swap partition
    116 that would render part of your memory unusable). A full binary installation
    117 takes about 60MB in `/usr'. Make all your partitions start and end on
    118 cylinder boundaries.
    119 
    120 NOTE: if you are installing on a SCSI disk that does *not* have a SunOS
    121 or NetBSD label on it, you may still be able to use disklabel(8) but you'll
    122 have to create all partitions from scratch. If your disk is listed in
    123 `/etc/disktab', you may use the entry (which in most cases only defines
    124 a `c' partition to describe the whole disk) to put an initial label on
    125 the disk.
    126 
    127 Here follows an example of what you'll see while in the dislabel editor.
    128 Do not touch any of the parameters except for the `label: ' entry and
    129 the actual partition size information at the bottom (the lines starting
    130 with `a:', `b:', ...).
    131 
    132 The size and offset fields are given in sector units. Be sure to make
    133 these numbers multiples of the of the number of sectors per cylinder:
    134 the kernel might be picky about these things, but aside from this you'll
    135 have the least chance of wasting disk space.
    136 Partitions on which you intend to have a a mountable filesystem, should
    137 be given fstype `4.2BSD'. Remember, the `c' partition should describe
    138 the whole disk.
    139 The `(Cyl. x - y)' info that appears after the hash (`#') character is
    140 treated as a comment and need not be filled in when altering partitions.
    141 
    142 Special note: the line containing `8 partitions:' is best left alone,
    143 even if you define less then eight partitions. If this line displays
    144 a different number and the program complains about it (after you leave
    145 the editor), then try setting it to `8 partitions:'.
    146 
    147 
    148 <BEGIN SAMPLE DISKLABEL SCREEN>
    149 netbsd# disklabel sd2
    150  # /dev/rsd2c:
    151 type: SCSI 
    152 disk: SCSI disk
    153 label: Hold Your Breath
    154 flags:
    155 bytes/sector: 512
    156 sectors/track: 64
    157 tracks/cylinder: 7  
    158 sectors/cylinder: 448
    159 cylinders: 1429
    160 rpm: 3600
    161 interleave: 1
    162 trackskew: 0
    163 cylinderskew: 0
    164 headswitch: 0           # milliseconds
    165 track-to-track seek: 0  # milliseconds
    166 drivedata: 0
    167 
    168 8 partitions:
    169 #        size   offset    fstype   [fsize bsize   cpg]
    170   a:    50176        0    4.2BSD        0     0     0   # (Cyl.    0 - 111)
    171   b:    64512    50176      swap                        # (Cyl.  112 - 255)
    172   c:   640192        0   unknown                        # (Cyl.    0 - 1428)
    173   d:   525504   114688    4.2BSD        0     0     0   # (Cyl.  256 - 1428)
    174 <END SAMPLE DISKLABEL SCREEN>
    175 
    176 
    177 If you are upgrading a NetBSD installation, start the upgrade script:
    178 
    179 netbsd# sh upgrade.sh
    180 
    181 else, start the installation script:
    182 
    183 netbsd# sh install.sh
    184 
    185 
    186 These scripts will do most of the work of transferring the system from the
    187 tar files onto your disk. You will frequently be asked for confirmation
    188 before the script proceeds with each phase of the installation process.
    189 Occasionally, you'll have to provide a piece of information such as the
    190 name of the disk you want to install on or IP addresses and domain names
    191 you want to assign. If your system has more than one disk, you may want
    192 to look at the output of the dmesg(8) command to see how your disks
    193 have been identified by the kernel.
    194 
    195 The installation script goes through the following phases:
    196 
    197 	- determination of the disk to install NetBSD on
    198 	- checking of the partition information on the disk
    199 	- creating and mounting the NetBSD filesystems
    200 	- setup of IP configuration
    201 	- extraction of the distribution tar files
    202 	- installation of boot programs
    203 
    204 
    205 Now try a reboot.  (If needed, swap your scsi id's first).  Initially
    206 I'd suggest you "boot sd()netbsd -bs", then try multiuser after that.
    207 if you boot single-user the NetBSD incantation to make the root
    208 filesystem writable is
    209 
    210     netbsd# mount -u /dev/sd0a /
    211 
    212 The Sun monitor normally tries to load a file called "vmunix". On
    213 OpenBOOT ROM systems you can change it to load NetBSD instead using
    214 the following commands:
    215 
    216 On version 1 OpenBOOT ROMs:
    217     >n
    218     ok setenv boot-from sd(0,0,0)netbsd
    219     ok
    220 
    221 On version 2 OpenBOOT ROMs:
    222     ok setenv boot-file netbsd
    223     ok setenv boot-device /sbus/esp/sd@0,0
    224 
    225 
    226 Congratulations, you have successfully installed NetBSD RELEASE.  When you
    227 reboot into NetBSD, you should log in as "root" at the login prompt.
    228 There is no initial password, but if you're using the machine in a
    229 networked environment, you should create yourself an account and
    230 protect it and the "root" account with good passwords.
    231 
    232 Some of the files in the NetBSD RELEASE distribution might need to be
    233 tailored for your site.  In particular, the /etc/sendmail.cf file will
    234 almost definitely need to be adjusted, and other files in /etc will
    235 probably need to be modified.  If you are unfamiliar with UN*X-like
    236 system administration, it's recommended that you buy a book that
    237 discusses it.
    238 
    239 
    240 
    241 Installing from SunOS.
    242 
    243 You need a SunOS machine to install NetBSD.  You also need at
    244 least the following pieces:
    245 
    246     the *.tar.gz files you want to install (as a minimum, base.tar.gz)
    247     gzip (GNU gzip) SunOS binary
    248     gtar (GNU tar) SunOS binary
    249     the "install.sh" script
    250     a "/boot" file from a SunOS machine that matches your machine type
    251 	(e.g. sun4 for sun4 server, sun4c and sun4m for these)
    252     a kernel, most likely "/netbsd"
    253 
    254 All these pieces, except "/boot", are supplied in the NetBSD/sparc
    255 distribution.
    256 
    257 You can format and partition the disk using SunOS (since
    258 NetBSD/sparc uses SunOS disk labels.)  Give yourself adequate
    259 partition sizes.  Here is an example layout:
    260 
    261     partition    size   offset	  will be..
    262     sd2a        28140        0	  /
    263     sd2b        16170    28140	  swap
    264     sd2c       204540        0	  `whole disk'
    265     sd2g       160230    44310	  /usr
    266 
    267 BTW, These are not recommended sizes.  They simply match the first
    268 (tiny) disk that NetBSD/sparc ran on.
    269 
    270 Use SunOS to newfs the partitions which will have filesystems on them.
    271 (NetBSD's filesystem format is identical to SunOS).
    272 
    273     sunos# newfs /dev/rsd2a
    274     [... lots of output]
    275     sunos# newfs /dev/rsd2g
    276     [... lots of output]
    277 
    278 NOTE: If you are able to, there is a performance benefit from
    279 newfs'ing using NetBSD.  If you newfs using the NetBSD newfs command,
    280 be sure to use the -O flag for your / partition, so that newfs will
    281 use the 4.3BSD filesystem format, rather than the new 4.4BSD filesystem
    282 format.  If you forget, you will not be able to boot -- the SunOS boot
    283 blocks do not understand the extended 4.4BSD filesystem format.
    284 
    285 Mount those partitions in a tree formation, under /mnt; ie:
    286 
    287     sunos# df
    288     Filesystem            kbytes    used   avail capacity  Mounted on
    289     [...]
    290     /dev/sd2a              11501       0   11501     0%    /mnt
    291     /dev/sd2g             179529       0  179529     0%    /mnt/usr
    292 
    293 Place a standard SunOS "/boot" program in /mnt (your new root
    294 partition), and use the SunOS command "installboot" to make it work.
    295 The installboot man page says to do something like this:
    296 
    297     sunos# cp /boot /mnt/boot
    298     sunos# /usr/mdec/installboot -vlt /mnt/boot /usr/mdec/bootsd /dev/rsd2a
    299 
    300 You can now extract the provided "*.tar.gz files onto your disk.  The
    301 provided script, "install_from_sunos.sh" will help you:
    302 
    303     sunos# ls -FC
    304     base.tar.gz      etc.tar.gz       man.tar.gz       secr.tar.gz
    305     comp.tar.gz      games.tar.gz     misc.tar.gz      text.tar.gz
    306     install.sh       netbsd.id3_scsi
    307     sunos# ./install_from_sunos.sh
    308     [...]
    309 
    310 This script NEEDS gzip and gtar (GNU gzip and GNU tar) on your
    311 execution path!  The tar files are in a "new format" that includes
    312 directory information, and SunOS tar will not read them.  Statically
    313 linked versions of these programs for SunOS are supplied in the
    314 distribution.
    315 
    316 After the files have been extracted, repair /mnt/etc/fstab to match
    317 your actual disk layout.  (Minus the "/mnt" component of each path, of
    318 course :-)
    319 
    320 Now proceed to reboot the machine as described above in "Installing
    321 using a diskless setup".
    322