From 395137b5f9d5cf34cc748b25752a3b554cdb5998 Mon Sep 17 00:00:00 2001 From: Thomas Nikolajsen Date: Thu, 21 Aug 2008 21:22:36 +0000 Subject: [PATCH] Update disklabel doc: - Sync usage() to disklabel.8 - Add note that this is 32 bit disklabel - Move description of `-f' flag from unrelated section (SAVED FILE FORMAT) - Improve some wording and mark up a bit --- sbin/disklabel/disklabel.8 | 68 ++++++++++++++++++++++------------------------ sbin/disklabel/disklabel.c | 5 +++- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/sbin/disklabel/disklabel.8 b/sbin/disklabel/disklabel.8 index 60441698ac..0146b58431 100644 --- a/sbin/disklabel/disklabel.8 +++ b/sbin/disklabel/disklabel.8 @@ -34,14 +34,14 @@ .\" .\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94 .\" $FreeBSD: src/sbin/disklabel/disklabel.8,v 1.15.2.22 2003/04/17 17:56:34 trhodes Exp $ -.\" $DragonFly: src/sbin/disklabel/disklabel.8,v 1.26 2008/07/27 20:58:33 swildner Exp $ +.\" $DragonFly: src/sbin/disklabel/disklabel.8,v 1.27 2008/08/21 21:22:36 thomas Exp $ .\" -.Dd July 27, 2008 +.Dd August 21, 2008 .Dt DISKLABEL 8 .Os .Sh NAME .Nm disklabel -.Nd read and write disk pack label +.Nd read and write 32 bit disk pack label .Sh SYNOPSIS .Nm .Op Fl r @@ -135,22 +135,20 @@ forms require a disk device name, which should always be the raw device name representing the disk or slice. .Dx uses the following scheme for slice numbering: -If the disk doesn't use -.Xr gpt 8 , -but e.g. MBR (typically laid out by +If the disk doesn't use GPT (typically laid out by +.Xr gpt 8 ) , +but e.g.\& MBR (typically laid out by .Xr fdisk 8 ) , -then slice 0, e.g. +then slice 0, e.g.\& .Pa da0s0 , -represents the entire disk regardless of any DOS partitioning, -this is called the compatibility slice, -and slice 1 and onward, e.g. +represents the entire disk regardless of any DOS partitioning. +Slice 0 is called the compatibility slice, +and slice 1 and onward, e.g.\& .Pa da0s1 , -represents a +represents .Bx -slice. -If the disk does use GPT (typically laid out by -.Xr gpt 8 ) , -then all slices are +slices. +If the disk does use GPT, then all slices are .Bx slices, slice 0 isn't special, it is just the first slice on the disk. You do not have to include the @@ -571,6 +569,25 @@ Your mileage may vary. .Nm .Fl e .Pa da0s1 +.Ss Manual offset +.Dx +no longer snoop-adjusts the on-disk label when reading or writing +raw labels. +.Nm +is now responsible for adjusting the label when operating in raw mode. +Traditional (32 bit +.Bx ) +disklabels store offsets as absolute block numbers +rather than slice-relative block numbers. +If +.Nm +is unable to issue the +.Dv DIOCGPART +ioctl to get slice information it will +refuse to read or write the label in raw mode. +The +.Fl f +option may be used to force the operation by supplying a manual offset. .Sh FILES .Bl -tag -width ".Pa /etc/disktab" -compact .It Pa /boot/boot1 @@ -756,25 +773,6 @@ for more details). .Pp The remainder of the line is a comment and shows the size of the partition in MB. -.Pp -.Dx -no longer snoop-adjusts the on-disklabel when reading or writing -raw labels. -.Nm -is now responsible for adjusting the label when operating in raw mode. -Traditional (32 bit -.Bx ) -disklabels store offsets as absolute block numbers -rather than slice-relative block numbers. -If -.Nm -is unable to issue the -.Dv DIOCGPART -ioctl to get slice information it will -refuse to read or write the label in raw mode. -The -.Fl f -option may be used to force the operation by supplying a manual offset. .Sh EXAMPLES .Dl "disklabel da0s1" .Pp @@ -1003,7 +1001,7 @@ Installing a label on a slice with a .Nm label installed requires reboot. First the existing label -has to be overwritten, e.g. by +has to be overwritten, e.g.\& by .Xr dd 1 , see above, then a reboot is required before the new label can be installed. .Pp diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 055fef8e46..23b640c568 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -37,7 +37,7 @@ * @(#)disklabel.c 1.2 (Symmetric) 11/28/85 * @(#)disklabel.c 8.2 (Berkeley) 1/7/94 * $FreeBSD: src/sbin/disklabel/disklabel.c,v 1.28.2.15 2003/01/24 16:18:16 des Exp $ - * $DragonFly: src/sbin/disklabel/disklabel.c,v 1.27 2008/04/23 21:59:22 thomas Exp $ + * $DragonFly: src/sbin/disklabel/disklabel.c,v 1.28 2008/08/21 21:22:36 thomas Exp $ */ #include @@ -1779,5 +1779,8 @@ usage(void) " disklabel [-NW] disk", "\t\t(to write disable/enable label)"); #endif + fprintf(stderr, "%s\n%s\n", + " disklabel [-f slice_start_lba] [options]", + "\t\t(to force using manual offset)"); exit(1); } -- 2.11.4.GIT