install revision 1.3
1 $NetBSD: install,v 1.3 1998/01/09 18:46:51 perry Exp $ 2 3Installing NetBSD is a relatively complex process, but if you have 4this document in hand it should not be too difficult. 5 6There are several ways to install NetBSD onto your disk. If your 7machine has a tape drive the easiest way is "Installing from tape" 8(details below). If your machine is on a network with a suitable 9NFS server, then "Installing from NFS" is the next best method. 10Otherwise, if you have another VME147 machine running NetBSD you can 11initialize the disk on that machine and then move the disk. 12 13 14* Installing from tape: 15 16Create the NetBSD/mvme68k _VER boot tape as described in the section 17entitled "Preparing a boot tape". Then, with the tape in the drive, 18type the following at the 147Bug prompt: 19 20--> 147-Bug> bo 5 21 22As mentioned earlier, this assumes your tape is jumpered for SCSI-id 5. 23 24As the tape loads (which may take 20 to 30 seconds), you will see a 25series of status messages. It may be useful if you can capture these 26messages to a file, or a scrollable xterm window. In particular, you 27should make a note of the lines which describe the geometry of the 28SCSI disks detected by NetBSD. They are of the form: 29 30sd0 at scsibus0 targ 0 lun 0: <CDC, 94161-9, 2506> SCSI1 0/direct fixed 31sd0: 148MB, 967 cyl, 9 head, 35 sec, 512 bytes/sect x 304605 sectors 32 33The information of most interest is the number of sectors; here it's 34304605. You will need this number when you come to create a disklabel 35for that drive. 36 37[ START OF STATUS MESSAGES ] 38 39RAM address from VMEbus = $00000000 40 41Booting from: VME147, Controller 5, Device 0 42Loading: Operating System 43 44Volume: NBSD 45 46IPL loaded at: $003F0000 47>> BSD MVME147 tapeboot [$Revision: 1.3 $] 48578616+422344+55540+[46032+51284]=0x11a6e4 49Start @ 0x8000 ... 50Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. All rights reserved. 51Copyright (c) 1982, 1986, 1989, 1991, 1993 52 The Regents of the University of California. All rights reserved. 53 54NetBSD 1.3 (RAMDISK) #1: Sun Dec 21 16:19:04 GMT 1997 55 steve@soapy.mctavish.demon.co.uk:/usr/src/sys/arch/mvme68k/compile/RAMDISK 56Motorola MVME-147S: 25MHz MC68030 CPU+MMU, MC68882 FPU 57real mem = 7237632 58avail mem = 6381568 59using 88 buffers containing 360448 bytes of memory 60mainbus0 (root) 61pcc0 at mainbus0: Peripheral Channel Controller, rev 0, vecbase 0x40 62clock0 at pcc0 offset 0x0 ipl 5: Mostek MK48T02, 2048 bytes of NVRAM 63 . 64 . 65 66[ END OF STATUS MESSAGES ] 67 68Note that the exact text of the messages will vary depending on which 69MVME147 variant you're using. 70 71Finally, you will see the following "welcome" message: 72 73[ START OF WELCOME MESSAGE ] 74 75 Welcome to the NetBSD/mvme68k RAMDISK root! 76 77This 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 83Copying the miniroot can be done several ways, allowing the source 84of the miniroot image to be on any of these: 85 boot tape, NFS server, TFTP server, rsh server 86 87The 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 93To reboot using the swap partition after running installboot, first 94use "halt", then at the Bug monitor prompt use a command like: 95 bo 0,,b: 96 97To view this message again, type: cat /.welcome 98ssh: 99 100[ END OF WELCOME MESSAGE ] 101 102You must now create a disklabel on the disk you wish to use for the 103root filesystem. This will usually be 'sd0'. The disklabel is used by 104NetBSD to identify the starting block and size of each partition on 105the disk. 106 107Partitions are named 'sd0a', 'sd0b', 'sd0c' etc, up to 'sd0h'. The 108mvme68k port of NetBSD makes some assumptions about the first three 109partitions 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 115The 'Raw Partition' is special; NetBSD is able to use it even if the 116disk has no label. You should never create a filesystem on the Raw 117Partition, even on a non-boot disk. 118 119It is good practice to put /usr on a different partition than / (sd0a). 120So, the first available partition for /usr is 'sd0d'. Refer to the 121section entitled "NetBSD System Requirements and Supported Devices" for 122information on the recommended sizes of the /, /usr and swap partitions. 123 124You are not required to define any partitions beyond sd0d, but if you 125have a large disk drive, you might want to create several other partitions 126for filesystems such as /home or /usr/src. Note that at this time you 127are only required to partition the root/boot disk; you will get the 128opportunity to partition any other disks in your system from the main 129'miniroot' installation program. 130 131To create the disklabel and partitions, use the 'edlabel' program, 132passing it the name of the Raw Partition of your root/boot disk. Note 133that '-->' at the start of a line in the following examples indicates 134you are being prompted to enter some information. Obviously, you won't 135see 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 145The program shows what commands it recognises; "print", "modify", 146"write" and "quit". It will accept the first letter of a command if 147you don't feel like typing each one in full. 148 149To start creating the basic partitions, you should enter 'm' (modify) 150at the edlabel prompt, then enter the letter corresponding to the first 151partition, '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 166When you enter the start and length of a partition, you can use either 167blocks or cylinder/track/sector notation. If this is the first time 168you've partitioned a disk for NetBSD, it's probably easiest to use block 169notation. The above example creates partition 'a', starting at block zero 170and with a size of 38000 blocks. Note that the usual size of a block is 171512 bytes, so this creates a 19Mb partition. 172 173The 'type' of the partition should be "4.2BSD", otherwise you won't 174be able to create a filesystem on it. 175 176Next, create a swap partition (b). Note that the minimum size of this 177swap partition should be 8Mb, otherwise you won't be able to use a 178miniroot 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 187Here, we specify a value for 'start' such that the swap partition follows 188immediately after partition 'a', i.e. 38000. The length of the swap 189partition should be a multiple of the amount of RAM you have in your 190system. Here, I've chosen 32768, or 16Mb. The next available block on the 191drive is thus 38000 + 32768. We will use this to create partition 'd' for 192our /usr filesystem. (Note that for a busy system, or a system with more 193than 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 203As you can see, I've chosen to assign the remainder of the disk to /usr. 204Since there are 304605 sectors on the example disk (did you remember to 205note 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) 207gives 'd' a size of 233837. 208 209You now need to write this new disklabel, together with the partition 210details you've just entered, to disk. You might also try the 'p' command 211to 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 234Now that your disk's partitioned, you need to get the proper installation 235miniroot image onto it. The miniroot image is designed to be copied into 236the swap partition of your disk. This is a safe place which won't be 237overwritten by the installation procedure. From the ssh prompt, use the 238following 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 244The 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 251You 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 266You should now reboot from that just installed miniroot. See the section 267entitled "Booting the miniroot" for details. 268 269 270* Installing from NFS: 271 272Before you can install from NFS, you must have already configured 273your NFS server to support your machine as a bootable client. 274Instructions for configuring the server are found in the section 275entitled "Getting the NetBSD System onto Useful Media" above. 276 277To get started, you need to download "sboot" into RAM (you will find 278'sboot' in the "install" directory of the mvme68k distribution). 279You can either do that through the console line or through a 2nd serial 280connection. For example, a VME147 connected to a sun4/110 and accessed 281via "tip" can be loaded as follows: 282 283 lo 0 284 ~Ccat sboot 285 go 4000 286 287Which 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 302Now, if you want to do it through serial line 1, then connect serial 303line one to a machine. At the "147-Bug> " prompt do this "tm 1". 304You should then login to whatever machine it is connected to. 305Then hit "^A" to escape to Bug. do "lo 1;x=cat sboot" ... then when 306that is done you can reconnect "tm 1" and logout. Then do "go 4000" 307and you've got ">>> " prompt of sboot. 308 309Once you've got the ">>> " prompt, you can boot the RAMDISK kernel 310from 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@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 343After the boot program loads the RAMDISK kernel, you should see the 344welcome screen as shown in the "tape boot" section above. 345 346You now need to create a disklabel with partition information on the 347SCSI disk on which you intend to create your root filesystem. Follow 348the instructions in the previous section entitled "Installing from 349tape" to do this. (But stop short of the part which describes how to 350copy the miniroot from tape.) 351 352You must now configure the network interface before you can access the 353NFS server containing the miniroot image. For example the command: 354 355--> ssh: ifconfig le0 inet 192.168.1.4 up 356 357will bring up the network interface 'le0' with that address. The next 358step is to copy the miniroot from your server. This can be done using 359either NFS or remote shell. (In the examples that follow, the server has 360IP address 192.168.1.1) You may then need to add a default route if the 361server is on a different subnet: 362 363--> ssh: route add default 192.168.1.2 1 364 365You can look at the route table using: 366 367--> ssh: route show 368 369Now mount the NFS filesystem containing the miniroot image: 370 371--> ssh: mount -r 192.168.1.1:/export/soapy /mnt 372 373The procedure is simpler if you have space for an expanded (not 374compressed) copy of the miniroot image. In that case: 375 376--> ssh: dd bs=8k if=/mnt/miniroot of=/dev/rsd0b 377 378Otherwise, you will need to use "zcat" to expand the miniroot image 379while copying. This is tricky because the "ssh" program (small shell) 380does not handle sh(1) pipeline syntax. Instead, you first run the reader 381in the background with its input set to /dev/pipe and then run the other 382program in the foreground with its output to /dev/pipe. The result looks 383like 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 388To load the miniroot using rsh to the server, you would use a pair 389of 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 394You must now make the disk bootable. Refer to the previous section on 395installing from tape, where it describes how to run 'installboot'. 396This is immediately following the part which explains how to copy the 397miniroot from tape. 398 399 400* Booting the miniroot: 401 402Assuming the miniroot is installed on partition 'b' of the disk with 403SCSI-id 0, then the 147Bug boot command is: 404 405 147-Bug> bo 0,,b: 406 407The 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 413You should see a bunch of boot messages, followed by messages from 414the miniroot kernel just as you did when the RAMDISK kernel booted. 415 416You will then be prompted to enter the root device. Since the miniroot 417was booted from the swap partition, you should enter 'sd0b'. You will 418then be asked for the swap device and filesystem type. Just press 419return twice to accept the defaults. When asked to enter a terminal 420type, either accept the default, or use whatever the TERM environment 421variable 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 435Congratulations! The system should now be running the miniroot 436installation program. 437 438 439Miniroot install program: 440------------------------ 441 442The miniroot's install program is very simple to use. It will guide 443you through the entire process, and is well automated. Additional 444improvements are planned for future releases. 445 446The 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 501First-time installation on a system through a method other than the 502installation program is possible, but strongly discouraged. 503