NetBSD/sys/arch/i386/stand/misc/pfdisk.txt

265 lines
6.6 KiB
Plaintext

PFDISK(8) MAINTENANCE COMMANDS PFDISK(8)
NAME
pfdisk - partition fixed disk
SYNOPSIS
pfdisk device
DESCRIPTION
pfdisk partitions the fixed disk identified as device into (at
most) four parts, each of which may be independently loaded with
an operating system. The actual name of device depends on the
operating system in use. For ESIX (System V/386) the device
name is either "/dev/rdsk/0s0" or "/dev/rdsk/1s0". For Minix,
it is "/dev/hd0" or "/dev/hd5". For MS-DOS it is a single digit
(zero or one).
pfdisk reads the hard disk partition table from block zero of
device into memory and allows the user to examine, modify, or
save the partition table. A regular file may be used instead of
a real device for testing purposes, though the device geometry
must be specified manually, and some systems will requrire a
file-name argument with the "R" and "W" commands (DOS, ESIX).
The partition table on device is NOT modified unless the write
command (W) is used with no argument.
USAGE
Commands
All pfdisk commands consist of a command word followed by
optional blank-separated command arguments. Note that only the
first letter of a command word is significant (except for "wq"
and "q!"). All command letters are accepted in either upper or
lower case. Numeric arguments are specified using C syntax.
Extra arguments are silently ignored.
The commands are:
? Prints a command summary (help).
1 sys_id first last sys_name
Set the partition table entry for part one, using:
sys_id as its system ID code, first as the lowest num-
bered cylinder it uses, last as the highest numbered
cylinder it uses, and sys_name (optional) as the system
name (in the menu name table).
2|3|4 sys-id first last sys-name
Similar to 1 but sets partition two, three, or four,
respectively.
Release 1.3 Last change: Oct 1990 1
PFDISK(8) MAINTENANCE COMMANDS PFDISK(8)
A number
Mark partition number as active (so it will be used for
booting). If number is zero, no partition will be
active.
G cylinders heads sectors
Inform pfdisk what the geometry of the device is.
I Print a summary of the known ID codes.
L List the partition table. See Output Format below.
Q Quit without saving. If the memory copy of the parti-
tion table was modified, a warning will be issued and
the command ignored.
Q! Quit, even if the memory copy of the partition table was
not saved.
R file-name
Read boot sector from file-name (if given) otherwise
read from device.
W file-name
Write boot sector to file-name. (if given) otherwise
write to device.
WQ Same as "write" followed by "quit".
# This line is a comment (to be ignored).
Output Format
Here is a sample of the output from the L command:
# Partition table on device: /dev/rdsk/0s0
geometry 1222 15 34 (cyls heads sectors)
# ID First(cyl) Last(cyl) Name # start, length (sectors)
1 4 0 127 MS-LOSS # 34, 65246
2 129 128 255 Minix # 65280, 65280
3 0 0 0 # 0, 0
4 99 256 1220 ESIX # 130560, 492150
# note: last(4): phys=(1023,14,34) logical=(1220,14,34)
active: 4
This output format is carefully constructed so that it may be
saved in a file (by redirecting standard output) and later used
as input (by redirecting standard input). On a UNIX system, one
can save this output using the command:
Release 1.3 Last change: Oct 1990 2
PFDISK(8) MAINTENANCE COMMANDS PFDISK(8)
(echo L) | pfdisk device-name > save-file
save-file is a complete record of the partition table. On a
UNIX system, one could use save-file to re-initialize the parti-
tion table using the command:
(cat save-file ; echo wq) | pfdisk device-name
Consistency of each partition table entry is checked while the
table is listed. Any inconsistencies discovered are reported in
a commentary note as shown above.
Physical vs. Logical
Each partition table entry has both "physical" and a "logical"
fields. The physical fields specify the lowest and highest
cylinder,head,sector combinations to be used in that partition.
The logical start field has the total number of sectors which
precede this partition, and the logical length field has the
total number of sectors contained in this partition. These
fields should be self consistent unless the disk has more than
1024 cylinders.
The physical cylinder fields are only ten-bits wide so the con-
tents are limited to 1023. The logical sector fields are 32 bits
wide and always show the true logical beginning and length of
the partition. Generally, the physical start field is used only
to locate the secondary boot sector, and the logical start and
length fields are used to actually delimit the partition used by
a particular system.
Partition Names
The Name field in the partition table is treated specially if
the bootmenu program is installed in the primary boot sector.
(See the file bootmenu.doc for more information.) pfdisk can
recognize the name table used by bootmenu and will show the
actual names present in that name table. If any other boot pro-
gram is used then the Name field reflects the result of a
table-lookup of the system ID.
If you provide a name when setting any partition entry, the
boot-sector is marked as using a name table, so that on subse-
quent uses of pfdisk you will see the partition names you have
specified.
Boot program replacement
You can replace the boot program in your boot sector without
affecting the partition table by using pfdisk as follows.
First, (as always) save a copy of the current boot sector (on a
Release 1.3 Last change: Oct 1990 3
PFDISK(8) MAINTENANCE COMMANDS PFDISK(8)
floppy) using the "W file" command. Then, use the "R file" com-
mand to read the new boot program. If the boot program read in
is less than 446 bytes long, the partition table will be
unchanged.
Unlike the DOS or UNIX fdisk programs, pfdisk has NO boot pro-
gram compiled into its executable image. If you wish to use
pfdisk to partition a newly formatted hard disk, you must have a
boot program image available to read in using the "r file" com-
mand. Two boot programs, "bootmenu.bin" and "bootauto.bin" are
distributed with pfdisk and should be found with its source
files. See the file bootmenu.doc for further information about
these boot programs.
AUTHOR
Gordon W. Ross
Release 1.3 Last change: Oct 1990 4