Bug #762 » disklabel.8.patch
disklabel.8 9 Aug 2007 20:53:58 -0000 | ||
---|---|---|
forms require a disk device name, which should always be the raw
|
||
device name representing the disk or slice.
|
||
For example
|
||
.Pa da0
|
||
.Pa da0s0
|
||
represents the entire disk regardless of any DOS partitioning,
|
||
this is called the compatibility slice,
|
||
and
|
||
.Pa da0s1
|
||
represents a slice.
|
||
Some devices, most notably
|
||
.Ar ccd ,
|
||
require that the
|
||
.Dq whole-disk
|
||
(or
|
||
.Dq c )
|
||
partition be specified.
|
||
For example
|
||
.Pa ccd0c .
|
||
represents a normal slice, i.e. one with a positive number.
|
||
You do not have to include the
|
||
.Pa /dev/
|
||
path prefix when specifying the device.
|
||
... | ... | |
.Pp
|
||
.Ar disk
|
||
represents the raw disk in question, and may be in the form
|
||
.Pa da0
|
||
.Pa da0s1
|
||
or
|
||
.Pa /dev/da0c .
|
||
.Pa /dev/da0s1 .
|
||
It will display all of the parameters associated with the drive and its
|
||
partition layout.
|
||
Unless the
|
||
... | ... | |
If you are creating a
|
||
.Dq dangerously-dedicated
|
||
slice for compatibility with older PC systems,
|
||
you generally want to specify the raw disk name such as
|
||
.Pa da0 .
|
||
you generally want to specify the compatibility slice, such as
|
||
.Pa da0s0 .
|
||
If you are creating a label within an existing DOS slice,
|
||
you should specify
|
||
the partition name such as
|
||
.Pa da0s1a .
|
||
the slice name such as
|
||
.Pa da0s1 .
|
||
Making a slice bootable can be tricky.
|
||
If you are using a normal DOS
|
||
slice you typically install (or leave) a standard MBR on the base disk and
|
||
... | ... | |
.Pp
|
||
This form installs the bootstrap only.
|
||
It does not change the disk label.
|
||
You should never use this command on a base disk unless you intend to create a
|
||
You should never use this command on a compatibility slice unless you intend to create a
|
||
.Dq dangerously-dedicated
|
||
disk, such as
|
||
.Ar da0 .
|
||
This command is typically run on a slice such as
|
||
.Ar da0s0 .
|
||
This command is typically run on a normal slice such as
|
||
.Ar da0s1 .
|
||
.Pp
|
||
.Nm
|
||
... | ... | |
.Dq write label
|
||
command described above.
|
||
In addition to writing a new volume label, it also installs the bootstrap.
|
||
If run on a base disk this command will create a
|
||
If run on a compatibility slice this command will create a
|
||
.Dq dangerously-dedicated
|
||
label.
|
||
This command is normally run on a slice rather than a base disk.
|
||
This command is normally run on a normal slice rather than a compatibility slice.
|
||
If
|
||
.Fl n
|
||
is used, no data will be written to the device, and instead the
|
||
... | ... | |
.Dq restore label
|
||
command described above.
|
||
In addition to restoring the volume label, it also installs the bootstrap.
|
||
If run on a base disk this command will create a
|
||
If run on a compatibility slice this command will create a
|
||
.Dq dangerously-dedicated
|
||
label.
|
||
This command is normally run on a slice rather than a base disk.
|
||
This command is normally run on a normal slice rather than a compatibility slice.
|
||
.Pp
|
||
The bootstrap commands always access the disk directly, so it is not necessary
|
||
to specify the
|
||
... | ... | |
label.
|
||
The format is:
|
||
.Bd -literal -offset 4n
|
||
# /dev/da1c:
|
||
# /dev/da0s1:
|
||
type: SCSI
|
||
disk: da0s1
|
||
label:
|
||
... | ... | |
drivedata: 0
|
||
16 partitions:
|
||
# size offset fstype
|
||
a: 81920 0 4.2BSD # 40.000M
|
||
b: 160000 81920 swap # 78.125M
|
||
c: 1173930 0 unused # 573.208M
|
||
h: 962010 211920 vinum # 469.731M
|
||
# size offset fstype
|
||
a: 81920 0 4.2BSD # 40.000M
|
||
b: 160000 81920 swap # 78.125M
|
||
c: 1173930 0 unused # 573.208M
|
||
g: 320000 241920 ccd # 156.250M
|
||
h: 612010 561920 vinum # 298.833M
|
||
.Ed
|
||
.Pp
|
||
Lines starting with a
|
||
... | ... | |
The partition identifier is a single letter in the range
|
||
.Ql a
|
||
to
|
||
.Ql h .
|
||
.Ql p .
|
||
By convention, partition
|
||
.Ql c
|
||
is reserved to describe the entire disk.
|
||
... | ... | |
The example shows all currently used partition types.
|
||
For
|
||
.Tn UFS
|
||
file systems and
|
||
file systems, use type
|
||
.Cm 4.2BSD .
|
||
For
|
||
.Xr ccd 4
|
||
partitions, use type
|
||
.Cm 4.2BSD .
|
||
.Cm ccd .
|
||
For Vinum drives, use type
|
||
.Cm vinum .
|
||
Other common types are
|
||
... | ... | |
(See the definitions starting with
|
||
.Dv FS_UNUSED
|
||
in
|
||
.In sys/disklabel.h
|
||
.In sys/dtype.h
|
||
for more details).
|
||
.El
|
||
.Pp
|
||
The remainder of the line is a comment and shows the size of the partition
|
||
in MB.
|
||
in bytes.
|
||
.Pp
|
||
.Dx
|
||
no longer snoop-adjusts the on-disklabel when reading or writing
|
||
... | ... | |
.Pa /dev/da0s1 .
|
||
(If the disk is
|
||
.Dq dangerously-dedicated ,
|
||
the base disk name should be specified, such as
|
||
.Pa da0 . )
|
||
the compatibility slice name should be specified, such as
|
||
.Pa da0s0 . )
|
||
.Pp
|
||
.Dl "disklabel da0s1 > savedlabel"
|
||
.Pp
|
||
... | ... | |
.Cm * ,
|
||
which could be used as a source file for
|
||
.Pp
|
||
.Dl disklabel -R ad0s1c new_label_file
|
||
.Dl disklabel -R ad0s1 new_label_file
|
||
.Bd -literal -offset 4n
|
||
# /dev/ad0s1c:
|
||
# /dev/ad0s1:
|
||
type: ESDI
|
||
disk: ad0s1
|
||
label:
|
||
... | ... | |
drivedata: 0
|
||
16 partitions:
|
||
# size offset fstype
|
||
a: 400M 0 4.2BSD
|
||
b: 1G * swap
|
||
c: * * unused
|
||
e: 204800 * 4.2BSD
|
||
f: 5g * 4.2BSD
|
||
g: * * 4.2BSD
|
||
# size offset fstype
|
||
a: 400M 0 4.2BSD
|
||
b: 1G * swap
|
||
c: * * unused
|
||
e: 204800 * 4.2BSD
|
||
f: 5g * 4.2BSD
|
||
g: * * 4.2BSD
|
||
.Ed
|
||
.Sh DIAGNOSTICS
|
||
The kernel device drivers will not allow the size of a disk partition
|