PageRenderTime 54ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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