Subject: Disklabels arrive for 2.11BSD (#258 part 9 of 18) Index: sys,bin,usr.lib,(many more)/ 2.11BSD Description: The moving the partitions tables out of the disk drivers and to a disklabel residing on the media has been on the wish list for many many years. Disklabels have finally arrived for 2.11BSD! Repeat-By: Observation. Also a reading of the setup and installation documentation for previous 2BSD releases (2.9, 2.10, 2.11) all have a paragraph similar to this present: "It is possible to change the partitions by changing the code for the table in the disk driver. Since it's desirable to do this, these tables really should be read off each pack...." Fix: This is part 9 of 18. Gather all parts before doing anything except reading the instructions which are in #250 (part 1). Updated by this part are: /usr/src/man/man4/ra.4 /usr/src/man/man4/rl.4 /usr/src/man/man8/newfs.8 The RA and RL manpages no longer include partitioning schemes. The newfs command is almost completely different than before. Be sure to read the new manpage before using newfs. Cut where indicated and save to a file (/tmp/258). Then: patch -p0 < /tmp/258 rm /tmp/258 ------------------------cut here----------------------- *** /usr/src/man/man4/ra.4.old Wed Oct 24 19:24:53 1990 --- /usr/src/man/man4/ra.4 Sat Jun 17 00:04:44 1995 *************** *** 2,8 **** .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)ra.4 6.2 (Berkeley) 9/6/87 .\" .TH RA 4 "September 6, 1987" .UC 2 --- 2,8 ---- .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)ra.4 6.2.1 (2.11BSD) 1995/06/17 .\" .TH RA 4 "September 6, 1987" .UC 2 *************** *** 65,210 **** calls should specify a multiple of 512 bytes. .SH "DISK SUPPORT" This driver configures the drive type of each drive ! when it is first opened. ! A partition table in the driver is required for each type of disk. ! The origin and size (in sectors) of the pseudo-disks ! on each drive are shown below. ! Not all partitions begin on ! cylinder boundaries, as on other drives, because previous drivers ! used one partition table for all drive types. ! Variants of the partition tables are common; ! check the driver and the file ! .I /etc/disktab ! .RI ( disktab (5)) ! for other possibilities. ! .nf ! .ta .5i +\w'disk 'u +\w'000000 'u +\w'000000 'u +\w'000000 'u .PP - .ne 10 - RC25 partitions - disk start end length comments - ra?a 0 15883 15884 / - ra?b 15884 25915 10032 swap - ra?c 25916 50799 24884 /usr - ra?d unused - ra?e unused - ra?f unused - ra?g unused - ra?h 0 50799 50800 whole disk - .PP - .ne 10 - RX33/50 partitions - disk start end length comments - ra?a unusable - ra?b unusable - ra?c unusable - ra?d unusable - ra?e unusable - ra?f unusable - ra?g unusable - ra?h 0 1637 1638 whole disk - .PP - .ne 10 - RD51 partitions - disk start end length comments - ra?a 0 9699 9700 - ra?b unusable - ra?c unusable - ra?d unusable - ra?e 0 7459 7460 / - ra?f 7460 9699 2240 swap - ra?g 9700 21567 11868 /usr - ra?h 0 21567 21568 whole disk - .PP - .ne 10 - RD52 partitions - disk start end length comments - ra?a 0 9699 9700 / - ra?b 9700 26999 17300 - ra?c 27000 30099 3100 swap - ra?d 30100 60447 30348 /usr - ra?e 0 7459 7460 - ra?f 7460 9699 2240 - ra?g 9700 60447 50748 - ra?h 0 60447 60448 whole disk - .PP - .ne 10 - RD53 partitions - disk start end length comments - ra?a 0 9699 9700 / - ra?b 9700 26999 17300 - ra?c 27000 30099 3100 swap - ra?d 30100 138639 108540 /usr - ra?e 0 7459 7460 - ra?f 7460 9699 2240 - ra?g 9700 138639 128940 - ra?h 0 138639 138640 whole disk - .PP - .ne 10 - RD54 partitions - disk start end length comments - ra?a 0 15883 15884 / - ra?b 15884 32603 16720 swap - ra?c 32604 331167 298564 /usr - ra?d unused - ra?e unused - ra?f unused - ra?g unused - ra?h 0 331167 331168 whole disk - .PP - .ne 10 - RA60 partitions - disk start end length comments - ra?a 0 15883 15884 / - ra?b 15884 49323 33440 swap - ra?c 49324 242605 193282 /usr - ra?d 242606 258489 15884 - ra?e 258490 399175 140686 - ra?f unused - ra?g 242606 399175 156570 - ra?h 0 399175 399176 whole disk - .PP - .ne 10 - RA80 partitions - disk start end length comments - ra?a 0 15883 15884 / - ra?b 15884 49323 33440 swap - ra?c 49324 236211 186888 /usr - ra?d unused - ra?e unused - ra?f unused - ra?g unused - ra?h 0 236211 236212 whole disk - .PP - .ne 10 - RA81 partitions - disk start end length comments - ra?a 0 15883 15884 / - ra?b 15884 49323 33440 swap - ra?c 49324 242605 193282 /usr - ra?d 242606 258489 15884 - ra?e 258490 565689 307200 - ra?f 565690 890071 324382 - ra?g 242606 890071 647466 - ra?h 0 890071 890072 whole disk - .PP - .ne 10 - RA82 partitions - disk start end length comments - ra?a 0 15883 15884 / - ra?b 15884 32603 16720 swap - ra?c 32604 336313 303710 /usr - ra?d 336314 640023 303710 - ra?e 640024 943733 303710 - ra?f 943734 1247443 303710 - ra?g unused - ra?h 0 1247449 1247450 whole disk - .DT - .fi - .PP The ra?a partition is normally used for the root file system, the ra?b partition as a swap area, ! and the ra?h partition for pack-pack copying (it maps the entire disk). .SH FILES .ta \w'/dev/MAKEDEV.local 'u /dev/ra[0-7][a-h] --- 65,77 ---- calls should specify a multiple of 512 bytes. .SH "DISK SUPPORT" This driver configures the drive type of each drive ! when it is first opened. Partition information is read from the disklabel. ! If there is no label or the label is corrupt then the 'a' partition is ! used to span the entire drive. .PP The ra?a partition is normally used for the root file system, the ra?b partition as a swap area, ! and the ra?c partition for pack-pack copying (it maps the entire disk). .SH FILES .ta \w'/dev/MAKEDEV.local 'u /dev/ra[0-7][a-h] *************** *** 223,229 **** si(4), xp(4), dtab(5), ! autoconfig(8) .SH DIAGNOSTICS .BR "rasa %o, state %d" . (Additional status information given after a hard i/o error.) --- 90,97 ---- si(4), xp(4), dtab(5), ! autoconfig(8), ! disklabel(8) .SH DIAGNOSTICS .BR "rasa %o, state %d" . (Additional status information given after a hard i/o error.) *************** *** 281,288 **** and .IR lseek (2) should always deal in 512-byte multiples. - .PP - The partition tables attempt to combine compatibility - with previous drivers and functionality; this is impossible. - The best solution would be to read the partition tables - off the drive. --- 149,151 ---- *** /usr/src/man/man4/rl.4.old Mon Aug 22 10:59:44 1988 --- /usr/src/man/man4/rl.4 Sat Jun 17 23:41:32 1995 *************** *** 2,8 **** .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)rl.4 6.2 (Berkeley) 8/20/87 .\" .TH RL 4 "August 20, 1987" .UC 2 --- 2,8 ---- .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)rl.4 6.2.1 (2.11BSD) 1995/06/17 .\" .TH RL 4 "August 20, 1987" .UC 2 *************** *** 24,38 **** raw: 16 block: 7 minor device encoding: ! specifies drive: .fi .ft R .SH DESCRIPTION - Minor device numbers are drive numbers on one controller. - The standard device names begin with ``rl'' followed by - the drive number and then the letter "h". - The character ? stands here for a drive number in the range 0-3. - .PP The block files access the disk via the system's normal buffering mechanism and may be read and written without regard to physical disk records. There is also a `raw' interface --- 24,34 ---- raw: 16 block: 7 minor device encoding: ! bits 0007 specify partition of RL drive ! bits 0070 specify RL drive .fi .ft R .SH DESCRIPTION The block files access the disk via the system's normal buffering mechanism and may be read and written without regard to physical disk records. There is also a `raw' interface *************** *** 49,70 **** .I seek calls should specify a multiple of 512 bytes. .SH "DISK SUPPORT" ! The ! .I rl ! driver does not support pseudo-disks (partitions). Each file ! .I rl?h ! refers to the entire drive as a single sequentially addressed ! file. The RL01 drives are each 10240 blocks long and the RL02 drives are 20480 blocks long. .PP ! On a dual RL02 system ! one drive would be used for root and /usr ! while the other would be used for swap. .SH FILES .ta \w'/dev/MAKEDEV.local 'u ! /dev/rl[0-3]h block files .br ! /dev/rrl[0-3]h raw files .br /dev/MAKEDEV script to create special files .br --- 45,61 ---- .I seek calls should specify a multiple of 512 bytes. .SH "DISK SUPPORT" ! The RL01 drives are each 10240 blocks long and the RL02 drives are 20480 blocks long. .PP ! On a RL02 there is room for a full sized root ('a') partition and a ! reasonable sized swap ('b') partition. The RL01 can only (realistically) ! have a single 5mb partition. .SH FILES .ta \w'/dev/MAKEDEV.local 'u ! /dev/rl[0-3][a-h] block files .br ! /dev/rrl[0-3][a-h] raw files .br /dev/MAKEDEV script to create special files .br *** /usr/src/man/man8/newfs.8.old Sat Dec 28 22:27:33 1991 --- /usr/src/man/man8/newfs.8 Tue May 2 21:34:53 1995 *************** *** 2,10 **** .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)newfs.8 7.0 (Berkeley) 12/28/91 .\" ! .TH NEWFS 8 "December 28, 1991" .UC 5 .SH NAME newfs \- construct a new file system --- 2,10 ---- .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" ! .\" @(#)newfs.8 7.1 (2.11BSD) 1995/05/02 .\" ! .TH NEWFS 8 "May 2, 1995" .UC 5 .SH NAME newfs \- construct a new file system *************** *** 17,28 **** .B \-m free-gap ] [ ! .B \-b ] [ ! .B \-B bootblock ] ! .B special disk-type .SH DESCRIPTION .I Newfs is a ``friendly'' front-end to the --- 17,28 ---- .B \-m free-gap ] [ ! .B \-s size ] [ ! .B \-T disk-type ] ! .B special .SH DESCRIPTION .I Newfs is a ``friendly'' front-end to the *************** *** 29,42 **** .IR mkfs (8) program. .I Newfs ! will look up the type of disk a file system is ! being created on in the disk description ! file ! .IR /etc/disktab , ! calculate the appropriate ! parameters to use in calling .IR mkfs , ! then build the file system by forking \fImkfs\fP. .PP The .I \-N --- 29,43 ---- .IR mkfs (8) program. .I Newfs ! will normally read the disklabel from the drive to determine the ! partition sizes. If the driver for the disk does not support ! disklabels the \-T option must be used to force a search of ! .IR /etc/disktab ! for partition information about \fIdrive-type\fP. ! .I Newfs ! calculates the appropriate parameters to use in calling .IR mkfs , ! then builds the file system by forking \fImkfs\fP. .PP The .I \-N *************** *** 62,95 **** to be 1 cylinder in size. .PP The ! .IR \-b ! and ! .IR \-B ! options specify that a primary block zero bootstrap should be installed in ! block zero of ! .IR special . ! This is typically done for `a' partitions to make disks bootable. ! If ! .I \-b ! is specified, ! .I newfs ! will attempt to use a default boot block (defined in ! .IR /etc/disktab ). .PP The ! .I \-B ! option allows one to specify the file to read the boot block from ! .RI ( bootblock ). ! Note that a boot block can always be copied separately via: ! .PP ! \fBdd if=\fIbootblock\fB of=\fIspecial\fB bs=512 count=1 conv=sync\fR ! .PP .SH FILES /etc/disktab for disk geometry and file system partition information .br /etc/mkfs to actually build the file system - .br - /mdec/* block zero bootstraps .SH "SEE ALSO" ! disktab(5), fs(5), diskpart(8), fsck(8), format(8), mkfs(8) .SH BUGS --- 63,100 ---- to be 1 cylinder in size. .PP The ! .I \-T ! option must be used if the disk specified by \fIspecial\fP has not ! been labeled with the ! .IR disklabel (8) ! program. In this case \fIdisk-type\fP is used by ! .IR getdisklabel (3) ! when searching ! .IR /etc/disktab . ! This option is used when the underlying device driver does not ! support disklabels. Care must be taken that the contents of ! /etc/disktab match the partition tables in the kernel. .PP The ! .IR \-s ! option specifies how many \fBsectors\fP the file system is to contain. ! There are two sectors per file system block, therefore \fIsize\fP should ! be even. ! This parameter must be less than or equal to the partition size (as ! determined from the disklabel or /etc/disktab). An error is printed and ! no action is taken if the partition size is 0 or too large. .SH FILES /etc/disktab for disk geometry and file system partition information .br /etc/mkfs to actually build the file system .SH "SEE ALSO" ! getdisklabel(3), disklabel(8), disktab(5), diskpart(8), fs(5), fsck(8), ! mkfs(8) .SH BUGS + .IR newfs (8) + no longer places boot blocks on the filesystem. That duty has been + moved to the + .IR disklabel (8) + program. If you must place a boot block on a disk whose driver does + not support disklabels use + .IR dd (1).