Home | History | Annotate | Line # | Download | only in mvme68k
install revision 1.3
      1 	$NetBSD: install,v 1.3 1998/01/09 18:46:51 perry Exp $	
      2 
      3 Installing NetBSD is a relatively complex process, but if you have
      4 this document in hand it should not be too difficult.
      5 
      6 There are several ways to install NetBSD onto your disk.  If your
      7 machine has a tape drive the easiest way is "Installing from tape"
      8 (details below). If your machine is on a network with a suitable
      9 NFS server, then "Installing from NFS" is the next best method.
     10 Otherwise, if you have another VME147 machine running NetBSD you can
     11 initialize the disk on that machine and then move the disk.
     12 
     13 
     14 * Installing from tape:
     15 
     16 Create the NetBSD/mvme68k _VER boot tape as described in the section
     17 entitled "Preparing a boot tape". Then, with the tape in the drive,
     18 type the following at the 147Bug prompt:
     19 
     20 -->     147-Bug> bo 5
     21 
     22 As mentioned earlier, this assumes your tape is jumpered for SCSI-id 5.
     23 
     24 As the tape loads (which may take 20 to 30 seconds), you will see a
     25 series of status messages. It may be useful if you can capture these
     26 messages to a file, or a scrollable xterm window. In particular, you
     27 should make a note of the lines which describe the geometry of the
     28 SCSI disks detected by NetBSD. They are of the form:
     29 
     30 sd0 at scsibus0 targ 0 lun 0: <CDC, 94161-9, 2506> SCSI1 0/direct fixed
     31 sd0: 148MB, 967 cyl, 9 head, 35 sec, 512 bytes/sect x 304605 sectors
     32 
     33 The information of most interest is the number of sectors; here it's
     34 304605. You will need this number when you come to create a disklabel
     35 for that drive.
     36 
     37 [ START OF STATUS MESSAGES ]
     38 
     39 RAM address from VMEbus = $00000000
     40 
     41 Booting from: VME147, Controller 5, Device 0
     42 Loading: Operating System
     43 
     44 Volume: NBSD
     45 
     46 IPL loaded at:  $003F0000
     47 >> BSD MVME147 tapeboot [$Revision: 1.3 $]
     48 578616+422344+55540+[46032+51284]=0x11a6e4
     49 Start @ 0x8000 ...
     50 Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.  All rights reserved.
     51 Copyright (c) 1982, 1986, 1989, 1991, 1993
     52     The Regents of the University of California.  All rights reserved.
     53 
     54 NetBSD 1.3 (RAMDISK) #1: Sun Dec 21 16:19:04 GMT 1997
     55     steve (a] soapy.mctavish.demon.co.uk:/usr/src/sys/arch/mvme68k/compile/RAMDISK
     56 Motorola MVME-147S: 25MHz MC68030 CPU+MMU, MC68882 FPU
     57 real mem  = 7237632
     58 avail mem = 6381568
     59 using 88 buffers containing 360448 bytes of memory
     60 mainbus0 (root)
     61 pcc0 at mainbus0: Peripheral Channel Controller, rev 0, vecbase 0x40
     62 clock0 at pcc0 offset 0x0 ipl 5: Mostek MK48T02, 2048 bytes of NVRAM
     63   .
     64   .
     65 
     66 [ END OF STATUS MESSAGES ]
     67 
     68 Note that the exact text of the messages will vary depending on which
     69 MVME147 variant you're using.
     70 
     71 Finally, you will see the following "welcome" message:
     72 
     73 [ START OF WELCOME MESSAGE ]
     74 
     75         Welcome to the NetBSD/mvme68k RAMDISK root!
     76 
     77 This environment is designed to do only four things:
     78   1:  Partititon your disk (use the command:  edlabel /dev/rsd0c)
     79   2:  Copy a miniroot image into the swap partition  (/dev/rsd0b)
     80   3:  Make that partition bootable (using 'installboot')
     81   4:  Reboot (using the swap partition, i.e. /dev/sd0b).
     82 
     83 Copying the miniroot can be done several ways, allowing the source
     84 of the miniroot image to be on any of these:
     85     boot tape,  NFS server, TFTP server, rsh server
     86 
     87 The easiest is loading from tape, which is done as follows:
     88         mt -f /dev/nrst0 rewind
     89         mt -f /dev/nrst0 fsf 3
     90         dd bs=8k if=/dev/nrst0 of=/dev/rsd0b
     91 (For help with other methods, please see the install notes.)
     92 
     93 To reboot using the swap partition after running installboot, first
     94 use "halt", then at the Bug monitor prompt use a command like:
     95         bo 0,,b:
     96 
     97 To view this message again, type:  cat /.welcome
     98 ssh:
     99 
    100 [ END OF WELCOME MESSAGE ]
    101 
    102 You must now create a disklabel on the disk you wish to use for the
    103 root filesystem. This will usually be 'sd0'. The disklabel is used by
    104 NetBSD to identify the starting block and size of each partition on
    105 the disk.
    106 
    107 Partitions are named 'sd0a', 'sd0b', 'sd0c' etc, up to 'sd0h'. The
    108 mvme68k port of NetBSD makes some assumptions about the first three
    109 partitions on a boot disk:
    110 
    111         sd0a    The root filesystem.
    112         sd0b    The swap partition.
    113         sd0c    The whole disk. Also known as the Raw Partition.
    114 
    115 The 'Raw Partition' is special; NetBSD is able to use it even if the
    116 disk has no label. You should never create a filesystem on the Raw
    117 Partition, even on a non-boot disk.
    118 
    119 It is good practice to put /usr on a different partition than / (sd0a).
    120 So, the first available partition for /usr is 'sd0d'. Refer to the
    121 section entitled "NetBSD System Requirements and Supported Devices" for
    122 information on the recommended sizes of the /, /usr and swap partitions.
    123 
    124 You are not required to define any partitions beyond sd0d, but if you
    125 have a large disk drive, you might want to create several other partitions
    126 for filesystems such as /home or /usr/src. Note that at this time you
    127 are only required to partition the root/boot disk; you will get the
    128 opportunity to partition any other disks in your system from the main
    129 'miniroot' installation program.
    130 
    131 To create the disklabel and partitions, use the 'edlabel' program,
    132 passing it the name of the Raw Partition of your root/boot disk. Note
    133 that '-->' at the start of a line in the following examples indicates
    134 you are being prompted to enter some information. Obviously, you won't
    135 see this when you run the program for real.
    136 
    137 -->     ssh: edlabel /dev/rsd0c
    138         edlabel menu:
    139         print   - display the current disk label
    140         modify  - prompt for changes to the label
    141         write   - write the new label to disk
    142         quit    - terminate program
    143         edlabel> 
    144 
    145 The program shows what commands it recognises; "print", "modify",
    146 "write" and "quit". It will accept the first letter of a command if
    147 you don't feel like typing each one in full.
    148 
    149 To start creating the basic partitions, you should enter 'm' (modify)
    150 at the edlabel prompt, then enter the letter corresponding to the first
    151 partition, 'a'.
    152 
    153 -->     edlabel> m
    154         modify subcommands:
    155          @   : modify disk parameters
    156          a-h : modify partition
    157          s   : standarize geometry
    158          q   : quit this subcommand
    159 -->     edlabel/modify> a
    160          a (root)          0       (0/00/00)          0       (0/00/00)  unused
    161 -->     start as <blkno> or <cyls/trks/sects> : 0
    162 -->     length as <nblks> or <cyls/trks/sects> : 38000
    163 -->     type: 4.2BSD
    164         edlabel/modify> 
    165 
    166 When you enter the start and length of a partition, you can use either
    167 blocks or cylinder/track/sector notation. If this is the first time
    168 you've partitioned a disk for NetBSD, it's probably easiest to use block
    169 notation. The above example creates partition 'a', starting at block zero
    170 and with a size of 38000 blocks. Note that the usual size of a block is
    171 512 bytes, so this creates a 19Mb partition.
    172 
    173 The 'type' of the partition should be "4.2BSD", otherwise you won't
    174 be able to create a filesystem on it.
    175 
    176 Next, create a swap partition (b). Note that the minimum size of this
    177 swap partition should be 8Mb, otherwise you won't be able to use a
    178 miniroot to complete the NetBSD installation!
    179 
    180 -->     edlabel/modify> b
    181          b (swap)          0       (0/00/00)          0       (0/00/00)  unused
    182 -->     start as <blkno> or <cyls/trks/sects> : 38000
    183 -->     length as <nblks> or <cyls/trks/sects> : 32768
    184 -->     type: swap
    185         edlabel/modify> 
    186 
    187 Here, we specify a value for 'start' such that the swap partition follows
    188 immediately after partition 'a', i.e. 38000. The length of the swap
    189 partition should be a multiple of the amount of RAM you have in your
    190 system. Here, I've chosen 32768, or 16Mb.  The next available block on the
    191 drive is thus 38000 + 32768. We will use this to create partition 'd' for
    192 our /usr filesystem. (Note that for a busy system, or a system with more
    193 than 8Mb of RAM, you'll be better off with a 32 or 64Mb swap partition.)
    194 
    195 -->     edlabel/modify> d
    196          d (user)          0       (0/00/00)          0       (0/00/00)  unused
    197 -->     start as <blkno> or <cyls/trks/sects> : 70768
    198 -->     length as <nblks> or <cyls/trks/sects> : 233837
    199 -->     type: 4.2BSD
    200 -->     edlabel/modify> q
    201         edlabel>
    202 
    203 As you can see, I've chosen to assign the remainder of the disk to /usr.
    204 Since there are 304605 sectors on the example disk (did you remember to
    205 note down the number of sectors on your disk during boot?), and partition
    206 'd' starts at sector 70768, a simple bit of arithmetic (304605 - 70768)
    207 gives 'd' a size of 233837.
    208 
    209 You now need to write this new disklabel, together with the partition
    210 details you've just entered, to disk. You might also try the 'p' command
    211 to view the partitions. Once written, you can quit back to ssh using 'q'.
    212 
    213 -->     edlabel> p
    214                 type_num: 4
    215                 sub_type: 0
    216                type_name: SCSI disk
    217                pack_name: fictitious
    218             bytes/sector: 512
    219            sectors/track: 35
    220          tracks/cylinder: 9
    221                cylinders: 967
    222         sectors/cylinder: 315
    223         partition      start         (c/t/s)      nblks         (c/t/s)  type
    224 
    225          a (root)          0       (0/00/00)      38000     (120/05/25)* 4.2BSD
    226          b (swap)      38000     (120/05/25)*     32768     (104/00/08)* swap
    227          c (disk)          0       (0/00/00)     304605     (967/00/00)  unused
    228          d (user)      70768     (224/05/33)*    233837     (742/03/02)* 4.2BSD
    229 -->     edlabel> w
    230 -->     edlabel> q
    231         ssh:
    232 
    233 
    234 Now that your disk's partitioned, you need to get the proper installation
    235 miniroot image onto it. The miniroot image is designed to be copied into
    236 the swap partition of your disk. This is a safe place which won't be
    237 overwritten by the installation procedure. From the ssh prompt, use the
    238 following commands to copy the miniroot image from tape to swap (b).
    239 
    240 -->     ssh: mt -f /dev/nrst0 rewind
    241 -->     ssh: mt -f /dev/nrst0 fsf 3
    242 -->     ssh: dd bs=8k if=/dev/nrst0 of=/dev/rsd0b
    243 
    244 The disk and the miniroot must now be made bootable using the
    245 'installboot' command, To do this, issue the following commands:
    246 
    247 -->     ssh: mount /dev/sd0b /mnt
    248 -->     ssh: installboot /mnt/usr/mdec/bootsd /bootxx /dev/rsd0b
    249 -->     ssh: umount /dev/sd0b
    250 
    251 You can now shutdown the system.
    252 
    253 -->     ssh: halt
    254          signal 15
    255         ssh: syncing disks... done
    256         unmounting /mnt (/dev/sd1b)...
    257         unmounting / (root_device)...
    258         halted
    259 
    260 -->     147-Bug>reset
    261 -->     Reset Local SCSI Bus [Y,N] N? y
    262 -->     Automatic reset of known SCSI Buses on RESET [Y,N] = Y? 
    263 -->     Cold/Warm Reset flag [C,W] = C? 
    264 -->     Execute Soft Reset [Y,N] N? y
    265 
    266 You should now reboot from that just installed miniroot. See the section
    267 entitled "Booting the miniroot" for details.
    268 
    269 
    270 * Installing from NFS:
    271 
    272 Before you can install from NFS, you must have already configured
    273 your NFS server to support your machine as a bootable client.
    274 Instructions for configuring the server are found in the section
    275 entitled "Getting the NetBSD System onto Useful Media" above.
    276 
    277 To get started, you need to download "sboot" into RAM (you will find
    278 'sboot' in the "install" directory of the mvme68k distribution).
    279 You can either do that through the console line or through a 2nd serial
    280 connection. For example, a VME147 connected to a sun4/110 and accessed
    281 via "tip" can be loaded as follows:
    282 
    283         lo 0
    284         ~Ccat sboot
    285         go 4000
    286 
    287 Which will look like this:
    288 
    289 -->     147-Bug>lo 0
    290 -->     ~CLocal command? cat sboot
    291 
    292         away for 11 seconds 
    293         !
    294 
    295 -->     147-Bug>g 4000
    296         Effective address: 00004000 
    297 
    298         sboot: serial line bootstrap program (&end = 6018)
    299 
    300         >>> 
    301 
    302 Now, if you want to do it through serial line 1, then connect serial
    303 line one to a machine. At the "147-Bug> " prompt do this "tm 1".
    304 You should then login to whatever machine it is connected to.
    305 Then hit "^A" to escape to Bug.  do "lo 1;x=cat sboot" ... then when
    306 that is done you can reconnect "tm 1" and logout. Then do "go 4000"
    307 and you've got ">>> " prompt of sboot.
    308 
    309 Once you've got the ">>> " prompt, you can boot the RAMDISK kernel
    310 from the server:
    311 
    312 -->     >>> b
    313 
    314         le0: ethernet address: 8:0:3e:20:cb:87
    315         My ip address is: 192.168.1.4
    316         Server ip address is: 192.168.1.1
    317         4800 
    318         Download was a success!
    319         Start @ 0x8000 ... 
    320         >> BSD MVME147 netboot (via sboot) [$Revision: 1.3 $]
    321         device: le0 attached to 08:00:3e:20:cb:87
    322         boot: client IP address: 192.168.1.4
    323         boot: client name: soapy
    324         root addr=192.168.1.1 path=/export/soapy
    325         578616+422344+55540+[46032+51284]=0x11a6e4
    326         Start @ 0x8000 ...
    327         Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.  All rights reserved.
    328         Copyright (c) 1982, 1986, 1989, 1991, 1993
    329                 The Regents of the University of California.  All rights reserved.
    330 
    331         NetBSD 1.3 (RAMDISK) #1: Sun Dec 21 16:19:04 GMT 1997
    332             steve (a] soapy.mctavish.demon.co.uk:/usr/src/sys/arch/mvme68k/compile/RAMDISK
    333         Motorola MVME-147S: 25MHz MC68030 CPU+MMU, MC68882 FPU
    334         real mem  = 7237632
    335         avail mem = 6381568
    336         using 88 buffers containing 360448 bytes of memory
    337         mainbus0 (root)
    338         pcc0 at mainbus0: Peripheral Channel Controller, rev 0, vecbase 0x40
    339         clock0 at pcc0 offset 0x0 ipl 5: Mostek MK48T02, 2048 bytes of NVRAM
    340           .
    341           .
    342 
    343 After the boot program loads the RAMDISK kernel, you should see the
    344 welcome screen as shown in the "tape boot" section above.
    345 
    346 You now need to create a disklabel with partition information on the
    347 SCSI disk on which you intend to create your root filesystem. Follow
    348 the instructions in the previous section entitled "Installing from
    349 tape" to do this. (But stop short of the part which describes how to
    350 copy the miniroot from tape.)
    351 
    352 You must now configure the network interface before you can access the
    353 NFS server containing the miniroot image. For example the command:
    354 
    355 -->     ssh: ifconfig le0 inet 192.168.1.4 up
    356 
    357 will bring up the network interface 'le0' with that address. The next
    358 step is to copy the miniroot from your server. This can be done using
    359 either NFS or remote shell. (In the examples that follow, the server has
    360 IP address 192.168.1.1) You may then need to add a default route if the
    361 server is on a different subnet:
    362 
    363 -->     ssh: route add default 192.168.1.2 1
    364 
    365 You can look at the route table using:
    366 
    367 -->     ssh: route show
    368 
    369 Now mount the NFS filesystem containing the miniroot image:
    370 
    371 -->     ssh: mount -r 192.168.1.1:/export/soapy /mnt
    372 
    373 The procedure is simpler if you have space for an expanded (not
    374 compressed) copy of the miniroot image. In that case:
    375 
    376 -->     ssh: dd bs=8k if=/mnt/miniroot of=/dev/rsd0b
    377 
    378 Otherwise, you will need to use "zcat" to expand the miniroot image
    379 while copying. This is tricky because the "ssh" program (small shell)
    380 does not handle sh(1) pipeline syntax. Instead, you first run the reader
    381 in the background with its input set to /dev/pipe and then run the other
    382 program in the foreground with its output to /dev/pipe. The result looks
    383 like this:
    384 
    385 -->     ssh: run -bg dd obs=8k if=/dev/pipe of=/dev/rsd0b
    386 -->     ssh: run -o /dev/pipe zcat /mnt/install/miniroot.gz
    387 
    388 To load the miniroot using rsh to the server, you would use a pair
    389 of commands similar to the above. Here is another example:
    390 
    391 -->     ssh: run -b dd obs=8k if=/dev/pipe of=/dev/rsd0b
    392 -->     ssh: run -o /dev/pipe rsh 192.168.1.1 zcat miniroot.gz
    393 
    394 You must now make the disk bootable. Refer to the previous section on
    395 installing from tape, where it describes how to run 'installboot'.
    396 This is immediately following the part which explains how to copy the
    397 miniroot from tape.
    398 
    399 
    400 * Booting the miniroot:
    401 
    402 Assuming the miniroot is installed on partition 'b' of the disk with
    403 SCSI-id 0, then the 147Bug boot command is:
    404 
    405         147-Bug> bo 0,,b:
    406 
    407 The command line parameters above are:
    408 
    409         0   controller (usually zero)
    410         ,,  bug argument separators
    411         b:  tell the bootstrap code to boot from partition 'b'
    412 
    413 You should see a bunch of boot messages, followed by messages from
    414 the miniroot kernel just as you did when the RAMDISK kernel booted.
    415 
    416 You will then be prompted to enter the root device. Since the miniroot
    417 was booted from the swap partition, you should enter 'sd0b'. You will
    418 then be asked for the swap device and filesystem type. Just press
    419 return twice to accept the defaults. When asked to enter a terminal
    420 type, either accept the default, or use whatever the TERM environment
    421 variable is set to in the shell of your host system:
    422 
    423         vmel0 at vmechip0
    424         boot device: sd0
    425 -->     root device (default sd0a): sd0b
    426 -->     dump device (default sd0b): 
    427 -->     file system (default generic): 
    428         root on sd0b dumps on sd0b
    429         mountroot: trying ffs...
    430         root file system type: ffs
    431         init: copying out path `/sbin/init' 11
    432         erase ^H, werase ^W, kill ^U, intr ^C
    433 -->     Terminal type? [vt100] 
    434 
    435 Congratulations! The system should now be running the miniroot
    436 installation program.
    437 
    438 
    439 Miniroot install program:
    440 ------------------------
    441 
    442 The miniroot's install program is very simple to use. It will guide
    443 you through the entire process, and is well automated. Additional
    444 improvements are planned for future releases.
    445 
    446 The miniroot's install program will:
    447 
    448         * Allow you to place disklabels on additional disks.
    449           The disk we are installing on should already have
    450           been partitioned using the RAMDISK kernel.
    451 
    452           Note that partition sizes and offsets are expressed
    453           in sectors. When you fill out the disklabel, you will
    454           need to specify partition types and filesystem parameters.
    455           If you're unsure what the these values should be, use the
    456           following defaults:
    457 
    458                 fstype: 4.2BSD
    459                 fsize: 1024
    460                 bsize: 4096
    461                 cpg: 16
    462 
    463           If the partition will be a swap partition, use the following:
    464 
    465                 fstype: swap
    466                 fsize: 0 (or blank)
    467                 bsize: 0 (or blank)
    468                 cpg: 0 (or blank)
    469 
    470           Note that partition 'c' is special; it covers then entire
    471           disk and should not be assigned to a filesystem.
    472 
    473           The number of partitions is currently fixed at 8.
    474 
    475         * Create filesystems on target partitions.
    476 
    477         * Allow you to set up your system's network configuration.
    478           Remember to specify host names without the domain name
    479           appended to the end.  For example use `foo' instead of
    480           `foo.bar.org'.  If, during the process of configuring
    481           the network interfaces, you make a mistake, you will
    482           be able to re-configure that interface by simply selecting
    483           it for configuration again.
    484 
    485         * Mount target filesystems.  You will be given the opportunity
    486           to manually edit the resulting /etc/fstab.
    487 
    488         * Extract binary sets from the media of your choice.
    489 
    490         * Copy configuration information gathered during the
    491           installation process to your root filesystem.
    492 
    493         * Make device nodes in your root filesystem.
    494 
    495         * Copy a new kernel onto your root partition.
    496 
    497         * Install a new boot block.
    498 
    499         * Check your filesystems for integrity.
    500 
    501 First-time installation on a system through a method other than the
    502 installation program is possible, but strongly discouraged.
    503