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