Commit | Line | Data |
---|---|---|
74d4a75b CH |
1 | .TL |
2 | Setting Up | |
3 | Unix | |
4 | \- Seventh Edition | |
5 | .AU | |
6 | Charles B. Haley | |
7 | Dennis M. Ritchie | |
8 | .AI | |
9 | .MH | |
10 | .PP | |
11 | The distribution tape can be used only on a DEC PDP11/45 | |
12 | or PDP11/70 with RP03, RP04, RP05, RP06 disks and with | |
13 | a TU10, TU16, or TE16 tape drive. | |
14 | It consists of some preliminary bootstrapping programs followed by | |
15 | two file system images; | |
16 | if needed, after the initial construction of the file systems | |
17 | individual files can be extracted. (See restor(1)) | |
18 | .PP | |
19 | If you are set up to do it, | |
20 | it might be a good idea immediately to make a copy of the | |
21 | tape to guard against disaster. | |
22 | The tape is 9-track 800 BPI and contains some 512-byte records | |
23 | followed by many 10240-byte records. | |
24 | There are interspersed tapemarks. | |
25 | .PP | |
26 | The system as distributed contains binary images | |
27 | of the system and all the user level programs, along with source | |
28 | and manual sections for them\(emabout | |
29 | 2100 files altogether. | |
30 | The binary images, | |
31 | along with other | |
32 | things needed to flesh out the file system enough so UNIX will run, | |
33 | are to be put on one file system called the `root file system'. | |
34 | The file system size required is about 5000 blocks. | |
35 | The file second system has all of the source and documentation. | |
36 | Altogether it amounts to more than 18,000 512-byte blocks. | |
37 | .SH | |
38 | Making a Disk From Tape | |
39 | .PP | |
40 | Perform the following bootstrap procedure to obtain | |
41 | a disk with a root file system on it. | |
42 | .IP 1. | |
43 | Mount the magtape on drive 0 at load point. | |
44 | .IP 2. | |
45 | Mount a formatted disk pack on drive 0. | |
46 | .IP 3. | |
47 | Key in and execute at 100000 | |
48 | .RT | |
49 | .DS | |
50 | TU10 TU16/TE16 | |
51 | 012700 Use the DEC ROM or other | |
52 | 172526 means to load block 1 | |
53 | 010040 (i.e. second block) at 800 BPI | |
54 | 012740 into location 0 and transfer | |
55 | 060003 to 0. | |
56 | 000777 | |
57 | .DE | |
58 | .IP | |
59 | The tape should move and the CPU loop. | |
60 | (The TU10 code is | |
61 | .I | |
62 | not | |
63 | .R | |
64 | the DEC bulk ROM for tape; | |
65 | it reads block 0, not block 1.) | |
66 | .IP 4. | |
67 | If you used the above TU10 code, halt and restart the | |
68 | CPU at 0, otherwise continue to the next step. | |
69 | .IP 5. | |
70 | The console should type | |
71 | .DS | |
72 | .I | |
73 | Boot | |
74 | : | |
75 | .R | |
76 | .DE | |
77 | Copy the magtape to disk by the following procedure. | |
78 | The machine's printouts are shown in italic, | |
79 | explanatory comments are within ( ). | |
80 | Terminate each line you type by carriage return or line-feed. | |
81 | There are two classes of tape drives: | |
82 | the name `tm' is used for the TU10, and `ht' is used for | |
83 | the TU16 or TE16. | |
84 | There are also two classes of disks: | |
85 | `rp' is used for the RP03, and `hp' is used for the | |
86 | RP04/5/6. | |
87 | .PP | |
88 | If you should make a mistake while typing, the character '#' | |
89 | erases the last character typed up to the beginning of the line, | |
90 | and the character '@' erases the entire line typed. | |
91 | Some consoles cannot print lower case letters, adjust the | |
92 | instructions accordingly. | |
93 | .DS | |
94 | (bring in the program mkfs) | |
95 | \fI:\|\fRtm(0,3) (use `ht(0,3)' for the TU16/TE16) | |
96 | \fIfile system size:\fR 5000 | |
97 | \fIfile system:\fR rp(0,0) (use `hp(0,0)' for RP04/5/6) | |
98 | .I | |
99 | isize = XX | |
100 | m/n = XX | |
101 | .R | |
102 | (after a while) | |
103 | .I | |
104 | exit called | |
105 | Boot | |
106 | : | |
107 | .R | |
108 | .DE | |
109 | This step makes an empty file system. | |
110 | .IP 6. | |
111 | The next thing to do is to restore the data | |
112 | onto the new empty file system. To do this you respond to | |
113 | the `\fI:\fR' printed in the last step with | |
114 | .DS | |
115 | (bring in the program restor) | |
116 | \fI:\|\fRtm(0,4) (`ht(0,4)' for TU16/TE16) | |
117 | \fItape?\fR tm(0,5) (use `ht(0,5)' for TU16/TE16) | |
118 | \fIdisk?\fR rp(0,0) (use `hp(0,0)' for RP04/5/6) | |
119 | \fILast chance before scribbling on disk.\fR (you type return) | |
120 | (the tape moves, perhaps 5-10 minutes pass) | |
121 | \fIend of tape\fR | |
122 | .I | |
123 | Boot | |
124 | : | |
125 | .R | |
126 | .DE | |
127 | You now have a UNIX root file system. | |
128 | .SH | |
129 | Booting UNIX | |
130 | .PP | |
131 | You probably have | |
132 | the bootstrap running, left over from the last step above; | |
133 | if not, | |
134 | repeat the boot process (step 3) again. | |
135 | Then use one of the following: | |
136 | .DS | |
137 | \fI:\|\fRrp(0,0)rptmunix (for RP03 and TU10) | |
138 | \fI:\|\fRrp(0,0)rphtunix (for RP03 and TU16/TE16) | |
139 | \fI:\|\fRhp(0,0)hptmunix (for RP04/5/6 and TU10) | |
140 | \fI:\|\fRhp(0,0)hphtunix (for RP04/5/6 and TU16/TE16) | |
141 | .DE | |
142 | The machine should type the following: | |
143 | .DS | |
144 | .I | |
145 | mem = xxx | |
146 | # | |
147 | .R | |
148 | .DE | |
149 | The | |
150 | .I | |
151 | mem | |
152 | .R | |
153 | message gives the memory available to user programs | |
154 | in bytes. | |
155 | .PP | |
156 | UNIX is now running, | |
157 | and the `UNIX Programmer's manual' applies; | |
158 | references below of the form X(Y) mean the subsection named | |
159 | X in section Y of the manual. | |
160 | The `#' is the prompt from the Shell, | |
161 | and indicates you are the super-user. | |
162 | The user name of the super-user is `root' | |
163 | if you should find yourself in multi-user mode and | |
164 | need to log in; | |
165 | the password is also `root'. | |
166 | .PP | |
167 | To simplify your life later, rename the appropriate version | |
168 | of the system as specified above plain `unix.' | |
169 | For example, use mv (1) as follows if you have an RP04/5/6 and | |
170 | a TU16 tape: | |
171 | .DS | |
172 | mv hphtunix unix | |
173 | .DE | |
174 | In the future, when you reboot, | |
175 | you can type just | |
176 | .DS | |
177 | hp(0,0)unix | |
178 | .DE | |
179 | to the `:' prompt. | |
180 | (Choose appropriately among `hp', `rp', `ht', `tm' | |
181 | according to your configuration). | |
182 | .PP | |
183 | You now need to make some special file entries | |
184 | in the dev directory. These specify what sort of disk you | |
185 | are running on, what sort of tape drive you have, | |
186 | and where the file systems are. | |
187 | For simplicity, this recipe creates fixed device names. | |
188 | These names will be used below, and some of them are built into | |
189 | various programs, so they are most convenient. | |
190 | However, the names do not always represent the actual major and | |
191 | minor device in the manner suggested in section 4 of the | |
192 | Programmer's Manual. | |
193 | For example, `rp3' will be used for the name of the file system | |
194 | on which the user file system is put, even though it might be on an RP06 | |
195 | and is not logical device 3. | |
196 | Also, this sequence will put the user file system on the same | |
197 | disk drive as the root, which is not the best place | |
198 | if you have more than one drive. | |
199 | Thus the prescription below should be taken only as one example | |
200 | of where to put things. | |
201 | See also the section on `Disk layout' below. | |
202 | .PP | |
203 | In any event, change to the dev directory (cd(1)) and, if you like, | |
204 | examine and perhaps change the makefile there (make (1)). | |
205 | .DS | |
206 | cd /dev | |
207 | cat makefile | |
208 | .DE | |
209 | Then, use one of | |
210 | .DS | |
211 | make rp03 | |
212 | make rp04 | |
213 | make rp05 | |
214 | make rp06 | |
215 | .DE | |
216 | depending on which disk you have. | |
217 | Then, use one of | |
218 | .DS | |
219 | make tm | |
220 | make ht | |
221 | .DE | |
222 | depending on which tape you have. | |
223 | The file `rp0' refers to the root file system; | |
224 | `swap' to the swap-space file system; `rp3' to the | |
225 | user file system. | |
226 | The devices `rrp0' and `rrp3' are the `raw' versions | |
227 | of the disks. | |
228 | Also, `mt0' is tape drive 0, at 800 BPI; | |
229 | `rmt0' is the raw tape, on which large records can be read | |
230 | and written; | |
231 | `nrmt0' is raw tape with the quirk that it does not rewind | |
232 | on close, which is a subterfuge that permits | |
233 | multifile tapes to be handled. | |
234 | .PP | |
235 | The next thing to do is to extract the rest of the data from | |
236 | the tape. | |
237 | Comments are enclosed in ( ); don't type these. | |
238 | The number in the first command is the | |
239 | size of the file system; | |
240 | it differs between RP03, RP04/5, and RP06. | |
241 | .DS | |
242 | /etc/mkfs /dev/rp3 74000 (153406 if on RP04/5, 322278 on RP06) | |
243 | (The above command takes about 2-3 minutes on an RP03) | |
244 | dd if=/dev/nrmt0 of=/dev/null bs=20b files=6 (skip 6 files on the tape) | |
245 | restor rf /dev/rmt0 /dev/rp3 (restore the file system) | |
246 | (Reply with a `return' (CR) to the `Last chance' message) | |
247 | (The restor takes about 20-30 minutes) | |
248 | .DE | |
249 | All of the data on the tape has been extracted. | |
250 | .PP | |
251 | You may at this point mount the source | |
252 | file system (mount(1)). To do this type the following: | |
253 | .DS | |
254 | /etc/mount /dev/rp3 /usr | |
255 | .DE | |
256 | The source and manual | |
257 | pages are now available in subdirectories of /usr. | |
258 | .PP | |
259 | The above mount command is only needed if you | |
260 | intend to play around with source on a single | |
261 | user system, which you are going to do next. | |
262 | The file system is mounted automatically when multi-user | |
263 | mode is entered, by a command in the file | |
264 | /etc/rc. (See `Disk Layout' below). | |
265 | .PP | |
266 | Before anything further is done the bootstrap | |
267 | block on the disk (block 0) should be filled in. | |
268 | This is done using the command | |
269 | .DS | |
270 | dd if=/usr/mdec/rpuboot of=/dev/rp0 count=1 | |
271 | .DE | |
272 | if you have the RP03, or | |
273 | .DS | |
274 | dd if=/usr/mdec/hpuboot of=/dev/rp0 count=1 | |
275 | .DE | |
276 | if you have an RP04/5/6. | |
277 | Now the DEC disk bootstraps are usable. | |
278 | See Boot Procedures(8) for further information. | |
279 | .PP | |
280 | Before UNIX is turned up completely, | |
281 | a few configuration dependent exercises must be | |
282 | performed. | |
283 | At this point, | |
284 | it would be wise to read all of the manuals | |
285 | (especially `Regenerating System Software') | |
286 | and to augment this reading with hand to hand | |
287 | combat. | |
288 | .SH | |
289 | Reconfiguration | |
290 | .PP | |
291 | The UNIX system running is configured to run | |
292 | with the given disk | |
293 | and tape, a console, and no other device. | |
294 | This is certainly not the correct | |
295 | configuration. | |
296 | You will have to correct the configuration table to reflect | |
297 | the true state of your machine. | |
298 | .PP | |
299 | It is wise at this point to know how to recompile the system. | |
300 | Print (cat(1)) | |
301 | the file /usr/sys/conf/makefile. | |
302 | This file is input to the program `make(1)' which | |
303 | if invoked with `make all' will recompile all of | |
304 | the system source and | |
305 | install it in the correct libraries. | |
306 | .PP | |
307 | The program mkconf(1) prepares files that | |
308 | describe a given configuration (See mkconf(1)). | |
309 | In the /usr/sys/conf directory, | |
310 | the four files | |
311 | \fIxy\fRconf | |
312 | were input to mkconf to produce the four versions of the system | |
313 | \fIxy\fRunix. | |
314 | Pick the appropriate one, and edit it to add lines describing your own configuration. | |
315 | (Remember the console typewriter is automatically included; | |
316 | don't count it in the kl specification.) | |
317 | Then run mkconf; | |
318 | it will generate the files l.s | |
319 | (trap vectors) c.c (configuration table), | |
320 | and mch0.s. | |
321 | Take a careful look at | |
322 | l.s to make sure that all the devices that you | |
323 | have are assembled in the correct interrupt vectors. | |
324 | If your configuration is non-standard, you will | |
325 | have to modify l.s to fit your configuration. | |
326 | .PP | |
327 | There are certain magic numbers and | |
328 | configuration parameters imbedded in various | |
329 | device drivers that you may want to change. | |
330 | The device addresses of each device | |
331 | are defined in each driver. | |
332 | In case you have any non-standard device | |
333 | addresses, | |
334 | just change the address and recompile. | |
335 | (The device drivers are in the directory | |
336 | /usr/sys/dev.) | |
337 | .PP | |
338 | The DC11 driver is set to run 4 lines. | |
339 | This can be changed in dc.c. | |
340 | .PP | |
341 | The DH11 driver is set to handle 3 DH11's with | |
342 | a full complement of 48 lines. | |
343 | If you have less, or more, | |
344 | you may want to edit dh.c. | |
345 | .PP | |
346 | The DN11 driver will handle 4 DN's. | |
347 | Edit dn.c. | |
348 | .PP | |
349 | The DU11 driver can only handle a single DU. | |
350 | This cannot be easily changed. | |
351 | .PP | |
352 | The KL/DL driver is set up to run | |
353 | a single DL11-A, -B, or -C (the console) | |
354 | and no DL11-E's. | |
355 | To change this, edit | |
356 | kl.c to have NKL11 reflect the total number of | |
357 | DL11-ABC's and | |
358 | NDL11 to reflect the number of DL11-E's. | |
359 | So far as the driver is concerned, | |
360 | the difference between the devices is | |
361 | their address. | |
362 | .PP | |
363 | All of the disk and tape drivers | |
364 | (rf.c, rk.c, rp.c, tm.c, tc.c, | |
365 | hp.c, ht.c) | |
366 | are set up to run 8 drives and should not | |
367 | need to be changed. | |
368 | The big disk drivers (rp.c and hp.c) | |
369 | have partition tables in them which you | |
370 | may want to experiment with. | |
371 | .PP | |
372 | After all the corrections | |
373 | have been made, | |
374 | use `make(1)' to recompile the system (or | |
375 | recompile individually if you wish: use the makefile | |
376 | as a guide). | |
377 | If you compiled individually, say `make unix' in the | |
378 | directory /usr/sys/conf. | |
379 | The final object file (unix) should be | |
380 | moved to the root, and then booted to try it out. | |
381 | It is best to name it /nunix so as not to destroy | |
382 | the working system until you're sure it does work. | |
383 | See Boot Procedures(8) for a discussion | |
384 | of booting. | |
385 | Note: before taking the system down, | |
386 | always (!!) perform | |
387 | a sync(1) | |
388 | to force delayed output to the disk. | |
389 | .SH | |
390 | Special Files | |
391 | .PP | |
392 | Next you must put in special files for the new devices in | |
393 | the directory /dev using mknod(1). | |
394 | Print the configuration file | |
395 | c.c created above. | |
396 | This is the major | |
397 | device switch of each device class (block and character). | |
398 | There is one line for each device configured in your system | |
399 | and a null line for place holding for those devices | |
400 | not configured. | |
401 | The essential block special files were installed above; | |
402 | for any new devices, | |
403 | the major device number is selected by counting the | |
404 | line number (from zero) | |
405 | of the device's entry in the block configuration table. | |
406 | Thus the first entry in the table bdevsw would be | |
407 | major device zero. | |
408 | This number is also printed in the table along the right margin. | |
409 | .PP | |
410 | The minor device is the drive number, | |
411 | unit number or partition as described | |
412 | under each device in section 4 of the manual. | |
413 | For tapes where the unit is dial selectable, | |
414 | a special file may be made for each possible | |
415 | selection. | |
416 | You can also add entries for other disk drives. | |
417 | .PP | |
418 | In reality, device names are arbitrary. It is usually | |
419 | convenient to have a system for deriving names, but it doesn't | |
420 | have to be the one presented above. | |
421 | .PP | |
422 | Some further notes on minor device numbers. | |
423 | The hp driver uses the 0100 bit of the minor device number to | |
424 | indicate whether or not to interleave a file system across | |
425 | more than one physical device. See hp(4) for more detail. | |
426 | The tm and ht drivers use the 0200 bit to indicate whether | |
427 | or not to rewind the tape when it is closed. The | |
428 | 0100 bit indicates the density of the tape on TU16 drives. | |
429 | By convention, tape special files with the 0200 bit on have an `n' | |
430 | prepended to their name, as in /dev/nmt0 or /dev/nrmt1. | |
431 | Again, see tm(4) or ht(4). | |
432 | .PP | |
433 | The naming of character devices is similar to block devices. | |
434 | Here the names are even more arbitrary except that | |
435 | devices meant to be used | |
436 | for teletype access should (to avoid confusion, no other reason) be named | |
437 | /dev/ttyX, where X is some string (as in `00' or `library'). | |
438 | The files console, mem, kmem, and null are | |
439 | already correctly configured. | |
440 | .PP | |
441 | The disk and magtape drivers provide a `raw' interface | |
442 | to the device which provides direct transmission | |
443 | between the user's core and the device and allows | |
444 | reading or writing large records. | |
445 | The raw device counts as a character device, | |
446 | and should have the name of the corresponding | |
447 | standard block special file with `r' prepended. | |
448 | (The `n' for no rewind tapes violates this rule.) | |
449 | Thus the raw magtape | |
450 | files would be called /dev/rmtX. | |
451 | These special files should be made. | |
452 | .PP | |
453 | When all the special files have been created, | |
454 | care should be taken to change | |
455 | the access modes (chmod(1)) | |
456 | on these files to appropriate values (probably 600 or 644). | |
457 | .SH | |
458 | Floating Point | |
459 | .PP | |
460 | UNIX only supports (and really expects to have) the FP11-B/C | |
461 | floating point unit. | |
462 | For machines without this hardware, | |
463 | there is a user subroutine | |
464 | available that will catch illegal instruction | |
465 | traps and interpret floating point operations. | |
466 | (See fptrap(3).) | |
467 | To install this subroutine in the library, change to /usr/src/libfpsim | |
468 | and execute the shell files | |
469 | .DS | |
470 | compall | |
471 | mklib | |
472 | .DE | |
473 | The system as delivered does not have this code included | |
474 | in any command, | |
475 | although the operating system adapts automatically to the | |
476 | presence or absence of the FP11. | |
477 | .PP | |
478 | Next, a floating-point version of | |
479 | the C compiler in /usr/src/cmd/c | |
480 | should be compiled using the commands: | |
481 | .DS | |
482 | cd /usr/src/cmd/c | |
483 | make fc1 | |
484 | mv fc1 /lib/fc1 | |
485 | .DE | |
486 | This allows programs with floating point constants | |
487 | to be compiled. | |
488 | To compile floating point programs use the `\-f' | |
489 | flag to cc(1). This flag ensures that the floating | |
490 | point interpreter is loaded with the program and that | |
491 | the floating point version of `cc' is used. | |
492 | .SH | |
493 | Time Conversion | |
494 | .PP | |
495 | If your machine is not in the Eastern time zone, | |
496 | you must edit (ed(1)) the file | |
497 | /usr/sys/h/param.h | |
498 | to reflect your local time. | |
499 | The manifest `TIMEZONE' should be changed | |
500 | to reflect the time difference between local time and GMT in minutes. | |
501 | For EST, this is 5*60; for PST it would be 8*60. | |
502 | Finally, there is a `DSTFLAG' | |
503 | manifest; | |
504 | when it is 1 it causes the | |
505 | time to shift to Daylight Savings automatically | |
506 | between the last Sundays in April and October | |
507 | (or other algorithms in 1974 and 1975). | |
508 | Normally this will not have to be reset. | |
509 | When the needed changes are done, recompile and load the | |
510 | system using | |
511 | make(1) | |
512 | and install it. | |
513 | (As a general rule, when a system header file is changed, | |
514 | the entire system should be recompiled. | |
515 | As it happens, the only uses of these flags are in | |
516 | /usr/sys/sys/sys4.c, so if this is all that was changed it | |
517 | alone needs to be recompiled.) | |
518 | .PP | |
519 | You may also want to look at timezone(3) | |
520 | (/usr/src/libc/gen/timezone.c) to see | |
521 | if the name of your timezone is in its internal table. | |
522 | If needed, edit the changes in. | |
523 | After timezone.c has been edited | |
524 | it should be compiled and installed in | |
525 | its library. | |
526 | (See /usr/src/libc/(mklib and compall)) | |
527 | Then you should | |
528 | (at your leisure) | |
529 | recompile and reinstall | |
530 | all programs that use it (such as date(1)). | |
531 | .SH | |
532 | Disk Layout | |
533 | .PP | |
534 | If | |
535 | there are to be more file systems mounted than just the root | |
536 | and /usr, | |
537 | use mkfs(1) to create any new file system and | |
538 | put its mounting in the file /etc/rc (see init(8) and mount(1)). | |
539 | (You might look at /etc/rc anyway to | |
540 | see what has been provided for you.) | |
541 | .PP | |
542 | There are two considerations in deciding how to adjust the arrangement | |
543 | of things on your disks: | |
544 | the most important is making sure there is adequate space | |
545 | for what is required; | |
546 | secondarily, throughput should be maximized. | |
547 | Swap space is a critical parameter. | |
548 | The system | |
549 | as distributed has 8778 (hpunix) or 2000 (rpunix) blocks | |
550 | for swap space. | |
551 | This should be large enough so running out of swap space never | |
552 | occurs. | |
553 | You may want to change these if local wisdom indicates otherwise. | |
554 | .PP | |
555 | The system as distributed has all of the binaries in /bin. | |
556 | Most of | |
557 | them should be moved to /usr/bin, leaving only the ones required for | |
558 | system maintenance (such as icheck, dcheck, cc, ed, restor, etc.) and the most | |
559 | heavily used in /bin. | |
560 | This will speed things up a bit if you have only one disk, and also free | |
561 | up space on the root file system for temporary files. (See below). | |
562 | .PP | |
563 | Many common system programs (C, the editor, the assembler etc.) | |
564 | create intermediate files in the /tmp directory, | |
565 | so the file system where this is stored also should be made | |
566 | large enough to accommodate | |
567 | most high-water marks. | |
568 | If you leave the root file system as distributed | |
569 | (except as discussed above) there | |
570 | should be no problem. | |
571 | All the programs that create files in /tmp take | |
572 | care to delete them, but most are not immune to | |
573 | events like being hung up upon, and can leave dregs. | |
574 | The directory should be examined every so often and the old | |
575 | files deleted. | |
576 | .PP | |
577 | Exhaustion of user-file space is certain to occur | |
578 | now and then; | |
579 | the only mechanisms for controlling this phenomenon | |
580 | are occasional use of du(1), df(1), quot(1), threatening | |
581 | messages of the day, and personal letters. | |
582 | .PP | |
583 | The efficiency with which UNIX is able to use the CPU | |
584 | is largely dictated by the configuration of disk controllers. | |
585 | For general time-sharing applications, | |
586 | the best strategy is to try to split user files, | |
587 | the root directory (including the /tmp directory) | |
588 | and the swap area among three controllers. | |
589 | .PP | |
590 | Once you have decided how to make best use | |
591 | of your hardware, the question is how to initialize it. | |
592 | If you have the equipment, | |
593 | the best way to move a file system | |
594 | is to dump it (dump(1)) to magtape, | |
595 | use mkfs(1) to create the new file system, | |
596 | and restore (restor(1)) the tape. | |
597 | If for some reason you don't want to use magtape, | |
598 | dump accepts an argument telling where to put the dump; | |
599 | you might use another disk. | |
600 | Sometimes a file system has to be increased in logical size | |
601 | without copying. | |
602 | The super-block of the device has a word | |
603 | giving the highest address which can be allocated. | |
604 | For relatively small increases, this word can be patched | |
605 | using the debugger (adb(1)) | |
606 | and the free list reconstructed using icheck(1). | |
607 | The size should not be increased very greatly | |
608 | by this technique, however, | |
609 | since although the allocatable space will increase | |
610 | the maximum number of files will not (that is, the i-list | |
611 | size can't be changed). | |
612 | Read and understand the description given in file system(5) | |
613 | before playing around in this way. | |
614 | You may want to | |
615 | see section rp(4) for some suggestions | |
616 | on how to lay out the information on RP disks. | |
617 | .PP | |
618 | If you have to merge a file system into another, existing one, | |
619 | the best bet is to | |
620 | use tar(1). | |
621 | If you must shrink a file system, the best bet is to dump | |
622 | the original and restor it onto the new filesystem. | |
623 | However, this might not work if the i-list on the smaller filesystem | |
624 | is smaller than the maximum allocated inode on the larger. | |
625 | If this is the case, reconstruct the filesystem from scratch | |
626 | on another filesystem (perhaps using tar(1)) and then dump it. | |
627 | If you | |
628 | are playing with the root file system and only have one drive | |
629 | the procedure is more complicated. What you do is the following: | |
630 | .IP 1. | |
631 | GET A SECOND PACK!!!! | |
632 | .IP 2. | |
633 | Dump the current root filesystem (or the reconstructed one) using dump(1). | |
634 | .IP 3. | |
635 | Bring the system down and mount the new pack. | |
636 | .IP 4. | |
637 | Retrieve the WECo distribution tape and perform steps 1 through | |
638 | 5 at the beginning of this document, | |
639 | substituting the desired file system size instead of 5000 | |
640 | when asked for `file system size'. | |
641 | .IP 5. | |
642 | Perform step 6 above up to the point where the `tape' | |
643 | question is asked. At this point mount the tape | |
644 | you made just a few minutes ago. Continue with step 6 above substituting | |
645 | a 0 (zero) for the 5. | |
646 | .SH | |
647 | New Users | |
648 | .PP | |
649 | Install new users by editing the password file | |
650 | /etc/passwd (passwd(5)). | |
651 | This procedure should be done once multi-user mode is entered | |
652 | (see init(8)). | |
653 | You'll have to make a current directory for each new user | |
654 | and change its owner to the | |
655 | newly installed name. | |
656 | Login as each user to make sure the password | |
657 | file is correctly edited. | |
658 | For example: | |
659 | .DS | |
660 | ed /etc/passwd | |
661 | $a | |
662 | joe::10:1::/usr/joe: | |
663 | .li | |
664 | . | |
665 | w | |
666 | q | |
667 | mkdir /usr/joe | |
668 | chown joe /usr/joe | |
669 | login joe | |
670 | ls \-la | |
671 | login root | |
672 | .DE | |
673 | This will make a new login entry for joe, | |
674 | who should be encouraged to use passwd(1) | |
675 | to give himself a password. | |
676 | His default current directory is | |
677 | /usr/joe | |
678 | which has been created. | |
679 | The delivered password file | |
680 | has the user | |
681 | .I | |
682 | bin | |
683 | .R | |
684 | in it to be used as a prototype. | |
685 | .SH | |
686 | Multiple Users | |
687 | .PP | |
688 | If UNIX is to support simultaneous | |
689 | access from more than just the console terminal, | |
690 | the file /etc/ttys (ttys(5)) has to be edited. | |
691 | To add a new terminal be sure the device is configured | |
692 | and the special file exists, then set | |
693 | the first character of the appropriate line of /etc/ttys to 1 | |
694 | (or add a new line). | |
695 | Note that init.c will have to be recompiled if there are to be | |
696 | more than 100 terminals. | |
697 | Also note that if the special file is inaccessible when init tries to create a process | |
698 | for it, the system will thrash trying and retrying to open it. | |
699 | .SH | |
700 | File System Health | |
701 | .PP | |
702 | Periodically (say every day or so) and always after a crash, | |
703 | you should check all the file systems for consistency | |
704 | (icheck, dcheck(1)). | |
705 | It is quite important to execute sync (8) | |
706 | before rebooting or taking the machine down. | |
707 | This is done automatically every 30 seconds by the update | |
708 | program (8) when a multiple-user system is running, | |
709 | but you should do it anyway to make sure. | |
710 | .PP | |
711 | Dumping of the file system should be done regularly, | |
712 | since once the system is going it is very easy to | |
713 | become complacent. | |
714 | Complete and incremental dumps are easily done with | |
715 | dump(1). | |
716 | Dumping of files by name is best done by | |
717 | tar(1) but the number of files is somewhat limited. | |
718 | Finally if there are enough drives entire | |
719 | disks can be copied using cp(1), or preferably with | |
720 | dd(1) using the raw special files and an appropriate | |
721 | block size. | |
722 | .SH | |
723 | Converting Sixth Edition Filesystems | |
724 | .PP | |
725 | The best way to convert file systems from 6th | |
726 | edition (V6) to 7th edition (V7) format | |
727 | is to use tar(1). However, a special version of tar must | |
728 | be prepared | |
729 | to run on V6. | |
730 | The following steps will do this: | |
731 | .IP 1. | |
732 | change directories to /usr/src/cmd/tar | |
733 | .IP 2. | |
734 | At the shell prompt respond | |
735 | .DS | |
736 | make v6tar | |
737 | .DE | |
738 | This will leave an executable binary named `v6tar'. | |
739 | .IP 3. | |
740 | Mount a scratch tape. | |
741 | .IP 4. | |
742 | Use tp(1) to put `v6tar' on the scratch | |
743 | tape. | |
744 | .IP 5. | |
745 | Bring down V7 and bring up V6. | |
746 | .IP 6. | |
747 | Use tp (on V6) to read in `v6tar'. Put it in | |
748 | /bin or /usr/bin (or perhaps some other preferred location). | |
749 | .IP 7. | |
750 | Use v6tar to make tapes of all that you wish to convert. | |
751 | You may want to read the manual section on tar(1) to | |
752 | see whether you want to use blocking or not. | |
753 | Try to avoid using full pathnames when making the tapes. This | |
754 | will simplify moving the hierarchy to some other place on | |
755 | V7 if desired. For example | |
756 | .DS | |
757 | chdir /usr/ken | |
758 | v6tar c . | |
759 | .DE | |
760 | is preferable to | |
761 | .DS | |
762 | v6tar c /usr/ken | |
763 | .DE | |
764 | .IP 8. | |
765 | After all of the desired tapes are made, bring | |
766 | down V6 and reboot V7. Use | |
767 | tar(1) to read in the tapes just made. | |
768 | .SH | |
769 | Odds and Ends | |
770 | .PP | |
771 | The programs | |
772 | dump, | |
773 | icheck, quot, dcheck, ncheck, and df | |
774 | (source in /usr/source/cmd) | |
775 | should be changed to | |
776 | reflect your default mounted file system devices. | |
777 | Print the first few lines of these | |
778 | programs and the changes will be obvious. | |
779 | Tar should be changed to reflect your desired | |
780 | default tape drive. | |
781 | .sp 3 | |
782 | .in 4i | |
783 | Good Luck | |
784 | .sp 1 | |
785 | Charles B. Haley | |
786 | .br | |
787 | Dennis M. Ritchie |