PageRenderTime 127ms CodeModel.GetById 7ms app.highlight 107ms RepoModel.GetById 1ms app.codeStats 1ms

/share/doc/smm/01.setup/2.t

https://bitbucket.org/freebsd/freebsd-head/
Unknown | 1649 lines | 1648 code | 1 blank | 0 comment | 0 complexity | 38c53b4572be47b03d931b5e91299095 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1.\" Copyright (c) 1988, 1993 The Regents of the University of California.
   2.\" All rights reserved.
   3.\"
   4.\" Redistribution and use in source and binary forms, with or without
   5.\" modification, are permitted provided that the following conditions
   6.\" are met:
   7.\" 1. Redistributions of source code must retain the above copyright
   8.\"    notice, this list of conditions and the following disclaimer.
   9.\" 2. Redistributions in binary form must reproduce the above copyright
  10.\"    notice, this list of conditions and the following disclaimer in the
  11.\"    documentation and/or other materials provided with the distribution.
  12.\" 3. All advertising materials mentioning features or use of this software
  13.\"    must display the following acknowledgement:
  14.\"	This product includes software developed by the University of
  15.\"	California, Berkeley and its contributors.
  16.\" 4. Neither the name of the University nor the names of its contributors
  17.\"    may be used to endorse or promote products derived from this software
  18.\"    without specific prior written permission.
  19.\"
  20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30.\" SUCH DAMAGE.
  31.\"
  32.\"	@(#)2.t	8.1 (Berkeley) 7/27/93
  33.\" $FreeBSD$
  34.\"
  35.ds lq ``
  36.ds rq ''
  37.ds LH "Installing/Operating \*(4B
  38.ds RH Bootstrapping
  39.ds CF \*(Dy
  40.Sh 1 "Bootstrap procedure"
  41.PP
  42This section explains the bootstrap procedure that can be used
  43to get the kernel supplied with this distribution running on your machine.
  44If you are not currently running \*(Ps you will
  45have to do a full bootstrap.
  46Section 3 describes how to upgrade a \*(Ps system.
  47An understanding of the operations used in a full bootstrap
  48is helpful in doing an upgrade as well.
  49In either case, it is highly desirable to read and understand
  50the remainder of this document before proceeding.
  51.PP
  52The distribution supports a somewhat wider set of machines than
  53those for which we have built binaries.
  54The architectures that are supported only in source form include:
  55.IP \(bu
  56Intel 386/486-based machines (ISA/AT or EISA bus only)
  57.IP \(bu
  58Sony News MIPS-based workstations
  59.IP \(bu
  60Omron Luna 68000-based workstations
  61.LP
  62If you wish to run one of these architectures,
  63you will have to build a cross compilation environment.
  64Note that the distribution does
  65.B not
  66include the machine support for the Tahoe and VAX architectures
  67found in previous BSD distributions.
  68Our primary development environment is the HP9000/300 series machines.
  69The other architectures are developed and supported by
  70people outside the university.
  71Consequently, we are not able to directly test or maintain these 
  72other architectures, so cannot comment on their robustness,
  73reliability, or completeness.
  74.Sh 2 "Bootstrapping from the tape"
  75.LP
  76The set of files on the distribution tape are as follows:
  77.IP 1)
  78A
  79.Xr dd (1)
  80(HP300),
  81.Xr tar (1)
  82(DECstation), or
  83.Xr dump (8)
  84(SPARC) image of the root filesystem
  85.IP 2)
  86A
  87.Xr tar
  88image of the
  89.Pn /var
  90filesystem
  91.IP 3)
  92A
  93.Xr tar
  94image of the
  95.Pn /usr
  96filesystem
  97.IP 4)
  98A
  99.Xr tar
 100image of
 101.Pn /usr/src/sys
 102.IP 5)
 103A
 104.Xr tar
 105image of
 106.Pn /usr/src
 107except sys and contrib
 108.IP 6)
 109A
 110.Xr tar
 111image of
 112.Pn /usr/src/contrib
 113.IP 7)
 114(8mm Exabyte tape distributions only)
 115A
 116.Xr tar
 117image of
 118.Pn /usr/src/X11R5
 119.LP
 120The tape bootstrap procedure used to create a
 121working system involves the following major steps:
 122.IP 1)
 123Transfer a bootable root filesystem from the tape to a disk
 124and get it booted and running.
 125.IP 2)
 126Build and restore the
 127.Pn /var
 128and
 129.Pn /usr
 130filesystems from tape with
 131.Xr tar (1).
 132.IP 3)
 133Extract the system and utility source files as desired.
 134.PP
 135The following sections describe the above steps in detail.
 136The details of the first step vary between architectures.
 137The specific steps for the HP300, SPARC, and DECstation are
 138given in the next three sections respectively.
 139You should follow the instructions for your particular architecture.
 140In all sections,
 141commands you are expected to type are shown in italics, while that
 142information printed by the system is shown emboldened.
 143.Sh 2 "Booting the HP300"
 144.Sh 3 "Supported hardware"
 145.LP
 146The hardware supported by \*(4B for the HP300/400 is as follows:
 147.TS
 148center box;
 149lw(1i) lw(4i).
 150CPU's	T{
 15168020 based (318, 319, 320, 330 and 350),
 15268030 based (340, 345, 360, 370, 375, 400) and
 15368040 based (380, 425, 433).
 154T}
 155_
 156DISK's	T{
 157HP-IB/CS80 (7912, 7914, 7933, 7936, 7945, 7957, 7958, 7959, 2200, 2203)
 158and SCSI-I (including magneto-optical).
 159T}
 160_
 161TAPE's	T{
 162Low-density CS80 cartridge (7914, 7946, 9144),
 163high-density CS80 cartridge (9145),
 164HP SCSI DAT and
 165SCSI Exabyte.
 166T}
 167_
 168RS232	T{
 16998644 built-in single-port, 98642 4-port and 98638 8-port interfaces.
 170T}
 171_
 172NETWORK	T{
 17398643 internal and external LAN cards.
 174T}
 175_
 176GRAPHICS	T{
 177Terminal emulation and raw frame buffer support for
 17898544 / 98545 / 98547 (Topcat color & monochrome),
 17998548 / 98549 / 98550 (Catseye color & monochrome),
 18098700 / 98710 (Gatorbox),
 18198720 / 98721 (Renaissance),
 18298730 / 98731 (DaVinci) and
 183A1096A (Hyperion monochrome).
 184T}
 185_
 186INPUT	T{
 187General interface supporting all HIL devices.
 188(e.g. keyboard, 2 and 3 button mice, ID module, ...)
 189T}
 190_
 191MISC	T{
 192Battery-backed real time clock,
 193builtin and 98625A/B HP-IB interfaces,
 194builtin and 98658A SCSI interfaces,
 195serial printers and plotters on HP-IB,
 196and SCSI autochanger device.
 197T}
 198.TE
 199.LP
 200Major items that are not supported
 201include the 310 and 332 CPU's, 400 series machines
 202configured for Domain/OS, EISA and VME bus adaptors, audio, the centronics
 203port, 1/2" tape drives (7980), CD-ROM, and the PVRX/TVRX 3D graphics displays.
 204.Sh 3 "Standalone device file naming"
 205.LP
 206The standalone system device name syntax on the HP300 is of the form:
 207.DS
 208xx(a,c,u,p)
 209.DE
 210where
 211\fIxx\fP is the device type,
 212\fIa\fP specifies the adaptor to use,
 213\fIc\fP the controller,
 214\fIu\fP the unit, and
 215\fIp\fP a partition.
 216The \fIdevice type\fP differentiates the various disks and tapes and is one of:
 217``rd'' for HP-IB CS80 disks,
 218``ct'' for HP-IB CS80 cartridge tapes, or
 219``sd'' for SCSI-I disks
 220(SCSI-I tapes are currently not supported).
 221The \fIadaptor\fP field is a logical HP-IB or SCSI bus adaptor card number.
 222This will typically be
 2230 for SCSI disks,
 2240 for devices on the ``slow'' HP-IB interface (usually tapes) and
 2251 for devices on the ``fast'' HP-IB interface (usually disks).
 226To get a complete mapping of physical (select-code) to logical card numbers
 227just type a ^C at the standalone prompt.
 228The \fIcontroller\fP field is the disk or tape's target number on the
 229HP-IB or SCSI bus.
 230For SCSI the range is 0 to 6 (7 is the adaptor address) and
 231for HP-IB the range is 0 to 7.
 232The \fIunit\fP field is unused and should be 0.
 233The \fIpartition\fP field is interpreted differently for tapes
 234and disks: for disks it is a disk partition (in the range 0-7),
 235and for tapes it is a file number offset on the tape.
 236Thus, partition 2 of a SCSI disk drive at target 3 on SCSI bus 1
 237would be ``sd(1,3,0,2)''.
 238If you have only one of any type bus adaptor, you may omit the adaptor
 239and controller numbers;
 240e.g. ``sd(0,2)'' could be used instead of ``sd(0,0,0,2)''.
 241The following examples always use the full syntax for clarity.
 242.Sh 3 "The procedure"
 243.LP
 244The basic steps involved in bringing up the HP300 are as follows:
 245.IP 1)
 246Obtain a second disk and format it, if necessary.
 247.IP 2)
 248Copy a root filesystem from the
 249tape onto the beginning of the disk.
 250.IP 3)
 251Boot the UNIX system on the new disk.
 252.IP 4)
 253(Optional) Build a root filesystem optimized for your disk.
 254.IP 5)
 255Label the disks with the
 256.Xr disklabel (8)
 257program.
 258.Sh 4 "Step 1: selecting and formatting a disk"
 259.PP
 260For your first system you will have to obtain a formatted disk
 261of a type given in the ``supported hardware'' list above.
 262If you want to load an entire binary system
 263(i.e., everything except
 264.Pn /usr/src ),
 265on the single disk you will need a minimum of 290MB,
 266ruling out anything smaller than a 7959B/S disk.
 267The disklabel included in the bootstrap root image is laid out
 268to accommodate this scenario.
 269Note that an HP SCSI magneto-optical disk will work fine for this case.
 270\*(4B will boot and run (albeit slowly) using one.
 271If you want to load source on a single disk system,
 272you will need at least 640MB (at least a 2213A SCSI or 2203A HP-IB disk).
 273A disk as small as the 7945A (54MB) can be used for the bootstrap
 274procedure but will hold only the root and primary swap partitions.
 275If you plan to use multiple disks,
 276refer to section 2.5 for suggestions on partitioning.
 277.PP
 278After selecting a disk, you may need to format it.
 279Since most HP disk drives come pre-formatted
 280(except optical media)
 281you probably will not, but if necessary,
 282you can format a disk under HP-UX using the
 283.Xr mediainit (1m)
 284program.
 285Once you have \*(4B up and running on one machine you can use the
 286.Xr scsiformat (8)
 287program to format additional SCSI disks.
 288Any additional HP-IB disks will have to be formatted using HP-UX.
 289.Sh 4 "Step 2: copying the root filesystem from tape to disk"
 290.PP
 291Once you have a formatted second disk you can use the
 292.Xr dd (1)
 293command under HP-UX to copy the root filesystem image from
 294the tape to the beginning of the second disk.
 295For HP's, the root filesystem image is the first file on the tape.
 296It includes a disklabel and bootblock along with the root filesystem.
 297An example command to copy the image from tape to the beginning of a disk is:
 298.DS
 299.ft CW
 300dd if=/dev/rmt/0m of=/dev/rdsk/1s0 bs=\*(Bzb
 301.DE
 302The actual special file syntax may vary depending on unit numbers and
 303the version of HP-UX that is running.
 304Consult the HP-UX
 305.Xr mt (7)
 306and
 307.Xr disk (7)
 308man pages for details.
 309.PP
 310Note that if you have a SCSI disk, you don't necessarily have to use
 311HP-UX (or an HP) to create the boot disk.
 312Any machine and operating system that will allow you to copy the
 313raw disk image out to block 0 of the disk will do.
 314.PP
 315If you have only a single machine with a single disk,
 316you may still be able to install and boot \*(4B if you have an
 317HP-IB cartridge tape drive.
 318If so, you can use a more difficult approach of booting a
 319standalone copy program from the tape, and using that to copy the
 320root filesystem image from the tape to the disk.
 321To do this, you need to extract the first file of the distribution tape
 322(the root image), copy it over to a machine with a cartridge drive
 323and then copy the image onto tape.
 324For example:
 325.DS
 326.ft CW
 327dd if=/dev/rst0 of=bootimage bs=\*(Bzb
 328rcp bootimage foo:/tmp/bootimage
 329<login to foo>
 330dd if=/tmp/bootimage of=/dev/rct/0m bs=\*(Bzb
 331.DE
 332Once this tape is created you can boot and run the standalone tape
 333copy program from it.
 334The copy program is loaded just as any other program would be loaded
 335by the bootrom in ``attended'' mode:
 336reset the CPU,
 337hold down the space bar until the word ``Keyboard'' appears in the
 338installed interface list, and
 339enter the menu selection for SYS_TCOPY.
 340Once loaded and running:
 341.DS
 342.TS
 343lw(2i) l.
 344\fBFrom:\fP \fI^C\fP	(control-C to see logical adaptor assignments)
 345\fBhpib0 at sc7\fP
 346\fBscsi0 at sc14\fP
 347\fBFrom:\fP \fIct(0,7,0,0)\fP	(HP-IB tape, target 7, first tape file)
 348\fBTo:\fP \fIsd(0,0,0,2)\fP	(SCSI disk, target 0, third partition)
 349\fBCopy completed: 1728 records copied\fP
 350.TE
 351.DE
 352.LP
 353This copy will likely take 30 minutes or more.
 354.Sh 4 "Step 3: booting the root filesystem"
 355.PP
 356You now have a bootable root filesystem on the disk.
 357If you were previously running with two disks,
 358it would be best if you shut down the machine and turn off power on
 359the HP-UX drive.
 360It will be less confusing and it will eliminate any chance of accidentally
 361destroying the HP-UX disk.
 362If you used a cartridge tape for booting you should also unload the tape
 363at this point.
 364Whether you booted from tape or copied from disk you should now reboot
 365the machine and do another attended boot (see previous section),
 366this time with SYS_TBOOT.
 367Once loaded and running the boot program will display the CPU type and
 368prompt for a kernel file to boot:
 369.DS
 370.B
 371HP433 CPU
 372Boot
 373.R
 374\fB:\fP \fI/kernel\fP
 375.DE
 376.LP
 377After providing the kernel name, the machine will boot \*(4B with
 378output that looks about like this:
 379.DS
 380.B
 381597480+34120+139288 start 0xfe8019ec
 382Copyright (c) 1982, 1986, 1989, 1991, 1993
 383	The Regents of the University of California.
 384Copyright (c) 1992 Hewlett-Packard Company
 385Copyright (c) 1992 Motorola Inc.
 386All rights reserved.
 387
 3884.4BSD UNIX #1: Tue Jul 20 11:40:36 PDT 1993
 389    mckusick@vangogh.CS.Berkeley.EDU:/usr/obj/sys/compile/GENERIC.hp300
 390HP9000/433 (33MHz MC68040 CPU+MMU+FPU, 4k on-chip physical I/D caches)
 391real mem = xxx
 392avail mem = ###
 393using ### buffers containing ### bytes of memory
 394(... information about available devices ...)
 395root device?
 396.R
 397.DE
 398.PP
 399The first three numbers are printed out by the bootstrap program and
 400are the sizes of different parts of the system (text, initialized and
 401uninitialized data).  The system also allocates several system data
 402structures after it starts running.  The sizes of these structures are
 403based on the amount of available memory and the maximum count of active
 404users expected, as declared in a system configuration description.  This
 405will be discussed later.
 406.PP
 407UNIX itself then runs for the first time and begins by printing out a banner
 408identifying the release and
 409version of the system that is in use and the date that it was compiled. 
 410.PP
 411Next the
 412.I mem
 413messages give the
 414amount of real (physical) memory and the
 415memory available to user programs
 416in bytes.
 417For example, if your machine has 16Mb bytes of memory, then
 418\fBxxx\fP will be 16777216.
 419.PP
 420The messages that come out next show what devices were found on
 421the current processor.  These messages are described in
 422.Xr autoconf (4).
 423The distributed system may not have
 424found all the communications devices you have
 425or all the mass storage peripherals you have, especially
 426if you have more than
 427two of anything.  You will correct this when you create
 428a description of your machine from which to configure a site-dependent
 429version of UNIX.
 430The messages printed at boot here contain much of the information
 431that will be used in creating the configuration.
 432In a correctly configured system most of the information
 433present in the configuration description
 434is printed out at boot time as the system verifies that each device
 435is present.
 436.PP
 437The \*(lqroot device?\*(rq prompt was printed by the system
 438to ask you for the name of the root filesystem to use.
 439This happens because the distribution system is a \fIgeneric\fP
 440system, i.e., it can be bootstrapped on a cpu with its root device
 441and paging area on any available disk drive.
 442You will most likely respond to the root device question with ``sd0''
 443if you are booting from a SCSI disk,
 444or with ``rd0'' if you are booting from an HP-IB disk.
 445This response shows that the disk it is running
 446on is drive 0 of type ``sd'' or ``rd'' respectively.
 447If you have other disks attached to the system,
 448it is possible that the drive you are using will not be configured
 449as logical drive 0.
 450Check the autoconfiguration messages printed out by the kernel to
 451make sure.
 452These messages will show the type of every logical drive
 453and their associated controller and slave addresses.
 454You will later build a system tailored to your configuration
 455that will not prompt you for a root device when it is bootstrapped.
 456.DS
 457\fBroot device?\fP \fI\*(Dk0\fP
 458\fBWARNING: preposterous time in filesystem \-\- CHECK AND RESET THE DATE!\fP
 459\fBerase ^?, kill ^U, intr ^C\fP
 460\fB#\fP
 461.DE
 462.PP
 463The \*(lqerase ...\*(rq message is part of the
 464.Pn /.profile
 465that was executed by the root shell when it started.  This message
 466tells you about the settings of the character erase,
 467line erase, and interrupt characters.
 468.PP
 469UNIX is now running,
 470and the \fIUNIX Programmer's Manual\fP applies.  The ``#'' is the prompt
 471from the Bourne shell, and lets you know that you are the super-user,
 472whose login name is \*(lqroot\*(rq.
 473.PP
 474At this point, the root filesystem is mounted read-only.
 475Before continuing the installation, the filesystem needs to be ``updated''
 476to allow writing and device special files for the following steps need
 477to be created.
 478This is done as follows:
 479.DS
 480.TS
 481lw(2i) l.
 482\fB#\fP \fImount_mfs -s 1000 -T type /dev/null /tmp\fP	(create a writable filesystem)
 483(\fItype\fP is the disk type as determined from /etc/disktab)
 484\fB#\fP \fIcd /tmp\fP	(connect to that directory)
 485\fB#\fP \fImount \-uw /tmp/\*(Dk#a /\fP	(read-write mount root filesystem)
 486.TE
 487.DE
 488.Sh 4 "Step 4: (optional) restoring the root filesystem"
 489.PP
 490The root filesystem that you are currently running on is complete,
 491however it probably is not optimally laid out for the disk on
 492which you are running.
 493If you will be cloning copies of the system onto multiple disks for
 494other machines, you are advised to connect one of these disks to
 495this machine, and build and restore a properly laid out root filesystem
 496onto it.
 497If this is the only machine on which you will be running \*(4B
 498or peak performance is not an issue, you can skip this step and
 499proceed directly to step 5.
 500.PP
 501Connect a second disk to your machine.
 502If you bootstrapped using the two disk method, you can
 503overwrite your initial HP-UX disk, as it will no longer
 504be needed (assuming you have no plans to run HP-UX again).
 505.PP
 506To really create the root filesystem on drive 1
 507you should first label the disk as described in step 5 below.
 508Then run the following commands:
 509.DS
 510\fB#\fP\|\fInewfs /dev/r\*(Dk1a\fP
 511\fB#\fP\|\fImount /dev/\*(Dk1a /mnt\fP
 512\fB#\fP\|\fIcd /mnt\fP
 513\fB#\fP\|\fIdump 0f \- /dev/r\*(Dk0a | restore xf \-\fP
 514(Note: restore will ask if you want to ``set owner/mode for '.'''
 515to which you should reply ``yes''.)
 516.DE
 517.PP
 518When this completes,
 519you should then shut down the system, and boot on the disk that
 520you just created following the procedure in step (3) above.
 521.Sh 4 "Step 5: placing labels on the disks"
 522.PP
 523For each disk on the HP300, \*(4B places information about the geometry
 524of the drive and the partition layout at byte offset 1024.
 525This information is written with
 526.Xr disklabel (8).
 527.PP
 528The root image just loaded includes a ``generic'' label intended to allow
 529easy installation of the root and
 530.Pn /usr
 531and may not be suitable for the actual
 532disk on which it was installed.
 533In particular,
 534it may make your disk appear larger or smaller than its real size.
 535In the former case, you lose some capacity.
 536In the latter, some of the partitions may map non-existent sectors
 537leading to errors if those partitions are used.
 538It is also possible that the defined geometry will interact poorly with
 539the filesystem code resulting in reduced performance.
 540However, as long as you are willing to give up a little space,
 541not use certain partitions or suffer minor performance degradation,
 542you might want to avoid this step;
 543especially if you do not know how to use
 544.Xr ed (1).
 545.PP
 546If you choose to edit this label,
 547you can fill in correct geometry information from
 548.Pn /etc/disktab .
 549You may also want to rework the ``e'' and ``f'' partitions used for loading
 550.Pn /usr
 551and
 552.Pn /var .
 553You should not attempt to, and
 554.Xr disklabel
 555will not let you, modify the ``a'', ``b'' and ``d'' partitions.
 556To edit a label:
 557.DS
 558\fB#\fP \fIEDITOR=ed\fP
 559\fB#\fP \fIexport EDITOR\fP
 560\fB#\fP \fIdisklabel  -r  -e  /dev/r\fBXX#\fPd
 561.DE
 562where \fBXX\fP is the type and \fB#\fP is the logical drive number; e.g.
 563.Pn /dev/rsd0d
 564or
 565.Pn /dev/rrd0d .
 566Note the explicit use of the ``d'' partition.
 567This partition includes the bootblock as does ``c''
 568and using it allows you to change the size of ``c''.
 569.PP
 570If you wish to label any additional disks, run the following command for each:
 571.DS
 572\fB#\|\fP\fIdisklabel  -rw  \fBXX#  type\fP  \fI"optional_pack_name"\fP
 573.DE
 574where \fBXX#\fP is the same as in the previous command
 575and \fBtype\fP is the HP300 disk device name as listed in
 576.Pn /etc/disktab .
 577The optional information may contain any descriptive name for the
 578contents of a disk, and may be up to 16 characters long.  This procedure
 579will place the label on the disk using the information found in
 580.Pn /etc/disktab
 581for the disk type named.
 582If you have changed the disk partition sizes,
 583you may wish to add entries for the modified configuration in
 584.Pn /etc/disktab
 585before labeling the affected disks.
 586.PP
 587You have now completed the HP300 specific part of the installation.
 588Now proceed to the generic part of the installation
 589described starting in section 2.5 below.
 590Note that where the disk name ``sd'' is used throughout section 2.5,
 591you should substitute the name ``rd'' if you are running on an HP-IB disk.
 592Also, if you are loading on a single disk with the default disklabel,
 593.Pn /var
 594should be restored to the ``f'' partition and
 595.Pn /usr
 596to the ``e'' partition.
 597.Sh 2 "Booting the SPARC"
 598.Sh 3 "Supported hardware"
 599.LP
 600The hardware supported by \*(4B for the SPARC is as follows:
 601.TS
 602center box;
 603lw(1i) lw(4i).
 604CPU's	T{
 605SPARCstation 1 series (1, 1+, SLC, IPC) and
 606SPARCstation 2 series (2, IPX).
 607T}
 608_
 609DISK's	T{
 610SCSI.
 611T}
 612_
 613TAPE's	T{
 614none.
 615T}
 616_
 617NETWORK	T{
 618SPARCstation Lance (le).
 619T}
 620_
 621GRAPHICS	T{
 622bwtwo and cgthree.
 623T}
 624_
 625INPUT	T{
 626Keyboard and mouse.
 627T}
 628_
 629MISC	T{
 630Battery-backed real time clock,
 631built-in serial devices,
 632Sbus SCSI controller,
 633and audio device.
 634T}
 635.TE
 636.LP
 637Major items that are not supported include
 638anything VME-based,
 639the GX (cgsix) display,
 640the floppy disk, and SCSI tapes.
 641.Sh 3 "Limitations"
 642.LP
 643There are several important limitations on the \*(4B distribution
 644for the SPARC:
 645.IP 1)
 646You
 647.B must
 648have SunOS 4.1.x or Solaris to bring up \*(4B.
 649There is no SPARCstation bootstrap code in this distribution.  The
 650Sun-supplied boot loader will be used to boot \*(4B; you must copy
 651this from your SunOS distribution.  This imposes several
 652restrictions on the system, as detailed below.
 653.IP 2)
 654The \*(4B SPARC kernel does not remap SCSI IDs.  A SCSI disk at
 655target 0 will become ``sd0'', where in SunOS the same disk will
 656normally be called ``sd3''.  If your existing SunOS system is
 657diskful, it will be least painful to have SunOS running on the disk
 658on target 0 lun 0 and put \*(4B on the disk on target 3 lun 0.  Both
 659systems will then think they are running on ``sd0'', and you can
 660boot either system as needed simply by changing the EEPROM's boot
 661device.
 662.IP 3)
 663There is no SCSI tape driver.
 664You must have another system for tape reading and backups.
 665.IP 4)
 666Although the \*(4B SPARC kernel will handle existing SunOS shared
 667libraries, it does not use or create them itself, and therefore
 668requires much more disk space than SunOS does.
 669.IP 5)
 670It is currently difficult (though not completely impossible) to
 671run \*(4B diskless.  These instructions assume you will have a local
 672boot, swap, and root filesystem.
 673.IP 6)
 674When using a serial port rather than a graphics display as the console,
 675only port
 676.Pn ttya
 677can be used.
 678Attempts to use port
 679.Pn ttyb
 680will fail when the kernel tries
 681to print the boot up messages to the console.
 682.Sh 3 "The procedure"
 683.PP
 684You must have a spare disk on which to place \*(4B.
 685The steps involved in bootstrapping this tape are as follows:
 686.IP 1)
 687Bring up SunOS (preferably SunOS 4.1.x or Solaris 1.x, although
 688Solaris 2 may work \(em this is untested).
 689.IP 2)
 690Attach auxiliary SCSI disk(s).  Format and label using the
 691SunOS formatting and labeling programs as needed.
 692Note that the root filesystem currently requires at least 10 MB; 16 MB
 693or more is recommended.  The b partition will be used for swap;
 694this should be at least 32 MB.
 695.IP 3)
 696Use the SunOS
 697.Xr newfs
 698to build the root filesystem.  You may also
 699want to build other filesystems at the same time.  (By default, the
 700\*(4B
 701.Xr newfs
 702builds a filesystem that SunOS will not handle; if you
 703plan to switch OSes back and forth you may want to sacrifice the
 704performance gain from the new filesystem format for compatibility.)
 705You can build an old-format filesystem on \*(4B by giving the \-O
 706option to
 707.Xr newfs (8).
 708.Xr Fsck (8)
 709can convert old format filesystems to new format
 710filesystems, but not vice versa,
 711so you may want to initially build old format filesystems so that they
 712can be mounted under SunOS,
 713and then later convert them to new format filesystems when you are
 714satisfied that \*(4B is running properly.
 715In any case,
 716.B
 717you must build an old-style root filesystem
 718.R
 719so that the SunOS boot program will work.
 720.IP 4)
 721Mount the new root, then copy the SunOS
 722.Pn /boot
 723into place and use the SunOS ``installboot'' program
 724to enable disk-based booting.
 725Note that the filesystem must be mounted when you do the ``installboot'':
 726.DS
 727.ft CW
 728# mount /dev/sd3a /mnt
 729# cp /boot /mnt/boot
 730# cd /usr/kvm/mdec
 731# installboot /mnt/boot bootsd /dev/rsd3a
 732.DE
 733The SunOS
 734.Pn /boot
 735will load \*(4B kernels; there is no SPARCstation
 736bootstrap code on the distribution.  Note that the SunOS
 737.Pn /boot
 738does not handle the new \*(4B filesystem format.
 739.IP 5)
 740Restore the contents of the \*(4B root filesystem.
 741.DS
 742.ft CW
 743# cd /mnt
 744# rrestore xf tapehost:/dev/nrst0
 745.DE
 746.IP 6)
 747Boot the supplied kernel:
 748.DS
 749.ft CW
 750# halt
 751ok boot sd(0,3)kernel -s		[for old proms] OR
 752ok boot disk3 -s			[for new proms]
 753\&... [\*(4B boot messages]
 754.DE
 755.LP
 756To install the remaining filesystems, use the procedure described
 757starting in section 2.5.
 758In these instructions,
 759.Pn /usr
 760should be loaded into the ``e'' partition and
 761.Pn /var
 762in the ``f'' partition.
 763.LP
 764After completing the filesystem installation you may want
 765to set up \*(4B to reboot automatically:
 766.DS
 767.ft CW
 768# halt
 769ok setenv boot-from sd(0,3)kernel	[for old proms] OR
 770ok setenv boot-device disk3		[for new proms]
 771.DE
 772If you build backwards-compatible filesystems, either with the SunOS
 773newfs or with the \*(4B ``\-O'' option, you can mount these under
 774SunOS.  The SunOS fsck will, however, always think that these filesystems
 775are corrupted, as there are several new (previously unused)
 776superblock fields that are updated in \*(4B.  Running ``fsck \-b32''
 777and letting it ``fix'' the superblock will take care of this.
 778.sp 0.5
 779If you wish to run SunOS binaries that use SunOS shared libraries, you
 780simply need to copy all the dynamic linker files from an existing
 781SunOS system:
 782.DS
 783.ft CW
 784# rcp sunos-host:/etc/ld.so.cache /etc/
 785# rcp sunos-host:'/usr/lib/*.so*' /usr/lib/
 786.DE
 787The SunOS compiler and linker should be able to produce SunOS binaries
 788under \*(4B, but this has not been tested.  If you plan to try it you
 789will need the appropriate .sa files as well.
 790.Sh 2 "Booting the DECstation"
 791.Sh 3 "Supported hardware"
 792.LP
 793The hardware supported by \*(4B for the DECstation is as follows:
 794.TS
 795center box;
 796lw(1i) lw(4i).
 797CPU's	T{
 798R2000 based (3100) and
 799R3000 based (5000/200, 5000/20, 5000/25, 5000/1xx).
 800T}
 801_
 802DISK's	T{
 803SCSI-I (tested RZ23, RZ55, RZ57, Maxtor 8760S).
 804T}
 805_
 806TAPE's	T{
 807SCSI-I (tested DEC TK50, Archive DAT, Emulex MT02).
 808T}
 809_
 810RS232	T{
 811Internal DEC dc7085 and AMD 8530 based interfaces.
 812T}
 813_
 814NETWORK	T{
 815TURBOchannel PMAD-AA and internal LANCE based interfaces.
 816T}
 817_
 818GRAPHICS	T{
 819Terminal emulation and raw frame buffer support for
 8203100 (color & monochrome),
 821TURBOchannel PMAG-AA, PMAG-BA, PMAG-DV.
 822T}
 823_
 824INPUT	T{
 825Standard DEC keyboard (LK201) and mouse.
 826T}
 827_
 828MISC	T{
 829Battery-backed real time clock,
 830internal and TURBOchannel PMAZ-AA SCSI interfaces.
 831T}
 832.TE
 833.LP
 834Major items that are not supported include the 5000/240
 835(there is code but not compiled in or tested),
 836R4000 based machines, FDDI and audio interfaces.
 837Diskless machines are not supported but booting kernels and bootstrapping
 838over the network is supported on the 5000 series.
 839.Sh 3 "The procedure"
 840.PP
 841The first file on the distribution tape is a tar file that contains
 842four files.
 843The first step requires a running UNIX (or ULTRIX) system that can
 844be used to extract the tar archive from the first file on the tape.
 845The command:
 846.DS
 847.ft CW
 848tar xf /dev/rmt0
 849.DE
 850will extract the following four files:
 851.DS
 852A) root.image: \fIdd\fP image of the root filesystem
 853B) kernel.tape: \fIdd\fP image for creating boot tapes
 854C) kernel.net: file for booting over the network
 855D) root.dump: \fIdump\fP image of the root filesystem
 856.DE
 857There are three basic ways a system can be bootstrapped corresponding to the
 858first three files.
 859You may want to read the section on bootstrapping the HP300
 860since many of the steps are similar.
 861A spare, formatted SCSI disk is also useful.
 862.Sh 4 "Procedure A: copy root filesystem to disk"
 863.PP
 864This procedure is similar to the HP300.
 865If you have an extra disk, the easiest approach is to use \fIdd\fP\|(1)
 866under ULTRIX to copy the root filesystem image to the beginning
 867of the spare disk. 
 868The root filesystem image includes a disklabel and bootblock along with the
 869root filesystem.
 870An example command to copy the image to the beginning of a disk is:
 871.DS
 872.ft CW
 873dd if=root.image of=/dev/rz1c bs=\*(Bzb
 874.DE
 875The actual special file syntax will vary depending on unit numbers and
 876the version of ULTRIX that is running.
 877This system is now ready to boot. You can boot the kernel with one of the
 878following PROM commands. If you are booting on a 3100, the disk must be SCSI
 879id zero because of a bug.
 880.DS
 881.ft CW
 882DEC 3100:    boot \-f rz(0,0,0)kernel
 883DEC 5000:    boot 5/rz0/kernel
 884.DE
 885You can then proceed to section 2.5
 886to create reasonable disk partitions for your machine
 887and then install the rest of the system.
 888.Sh 4 "Procedure B: bootstrap from tape"
 889.PP
 890If you have only a single machine with a single disk,
 891you need to use the more difficult approach of booting a
 892kernel and mini-root from tape or the network, and using it to restore
 893the root filesystem.
 894.PP
 895First, you will need to create a boot tape. This can be done using
 896\fIdd\fP as in the following example.
 897.DS
 898.ft CW
 899dd if=kernel.tape of=/dev/nrmt0 bs=1b
 900dd if=root.dump of=/dev/nrmt0 bs=\*(Bzb
 901.DE
 902The actual special file syntax for the tape drive will vary depending on
 903unit numbers, tape device and the version of ULTRIX that is running.
 904.PP
 905The first file on the boot tape contains a boot header, kernel, and
 906mini-root filesystem that the PROM can copy into memory.
 907Installing from tape has only been tested
 908on a 3100 and a 5000/200 using a TK50 tape drive. Here are two example
 909PROM commands to boot from tape.
 910.DS
 911.ft CW
 912DEC 3100:    boot \-f tz(0,5,0) m    # 5 is the SCSI id of the TK50
 913DEC 5000:    boot 5/tz6 m           # 6 is the SCSI id of the TK50
 914.DE
 915The `m' argument tells the kernel to look for a root filesystem in memory.
 916Next you should proceed to section 2.4.3 to build a disk-based root filesystem.
 917.Sh 4 "Procedure C: bootstrap over the network"
 918.PP
 919You will need a host machine that is running the \fIbootp\fP server 
 920with the
 921.Pn kernel.net
 922file installed in the default directory defined by the
 923configuration file for
 924.Xr bootp .
 925Here are two example PROM commands to boot across the net:
 926.DS
 927.ft CW
 928DEC 3100:	boot \-f tftp()kernel.net m
 929DEC 5000:	boot 6/tftp/kernel.net m
 930.DE
 931This command should load the kernel and mini-root into memory and
 932run the same as the tape install (procedure B).
 933The rest of the steps are the same except
 934you will need to start the network
 935(if you are unsure how to fill in the <name> fields below,
 936see sections 4.4 and 5).
 937Execute the following to start the networking:
 938.DS
 939.ft CW
 940# mount \-uw /
 941# echo 127.0.0.1 localhost >> /etc/hosts
 942# echo <your.host.inet.number> myname.my.domain myname >> /etc/hosts
 943# echo <friend.host.inet.number> myfriend.my.domain myfriend >> /etc/hosts
 944# ifconfig le0 inet myname
 945.DE
 946Next you should proceed to section 2.4.3 to build a disk-based root filesystem.
 947.Sh 3 "Label disk and create the root filesystem"
 948.LP
 949There are five steps to create a disk-based root filesystem.
 950.IP 1)
 951Label the disk.
 952.DS
 953.ft CW
 954# disklabel -W /dev/rrz?c		# This enables writing the label
 955# disklabel -w -r -B /dev/rrz?c $DISKTYPE
 956# newfs /dev/rrz?a
 957\&...
 958# fsck /dev/rrz?a
 959\&...
 960.DE
 961Supported disk types are listed in
 962.Pn /etc/disktab .
 963.IP 2)
 964Restore the root filesystem.
 965.DS
 966.ft CW
 967# mount \-uw /
 968# mount /dev/rz?a /a
 969# cd /a
 970.DE
 971.ti +0.4i
 972If you are restoring locally (procedure B), run:
 973.DS
 974.ft CW
 975# mt \-f /dev/nrmt0 rew
 976# restore \-xsf 2 /dev/rmt0
 977.DE
 978.ti +0.4i
 979If you are restoring across the net (procedure c), run:
 980.DS
 981.ft CW
 982# rrestore xf myfriend:/path/to/root.dump
 983.DE
 984.ti +0.4i
 985When the restore finishes, clean up with:
 986.DS
 987.ft CW
 988# cd /
 989# sync
 990# umount /a
 991# fsck /dev/rz?a
 992.DE
 993.IP 3)
 994Reset the system and initialize the PROM monitor to boot automatically.
 995.DS
 996.ft CW
 997DEC 3100:	setenv bootpath boot \-f rz(0,?,0)kernel
 998DEC 5000:	setenv bootpath 5/rz?/kernel -a
 999.DE
1000.IP 4)
1001After booting UNIX, you will need to create
1002.Pn /dev/mouse
1003to run X Window System as in the following example.
1004.DS
1005.ft CW
1006rm /dev/mouse
1007ln /dev/xx /dev/mouse
1008.DE
1009The 'xx' should be one of the following:
1010.DS
1011pm0	raw interface to PMAX graphics devices
1012cfb0	raw interface to TURBOchannel PMAG-BA color frame buffer
1013xcfb0	raw interface to maxine graphics devices
1014mfb0	raw interface to mono graphics devices
1015.DE
1016You can then proceed to section 2.5 to install the rest of the system.
1017Note that where the disk name ``sd'' is used throughout section 2.5,
1018you should substitute the name ``rz''.
1019.Sh 2 "Disk configuration"
1020.PP
1021All architectures now have a root filesystem up and running and
1022proceed from this point to layout filesystems to make use
1023of the available space and to balance disk load for better system
1024performance.
1025.Sh 3 "Disk naming and divisions"
1026.PP
1027Each physical disk drive can be divided into up to 8 partitions;
1028UNIX typically uses only 3 or 4 partitions.
1029For instance, the first partition, \*(Dk0a,
1030is used for a root filesystem, a backup thereof,
1031or a small filesystem like,
1032.Pn /var/tmp ;
1033the second partition, \*(Dk0b,
1034is used for paging and swapping; and
1035a third partition, typically \*(Dk0e,
1036holds a user filesystem.
1037.PP
1038The space available on a disk varies per device.
1039Each disk typically has a paging area of 30 to 100 megabytes
1040and a root filesystem of about 17 megabytes.
1041.\" XXX check
1042The distributed system binaries occupy about 150 (180 with X11R5) megabytes
1043.\" XXX check
1044while the major sources occupy another 250 (340 with X11R5) megabytes.
1045The
1046.Pn /var
1047filesystem as delivered on the tape is only 2Mb,
1048however it should have at least 50Mb allocated to it just for
1049normal system activity.
1050Usually it is allocated the last partition on the disk
1051so that it can provide as much space as possible to the
1052.Pn /var/users
1053filesystem.
1054See section 2.5.4 for further details on disk layouts.
1055.PP
1056Be aware that the disks have their sizes
1057measured in disk sectors (usually 512 bytes), while the UNIX filesystem
1058blocks are variable sized.
1059If
1060.Sm BLOCKSIZE=1k
1061is set in the user's environment, all user programs report
1062disk space in kilobytes, otherwise,
1063disk sizes are always reported in units of 512-byte sectors\**.
1064.FS
1065You can thank System V intransigence and POSIX duplicity for
1066requiring that 512-byte blocks be the units that programs report.
1067.FE
1068The
1069.Pn /etc/disktab
1070file used in labelling disks and making filesystems
1071specifies disk partition sizes in sectors.
1072.Sh 3 "Layout considerations"
1073.PP
1074There are several considerations in deciding how
1075to adjust the arrangement of things on your disks.
1076The most important is making sure that there is adequate space
1077for what is required; secondarily, throughput should be maximized.
1078Paging space is an important parameter.
1079The system, as distributed, sizes the configured
1080paging areas each time the system is booted.  Further,
1081multiple paging areas of different sizes may be interleaved.
1082.PP
1083Many common system programs (C, the editor, the assembler etc.)
1084create intermediate files in the
1085.Pn /tmp
1086directory, so the filesystem where this is stored also should be made
1087large enough to accommodate most high-water marks.
1088Typically,
1089.Pn /tmp
1090is constructed from a memory-based filesystem (see
1091.Xr mount_mfs (8)).
1092Programs that want their temporary files to persist
1093across system reboots (such as editors) should use
1094.Pn /var/tmp .
1095If you plan to use a disk-based
1096.Pn /tmp
1097filesystem to avoid loss across system reboots, it makes
1098sense to mount this in a ``root'' (i.e. first partition)
1099filesystem on another disk.
1100All the programs that create files in
1101.Pn /tmp
1102take care to delete them, but are not immune to rare events
1103and can leave dregs.
1104The directory should be examined every so often and the old
1105files deleted.
1106.PP
1107The efficiency with which UNIX is able to use the CPU
1108is often strongly affected by the configuration of disk controllers;
1109it is critical for good performance to balance disk load.
1110There are at least five components of the disk load that you can
1111divide between the available disks:
1112.IP 1)
1113The root filesystem.
1114.IP 2)
1115The
1116.Pn /var
1117and
1118.Pn /var/tmp
1119filesystems.
1120.IP 3)
1121The
1122.Pn /usr
1123filesystem.
1124.IP 4)
1125The user filesystems.
1126.IP 5)
1127The paging activity.
1128.LP
1129The following possibilities are ones we have used at times
1130when we had 2, 3 and 4 disks:
1131.TS
1132center doublebox;
1133l | c s s
1134l | lw(5) | lw(5) | lw(5).
1135	disks
1136what	2	3	4
1137_
1138root	0	0	0
1139var	1	2	3
1140usr	1	1	1
1141paging	0+1	0+2	0+2+3
1142users	0	0+2	0+2
1143archive	x	x	3
1144.TE
1145.PP
1146The most important things to consider are to
1147even out the disk load as much as possible, and to do this by
1148decoupling filesystems (on separate arms) between which heavy copying occurs.
1149Note that a long term average balanced load is not important; it is
1150much more important to have an instantaneously balanced
1151load when the system is busy.
1152.PP
1153Intelligent experimentation with a few filesystem arrangements can
1154pay off in much improved performance.  It is particularly easy to
1155move the root, the
1156.Pn /var
1157and
1158.Pn /var/tmp
1159filesystems and the paging areas.  Place the
1160user files and the
1161.Pn /usr
1162directory as space needs dictate and experiment
1163with the other, more easily moved filesystems.
1164.Sh 3 "Filesystem parameters"
1165.PP
1166Each filesystem is parameterized according to its block size,
1167fragment size, and the disk geometry characteristics of the
1168medium on which it resides.  Inaccurate specification of the disk
1169characteristics or haphazard choice of the filesystem parameters
1170can result in substantial throughput degradation or significant
1171waste of disk space.  As distributed,
1172filesystems are configured according to the following table.
1173.DS
1174.TS
1175center;
1176l l l.
1177Filesystem	Block size	Fragment size
1178_
1179root	8 kbytes	1 kbytes
1180usr	8 kbytes	1 kbytes
1181users	4 kbytes	512 bytes
1182.TE
1183.DE
1184.PP
1185The root filesystem block size is
1186made large to optimize bandwidth to the associated disk.
1187The large block size is important as many of the most
1188heavily used programs are demand paged out of the
1189.Pn /bin
1190directory.
1191The fragment size of 1 kbyte is a ``nominal'' value to use
1192with a filesystem.  With a 1 kbyte fragment size
1193disk space utilization is about the same
1194as with the earlier versions of the filesystem.
1195.PP
1196The filesystems for users have a 4 kbyte block
1197size with 512 byte fragment size.  These parameters
1198have been selected based on observations of the
1199performance of our user filesystems.  The 4 kbyte
1200block size provides adequate bandwidth while the
1201512 byte fragment size provides acceptable space compaction
1202and disk fragmentation.
1203.PP
1204Other parameters may be chosen in constructing filesystems,
1205but the factors involved in choosing a block
1206size and fragment size are many and interact in complex
1207ways.  Larger block sizes result in better
1208throughput to large files in the filesystem as
1209larger I/O requests will then be done by the
1210system.  However,
1211consideration must be given to the average file sizes
1212found in the filesystem and the performance of the
1213internal system buffer cache.   The system
1214currently provides space in the inode for
121512 direct block pointers, 1 single indirect block
1216pointer, 1 double indirect block pointer,
1217and 1 triple indirect block pointer.
1218If a file uses only direct blocks, access time to
1219it will be optimized by maximizing the block size.
1220If a file spills over into an indirect block,
1221increasing the block size of the filesystem may
1222decrease the amount of space used
1223by eliminating the need to allocate an indirect block.
1224However, if the block size is increased and an indirect
1225block is still required, then more disk space will be
1226used by the file because indirect blocks are allocated
1227according to the block size of the filesystem.
1228.PP
1229In selecting a fragment size for a filesystem, at least
1230two considerations should be given.  The major performance
1231tradeoffs observed are between an 8 kbyte block filesystem
1232and a 4 kbyte block filesystem.  Because of implementation
1233constraints, the block size versus fragment size ratio can not
1234be greater than 8.  This means that an 8 kbyte filesystem
1235will always have a fragment size of at least 1 kbytes.  If
1236a filesystem is created with a 4 kbyte block size and a
12371 kbyte fragment size, then upgraded to an 8 kbyte block size
1238and 1 kbyte fragment size, identical space compaction will be
1239observed.  However, if a filesystem has a 4 kbyte block size
1240and 512 byte fragment size, converting it to an 8K/1K
1241filesystem will result in 4-8% more space being
1242used.  This implies that 4 kbyte block filesystems that
1243might be upgraded to 8 kbyte blocks for higher performance should
1244use fragment sizes of at least 1 kbytes to minimize the amount
1245of work required in conversion.
1246.PP
1247A second, more important, consideration when selecting the
1248fragment size for a filesystem is the level of fragmentation
1249on the disk.  With an 8:1 fragment to block ratio, storage fragmentation
1250occurs much sooner, particularly with a busy filesystem running
1251near full capacity.  By comparison, the level of fragmentation in a
12524:1 fragment to block ratio filesystem is one tenth as severe.  This
1253means that on filesystems where many files are created and
1254deleted, the 512 byte fragment size is more likely to result in apparent
1255space exhaustion because of fragmentation.  That is, when the filesystem
1256is nearly full, file expansion that requires locating a
1257contiguous area of disk space is more likely to fail on a 512
1258byte filesystem than on a 1 kbyte filesystem.  To minimize
1259fragmentation problems of this sort, a parameter in the super
1260block specifies a minimum acceptable free space threshold.  When
1261normal users (i.e. anyone but the super-user) attempt to allocate
1262disk space and the free space threshold is exceeded, the user is
1263returned an error as if the filesystem were really full.  This
1264parameter is nominally set to 5%; it may be changed by supplying
1265a parameter to
1266.Xr newfs (8),
1267or by updating the super block of an existing filesystem using
1268.Xr tunefs (8).
1269.PP
1270Finally, a third, less common consideration is the attributes of
1271the disk itself.  The fragment size should not be smaller than the
1272physical sector size of the disk.  As an example, the HP magneto-optical
1273disks have 1024 byte physical sectors.  Using a 512 byte fragment size
1274on such disks will work but is extremely inefficient.
1275.PP
1276Note that the above discussion considers block sizes of up to only 8k.
1277As of the 4.4 release, the maximum block size has been increased to 64k.
1278This allows an entirely new set of block/fragment combinations for which
1279there is little experience to date.
1280In general though, unless a filesystem is to be used
1281for a special purpose application (for example, storing
1282image processing data), we recommend using the
1283values supplied above.
1284Remember that the current
1285implementation limits the block size to at most 64 kbytes
1286and the ratio of block size versus fragment size must be 1, 2, 4, or 8.
1287.PP
1288The disk geometry information used by the filesystem
1289affects the block layout policies employed.  The file
1290.Pn /etc/disktab ,
1291as supplied, contains the data for most
1292all drives supported by the system.  Before constructing
1293a filesystem with
1294.Xr newfs (8)
1295you should label the disk (if it has not yet been labeled,
1296and the driver supports labels).
1297If labels cannot be used, you must instead
1298specify the type of disk on which the filesystem resides;
1299.Xr newfs
1300then reads
1301.Pn /etc/disktab
1302instead of the pack label.
1303This file also contains the default
1304filesystem partition
1305sizes, and default block and fragment sizes.  To
1306override any of the default values you can modify the file,
1307edit the disk label,
1308or use an option to
1309.Xr newfs .
1310.Sh 3 "Implementing a layout"
1311.PP
1312To put a chosen disk layout into effect, you should use the
1313.Xr newfs (8)
1314command to create each new filesystem.
1315Each filesystem must also be added to the file
1316.Pn /etc/fstab
1317so that it will be checked and mounted when the system is bootstrapped.
1318.PP
1319First we will consider a system with a single disk.
1320There is little real choice on how to do the layout;
1321the root filesystem goes in the ``a'' partition,
1322.Pn /usr
1323goes in the ``e'' partition, and
1324.Pn /var
1325fills out the remainder of the disk in the ``f'' partition.
1326This is the organization used if you loaded the disk-image root filesystem.
1327With the addition of a memory-based
1328.Pn /tmp
1329filesystem, its fstab entry would be as follows:
1330.TS
1331center;
1332lfC lfC l l n n.
1333/dev/\*(Dk0a	/	ufs	rw	1	1
1334/dev/\*(Dk0b	none	swap	sw	0	0
1335/dev/\*(Dk0b	/tmp	mfs	rw,-s=14000,-b=8192,-f=1024,-T=sd660	0	0
1336/dev/\*(Dk0e	/usr	ufs	ro	1	2
1337/dev/\*(Dk0f	/var	ufs	rw	1	2
1338.TE
1339.PP
1340If we had a second disk, we would split the load between the drives.
1341On the second disk, we place the
1342.Pn /usr
1343and
1344.Pn /var
1345filesystems in their usual \*(Dk1e and \*(Dk1f
1346partitions respectively.
1347The \*(Dk1b partition would be used as a second paging area,
1348and the \*(Dk1a partition left as a spare root filesystem
1349(alternatively \*(Dk1a could be used for
1350.Pn /var/tmp ).
1351The first disk still holds the
1352the root filesystem in \*(Dk0a, and the primary swap area in \*(Dk0b.
1353The \*(Dk0e partition is used to hold home directories in
1354.Pn /var/users .
1355The \*(Dk0f partition can be used for
1356.Pn /usr/src
1357or alternately the \*(Dk0e partition can be extended to cover
1358the rest of the disk with
1359.Xr disklabel (8).
1360As before, the
1361.Pn /tmp
1362directory is a memory-based filesystem.
1363Note that to interleave the paging between the two disks
1364you must build a system configuration that specifies:
1365.DS
1366config	kernel	root on \*(Dk0 swap on \*(Dk0 and \*(Dk1
1367.DE
1368The
1369.Pn /etc/fstab
1370file would then contain
1371.TS
1372center;
1373lfC lfC l l n n.
1374/dev/\*(Dk0a	/	ufs	rw	1	1
1375/dev/\*(Dk0b	none	swap	sw	0	0
1376/dev/\*(Dk1b	none	swap	sw	0	0
1377/dev/\*(Dk0b	/tmp	mfs	rw,-s=14000,-b=8192,-f=1024,-T=sd660	0	0
1378/dev/\*(Dk1e	/usr	ufs	ro	1	2
1379/dev/\*(Dk0f	/usr/src	ufs	rw	1	2
1380/dev/\*(Dk1f	/var	ufs	rw	1	2
1381/dev/\*(Dk0e	/var/users	ufs	rw	1	2
1382.TE
1383.PP
1384To make the
1385.Pn /var
1386filesystem we would do:
1387.DS
1388\fB#\fP \fIdisklabel -wr \*(Dk1 "disk type" "disk name"\fP
1389\fB#\fP \fInewfs \*(Dk1f\fP
1390(information about filesystem prints out)
1391\fB#\fP \fImkdir /var\fP
1392\fB#\fP \fImount /dev/\*(Dk1f /var\fP
1393.DE
1394.Sh 2 "Installing the rest of the system"
1395.PP
1396At this point you should have your disks partitioned.
1397The next step is to extract the rest of the data from the tape.
1398At a minimum you need to set up the
1399.Pn /var
1400and
1401.Pn /usr
1402filesystems.
1403You may also want to extract some or all the program sources.
1404Since not all architectures support tape drives or don't support the
1405correct ones, you may need to extract the files indirectly using
1406.Xr rsh (1).
1407For example, for a directly connected tape drive you might do:
1408.DS
1409\fB#\fP \fImt -f /dev/nr\*(Mt0 fsf\fP
1410\fB#\fP \fItar xbpf \*(Bz /dev/nr\*(Mt0\fP
1411.DE
1412The equivalent indirect procedure (where the tape drive is on machine ``foo'')
1413is:
1414.DS
1415\fB#\fP \fIrsh foo mt -f /dev/nr\*(Mt0 fsf\fP
1416\fB#\fP \fIrsh foo dd if=/dev/nr\*(Mt0 bs=\*(Bzb | tar xbpf \*(Bz -\fP
1417.DE
1418Obviously, the target machine must be connected to the local network
1419for this to work.
1420To do this:
1421.DS
1422\fB#\fP \fIecho  127.0.0.1  localhost >> /etc/hosts\fP
1423\fB#\fP \fIecho  \fPyour.host.inet.number  myname.my.domain  myname\fI >> /etc/hosts\fP
1424\fB#\fP \fIecho  \fPfriend.host.inet.number  myfriend.my.domain  myfriend\fI >> /etc/hosts\fP
1425\fB#\fP \fIifconfig  le0  inet  \fPmyname
1426.DE
1427where the ``host.inet.number'' fields are the IP addresses for your host and
1428the host with the tape drive
1429and the ``my.domain'' fields are the names of your machine and the tape-hosting
1430machine.
1431See sections 4.4 and 5 for more information on setting up the network.
1432.PP
1433Assuming a directly connected tape drive, here is how to extract and
1434install
1435.Pn /var
1436and
1437.Pn /usr :
1438.br
1439.ne 5
1440.TS
1441lw(2i) l.
1442\fB#\fP \fImount \-uw /dev/\*(Dk#a /\fP	(read-write mount root filesystem)
1443\fB#\fP \fIdate yymmddhhmm\fP	(set date, see \fIdate\fP\|(1))
1444\&....
1445\fB#\fP \fIpasswd -l root\fP	(set password for super-user)
1446\fBNew password:\fP	(password will not echo)
1447\fBRetype new password:\fP
1448\fB#\fP \fIpasswd -l toor\fP	(set password for super-user)
1449\fBNew password:\fP	(password will not echo)
1450\fBRetype new password:\fP
1451\fB#\fP \fIhostname mysitename\fP	(set your hostname)
1452\fB#\fP \fInewfs r\*(Dk#p\fP	(create empty user filesystem)
1453(\fI\*(Dk\fP is the disk type, \fI#\fP is the unit number,
1454\fIp\fP is the partition; this takes a few minutes)
1455\fB#\fP \fImount /dev/\*(Dk#p /var\fP	(mount the var filesystem)
1456\fB#\fP \fIcd /var\fP	(make /var the current directory)
1457\fB#\fP \fImt -f /dev/nr\*(Mt0 fsf\fP	(space to end of previous tape file)
1458\fB#\fP \fItar xbpf \*(Bz /dev/nr\*(Mt0\fP	(extract all of var)
1459(this takes a few minutes)
1460\fB#\fP \fInewfs r\*(Dk#p\fP	(create empty user filesystem)
1461(as before \fI\*(Dk\fP is the disk type, \fI#\fP is the unit number,
1462\fIp\fP is the partition)
1463\fB#\fP \fImount /dev/\*(Dk#p /mnt\fP	(mount the new /usr in temporary location)
1464\fB#\fP \fIcd /mnt\fP	(make /mnt the current directory)
1465\fB#\fP \fImt -f /dev/nr\*(Mt0 fsf\fP	(space to end of previous tape file)
1466\fB#\fP \fItar xbpf \*(Bz /dev/nr\*(Mt0\fP	(extract all of usr except usr/src)
1467(this takes about 15-20 minutes)
1468\fB#\fP \fIcd /\fP	(make / the current directory)
1469\fB#\fP \fIumo…

Large files files are truncated, but you can click here to view the full file