History log of /freebsd-9.3-release/sbin/bsdlabel/bsdlabel.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 234410 18-Apr-2012 ae

MFC r234122:
It seems that libdisk(3) incorrectly sets d_secperunit value.
Automatically fix it like GEOM_PART_BSD does.

PR: bin/165789


# 227556 16-Nov-2011 ae

MFC r227231:
To be in sync with GEOM_PART_BSD limit the maximum number of supported
partitions to 20.

MFC r227248:
bsdlabel(8) could automatically fill many of disklabel's deprecated
fields, but user could specify some of those fields when edits disklabel
with `bsdlabel -e`. But without -A flag these fields might be
overwritten with default values from the virgin disklabel.
So, don't overwrite such fields if they are not zero. Also add checks
to prevent creating disklabel with less than DEFPARTITIONS and more
than MAXPARTITIONS partitions.

PR: bin/162332
Tested by: Eugene Grosbein

MFC r227262:
Remove unneeded checks.

MFC r227270:
Add recommendation to use gpart(8) when user tries write disklabel
or bootcode to already opened provider.

MFC r227296:
Fix multi-line comment formatting.

Approved by: re (kib)


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 219449 10-Mar-2011 uqs

Widen fields that display partition offset/length.

This makes partitions between 50GiB and 2TiB (16TiB for 4k drives) print
correctly aligned.

While here, fix type of secsize. g_sectorsize() returns ssize_t, don't
store this in an unsigned var. Bump WARNS to 6.

MFC after: 4 weeks


# 219448 10-Mar-2011 uqs

Remove dead code in bsdlabel depending on __alpha__


# 216095 01-Dec-2010 kevlo

Closing file descriptors when it's done


# 215704 22-Nov-2010 brucec

Fix some more warnings found by clang.


# 211873 27-Aug-2010 jh

Don't attempt to write label with GEOM_BSD based method if the class is
not available. This improves error reporting when bsdlabel(8) is unable
to open a device for writing. If GEOM_BSD was unavailable, only a rather
obscure error message "Class not found" was printed.

PR: bin/58390
Reviewed by: ae
Discussed with: marcel
MFC after: 1 month


# 211342 15-Aug-2010 jh

- Check that strtoul(3) succeeds to convert the entire string in a few
places.
- In getasciilabel(), set the disk type only when a valid type is given.

PR: bin/86765
MFC after: 2 weeks


# 209614 30-Jun-2010 jh

- Don't assign the return value from read(2) to a variable of type
int.
- Use errx(3) instead of err(3) to print the error message on short
reads in readlabel(). errno won't be set on short reads which can
easily occur here due to the fixed size read request.

PR: 144307
Reviewed by: bde


# 208132 16-May-2010 kevlo

Use setresuid/setresgid to drop privileges


# 196383 19-Aug-2009 marcel

Remove the dependency on the kernel -- in particular the gctl request to
the GEOM_BSD class -- to translate the absolute offsets in the label to
relative ones. This makes bslabel(8) work correctly with GEOM_PART and
also when the BSD label is nested under arbitrary partitioning schemes.

Inspired by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Approved by: re (kib)


# 183496 30-Sep-2008 lulf

- A call to close(2) might overwrite errno and thus give a wrong error message
on g_providername failure.

Suggested by: pjd
Approved by: pjd (mentor)


# 183487 30-Sep-2008 lulf

- Improve error message given on g_providername call failure.
- While there, make error messages consistent with the rest.

Approved by: kib (mentor)


# 183143 18-Sep-2008 lulf

- Make bsdlabel use libgeom to determine provider name, device path, the media
size and the sector size.
- Fix a bug where bsdlabel would try to read a regular file using the geom_bsd
class.

Quick review by: phk
Approved by: pjd (mentor)


# 177517 23-Mar-2008 rodrigc

Remove comment about "-r" flag from readlabel. "-r" is a no-op.
The is comment is left over from the old disklabel command.

Reviewed by: phk


# 174501 09-Dec-2007 marcel

Allow bsdlabel to operate on labels that have at most 26 partitions
by virtue of there not being any (lower-case) letters avaliable for
more partitions.


# 163539 20-Oct-2006 maxim

o '-s' flag was killed in rev. 1.75. Clean getopt(3).

PR: bin/104616
Submitted by: Oliver Fromme
MFC after: 1 week


# 149061 14-Aug-2005 iedowse

Attempt to improve the logic for automatically sizing partitions
to take into account the new default of starting the first partition
after the boot blocks instead of at sector 0. If you used automatic
sizing when the first partition did not start at 0, you would get
an error that the automatically sized partition extended beyond the
end of the disk.

Note that there are probably still many more complex cases where
automatic sizing and placement will not work (e.g. non-contiguous
or out of order partitions).


# 139856 07-Jan-2005 rse

Fix the derivation of the GEOM name from the specified device name by
complementing the existing special case of a not existing /dev prefix
with the recognition of an already existing /dev prefix.

This implicitly solves the following two issues related to working on
GEOM devices /dev/foo/bar (which have the GEOM provider name "foo/bar")
with the expected commands like "bsdlabel /dev/foo/bar":

1. the error "Geom not found" when trying to write or edit the BSD
label (because previously the incorrect GEOM name "bar" instead of
"foo/bar" was derived from "/dev/foo/bar").

2. the multiple times reported "magically introduced" partition offset
of 63 blocks and the resulting errors like "partition extends past
end of unit" and "partition c doesn't start at 0!".

This implicitly resulted because bsdlabel(8) determines the "MBR
offset" via GEOM and (intentionally) silently falls back to an offset
of 0 if it could not be queried (which is the case if the name was
incorrectly derived).

Usually (at least on PCs) the offset for the first slice is 63 blocks
and bsdlabel(8) automatically subtracts them from the absolute
offsets in the read on-disk BSD label, resulting in the display of an
effective offset of 0. If the GEOM query fails, the assumed offset of
0 is subtracted and an incorrect effective offset of 63 is displayed
and tried to be worked upon.

Reviewed by: pjd
MFC after: 1 week


# 134973 09-Sep-2004 brooks

The disk labels generated by bsdlabel can no address more than
0xffffffff sectors. Document this limit and avoid installing bogus
labels on disks with more sectors.

Allowing the installation of labels addressing as much of the disk as
possiable may be a useful addition in some situations, but this was easy
to implement and should reduce confusion.

PR: bin/71408


# 133384 09-Aug-2004 des

The multiplier prefix is actually a multiplier suffix.


# 133348 08-Aug-2004 des

Use fallthrough to simplify the multiplier logic; optimistically add
support for the T multiplier; improve the error message for unrecognized
multipliers.


# 133347 08-Aug-2004 des

Fix some whitespace issues, and move a curly brace out of an #ifdef to
avoid confusing auto-indenting editors.


# 127650 30-Mar-2004 luigi

Implement a '-f' flag to teach bsdlabel to work on files instead of
disk partitions.


# 127044 15-Mar-2004 jhb

When installing boot blocks into an Alpha BSD label, setup the location,
length, and flags fields at the end of the SRM boot sector so that SRM can
find the bootstrap code. This fixes bsdlabel -m alpha to generate bootable
disklabels.

Reviewed by: phk


# 121222 18-Oct-2003 phk

Only automatically create an 'a' partition when there is nothing
but a 'c' partition.


# 120821 05-Oct-2003 iedowse

Remove the hardcoded default block/frag/cpg values from bsdlabel
and the logic for setting them according to the partition size.
Instead, unspecified filesystem values are left at 0 so that newfs
will use its own defaults. It just caused confusion to have the
defaults duplicated in two different places.

Reviewed by: phk


# 119510 27-Aug-2003 phk

When we initialize a disk with a virgin label, create also an 'a'
partition which starts after the bootstrap area and fills the entire
disk.


# 115995 07-Jun-2003 phk

Augh! Fix the sparc64 build:

If we don't have a default label location for the compiled architecture,
insist that a -m <architecture> option is specified.


# 115948 07-Jun-2003 phk

Sanitize setting of labeloffset and labelsector.


# 115809 04-Jun-2003 phk

Give ia64 the exact same semantics as i386 with respect to non-512
byte sector devices.


# 115794 04-Jun-2003 marcel

Unbreak ia64. 'nuff said.


# 115696 02-Jun-2003 phk

Fix sectorsize != 512 on i386 and pc98. Add test cases for same.


# 115624 01-Jun-2003 phk

Simplify the GEOM OAM api: Drop the request type, and let everything
hinge on the "verb" parameter which the class gets to interpret as
it sees fit.

Move the entire request into the kernel and move changed parameters
back when done.


# 115449 31-May-2003 obrien

Protext copyright[].


# 114982 13-May-2003 phk

Add pc98 archtecture entry.

Approved by: re/rwatson


# 114862 09-May-2003 phk

Before reading an ascii label, initialize with defaults so that
getasciipartspec() has a sectorisize in case it needs one.

Approved by: re/jhb


# 114860 09-May-2003 phk

Sigh, this shows just how much one can be conditioned my the environment:

Just because we for the last ten years have fought for every byte
in the boot code on i386, doesn't mean that other architectures could
not actually have space to spare there.

Remore debugging message.


# 114673 04-May-2003 phk

Add transparent handling of mbroffset for backwards compatibility.


# 114574 03-May-2003 phk

More axe-work:

Hide all the historical fields of the label, unless people ask for them with -A,
set them to intelligently chosen defaults otherwise.

Distill the manual page to remove inaccuracies, misundertandings and obsolete
information. It can probably still be done better but now at least it is
not misinforming people.


# 114571 03-May-2003 phk

Some minor remodelling with a large axe.


# 114569 03-May-2003 phk

Use new geom.ctl based OAM instead of ioctls.
Various cleanup.


# 114557 02-May-2003 phk

bsd_disklabel_le_dec() takes an extra argument now.


# 114552 02-May-2003 phk

Vastly simplify architecture handling: Use properties of label as
recorded in global variables, rather than checks on the architecture.

Drop horribly code to handle MBR/PC98's embedded in the BSD label area.
If you need to have an MBR or PC98 on your disk, you should not overlap
it with a BSDLABEL, if you don't need it, this code is nothing but trouble.


# 114551 02-May-2003 phk

Default the location to the compiled for architecture if no -m arg specified.


# 114550 02-May-2003 phk

Add three global variables which contain the location, size and a flag
for the alpha checksum, and set them depending on the specified architecture

Don't look for disklabels every 16 bytes, look the only place they should
be for the current architecture.

Always read the label from the raw disk and decode it into struct
disklabel rather than trust a cast from random addresses.

When writing to the raw disk, encode the label properly.


# 114545 02-May-2003 phk

Remove the well-intentioned, but ill thought out check which prevents us
from dd(1)'ing the boot code off one drive and have bsdlabel write it
on another.


# 113680 18-Apr-2003 phk

First scrub of s/disklabel/bsdlabel/

bsdlabel.5 deliberately exempted, its contents looks less than useful.


# 112945 01-Apr-2003 yar

Don't die of SIGSEGV on a missing fstype field
in a saved disklabel file.

MFC after: 1 week


# 112307 15-Mar-2003 ru

Teach disklabel(8) about different hardware architectures.
This is aimed at creating floppies during cross-releases.
For different endianness machines, a tool like bswapfs(8)
is necessary to make the generated floppies readable on
the target machine. While here, fixed unaligned access
on Alphas.

Tested on: i386, alpha


# 111286 22-Feb-2003 ru

Deal with vestiges of d_boot[01].


# 109901 26-Jan-2003 phk

If we fail to open O_RDWR, try opening O_RDONLY, if we use ioctls
to fiddle the disk we can get away with it.

Try to use DIOCBSDBB to write boot code.


# 109891 26-Jan-2003 phk

IA64 still needs to be able to run on MBR+BSD combination, so put disklabel
back.

Pointed out by: peter


# 109889 26-Jan-2003 phk

Drop the silly notion that i386 has two bootstrap files now that sys/boot
creates a single file named just "boot".

Apart from the fact that the option "-s" is now gone and that "-b" should
be pointed at /boot/boot instead of /boot/boot1, this patch should be
a no-op.


# 109887 26-Jan-2003 phk

Remove #if checks for NUMBOOT==0, it's not relevant for any architecture
and if we get such an architecture, we can just avoid using the relevant
options.


# 109884 26-Jan-2003 phk

Offer better advice in #error.

Remove yet a usage message about -N/-W


# 109882 26-Jan-2003 phk

Remove ia64 and powerpc #ifdefs: this is i386/pc98/alpha only code.


# 109879 26-Jan-2003 phk

Remove #ifdef __sparc64__ code. GEOM uses native SUN labels on this arch,
so no hacks are needed.


# 109878 26-Jan-2003 phk

Fix typo in last commit.
Rearrange bits in writelabel() a bit for improved readability.


# 109875 26-Jan-2003 phk

Remember to remove -N and -W from usage.


# 109874 26-Jan-2003 phk

Don't fiddle write-protect status of disklabel, it's a discontinued feature.


# 109872 26-Jan-2003 phk

Retire the "-N" and "-W" options which implemented write-protection
for the disklabel: This facility is OBE.

First of all, we cannot sensibly implement this in a properly stacked
environment.

Second, if we did, it would confuse the heck out of users who
wouldn't be able to "start from scratch" by dd(8)'ing /dev/zero
onto /dev/da0.

Third, the offered protection is not comprehensive: no other software
would respect it.

Fourth and finally, the disklabel is already protected against
tampering if it controls open partitions.

Uselessness of these options discussed with: peter


# 109378 16-Jan-2003 des

Clear part_set, part_size_type and part_offset_type before parsing the
ascii label; otherwise checklabel() might report spurious errors because
of leftovers from a previous pass.

Reviewed by: bde
MFC after: 1 week


# 108650 04-Jan-2003 nyan

Rename the dos_partition structure for pc98 to pc98_partition.


# 107534 02-Dec-2002 grog

Relax partition overlap check to allow Vinum partitions to overlap
other partitiosns. This is necessary when migrating conventional
partitions to Vinum and was broken by recent more stringent overlap
checks. This is arguably the wrong way to do it. A better method
would be to have the loader understand a subset of Vinum partitioning
and allow an install directly to Vinum, but until then, this is the
best we have.

Reviewed by: jhb
Approved by: re (rwatson)


# 107041 18-Nov-2002 julian

Everything in the disklabel is unsigned so make all the input routines
take unsigned values.
his allows one to label disk with the number of blocks > 31 bits
(though less then 32 bits)

e.g.
# size offset fstype [fsize bsize bps/cpg]
c: 3125755904 0 unused 0 0 # (Cyl. 0 - 194569*)
d: 3125755840 64 unused 0 0 # (Cyl. 0*- 194569*)
which is needd to test UFS2


# 104674 08-Oct-2002 nyan

Fix to support pc98.


# 104543 05-Oct-2002 phk

Don't be noisy if DIOCWLABEL fails, it's probably because we're writing
the first label to the raw disk.

Sponsored by: DARPA & NAI Labs.


# 104272 01-Oct-2002 phk

Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:

Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h.

These two new copies are still intact copies of disklabel.h and
therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them
in programs which already include <sys.disklabel.h> is currently a
no-op.

This commit adds a number of such #includes.

Once I have verified that I have fixed all the places which need fixing,
I will commit the updated versions of the three #include files.

Sponsored by: DARPA & NAI Labs.


# 103669 20-Sep-2002 phk

Construct new disklabels based on the medias stated parameters in
userland, rather than expect all possible GEOMetries to know about
BSD disklabels.

Sponsored by: DARPA & NAI Labs


# 102231 21-Aug-2002 trhodes

s/filesystem/file system/g as discussed on -developers


# 101994 16-Aug-2002 bmilekic

Fix more breakage due to FSTYPENAMES/DKTYPENAMES split.

Also submitted by: David Wolfskill <david@catwhisker.org>


# 99365 03-Jul-2002 markm

Apply __FBSDID(); fix local variable(names) that stomp on global
definitions; fix some const strings; fix some signedness issues.


# 97855 05-Jun-2002 iedowse

Oops, unbreak parsing of the `type' field in getasciilabel(). I had
changed a `goto' to a `continue' in revision 1.52, but it continued
the wrong loop.

Noticed by: bde


# 97553 30-May-2002 alfred

correct comment (replace i386 with __i386__)


# 97535 29-May-2002 iedowse

Fix some serious brain damage in the default block/frag/cpg parameters
that are used if none at all are specified for a partition. Don't
keep replaying the last field if we run out of fields when processing
a line. Use a 8:1 frag:block ratio for both defaults.

More work here is required. I think disklabel should not attempt
to choose default filesystem parameters, and instead let newfs pick
any defaults if required.

PR: i386/38703
Reported by: Martin Kraemer <Martin.Kraemer@Fujitsu-Siemens.com>


# 97534 29-May-2002 iedowse

Split out the code for parsing the partition specification lines
into a separate function to avoid some over-long lines.


# 97047 21-May-2002 benno

Spread the word of PowerPC.


# 96475 12-May-2002 phk

Retire the bogus uses of the disklabel field d_sbsize and begin to
initialize it to zero so we don't have to have everbody and their
aunt including FFS specific header files.

Sponsored by: DARPA & NAI Labs.


# 94065 07-Apr-2002 phk

Get us to WARNS=2 with a bit of constification and some printf fiddling.

Pick up the c-partitions magicness from sys/disklabel.h instead
of defining our own magicness for it, remove trivial comment.

Sponsored by: DARPA and NAI Labs.


# 94061 07-Apr-2002 phk

Nuke a totally pointless optional debug option

Sponsored by: DARPA and NAI Labs.


# 93809 04-Apr-2002 phk

Remove remaining traces of d_boot[01]


# 93724 03-Apr-2002 phk

Kill only usage of the undocumnted and unuse d_boot[01] fields of
struct disklabel.

Sponsored by: DARPA & NAI Labs.


# 92715 19-Mar-2002 imp

Remove stray register


# 92541 18-Mar-2002 imp

o remove __P
o Use ANSI function definitions
o const poison
o remove register


# 92058 11-Mar-2002 obrien

Add complete Sparc64 support.
Submitted by: tmm

Dike out vax support.


# 92057 11-Mar-2002 obrien

* Support the Sparc64.
* Do not default to any particular platform. Require that we explicitly
support a particular platform.


# 91603 03-Mar-2002 phk

A bit of premptive GEOM POLA magic: If we don't get a virgin disklabel
from /dev/food0, then try from /dev/f00d0c, in strange cases this work.


# 81911 19-Aug-2001 kris

Silence non-constant format string warnings by marking functions
as __printflike()/__printf0like(), adding const, or adding missing "%s"
format strings, as appropriate.

MFC after: 2 weeks


# 79452 09-Jul-2001 brian

Fix the type of the NULL arg to execl()

Idea from: Theo de Raadt <deraadt@openbsd.org>


# 78735 24-Jun-2001 dd

Nuke unused variables.


# 75915 24-Apr-2001 imp

Say "add -r" rather than 'use -r' since the former is more correct.
The latter implies to many people that they use only -r, which is
incorrect.


# 73573 05-Mar-2001 imp

First attempt to not overflow in disk space calculations. Use off_t
for the size variable used to calculate the size of the partition.
Also use ULL suffix for constants to ensure that we use 64 bit math.


# 73034 25-Feb-2001 jwd

Allow for easier configuration when using disklabel. A sample
being:

# size offset fstype [fsize bsize bps/cpg]
a: 400M 0 4.2BSD 4096 16384 75 # (Cyl. 0 - 812*)
b: 1G * swap
c: * * unused
e: 204800 * 4.2BSD
f: 5g * 4.2BSD
g: * * 4.2BSD

These patches are the original work of Randell Jesup, and
I believe Matt Dillon, with additional work by Warner Losh.
Please let me know if I've left someone out.

Incorporated into this is the fix for PR bin/22727.

This patchset still has style issues and a possible problem on
large disks. However, it was a agreed to get these committed before
performing major surgery on them.

PR: bin/22727
Submitted by: Randell Jesup <rjesup@wgate.com>


# 68044 31-Oct-2000 jkh

Add support for virgin disklabels

Submitted by: dillon


# 65921 16-Sep-2000 phk

Turn dkcksum() into an __inline function.

Change its type to u_int_16_t.


# 59457 21-Apr-2000 obrien

A local WIP snook in rev 1.31.

Noticed by: bde


# 59429 20-Apr-2000 obrien

Found more places where 'r' was being prepended to the device name.


# 59216 14-Apr-2000 imp

Add include of errno.h where needed, remove extern int errno where not.

These commits were inspired by a similar commit to netbsd.


# 59114 10-Apr-2000 obrien

Don't prepend "r" for the raw device anymore.


# 55742 10-Jan-2000 kris

10 X's for mkstemp(), and don't redefine _PATH_TMP


# 51637 25-Sep-1999 billf

Remove duplicate declarations for two internal functions.
Remove delcaration for getenv(), we already get it from stdlib.h


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 48957 21-Jul-1999 billf

Fix a gcc stupidity where it thought a variable was being used uninitialized

Add a case for UNSPEC which is in order by the enum definition, but out of
order alphabetically.


# 41901 17-Dec-1998 jkh

Look for boot blocks in new default location.


# 40615 23-Oct-1998 bde

Oops, don't quite use RAW_PART instead of RAWPARTITION. Use 'a' + RAW_PART
in both places.


# 40475 17-Oct-1998 bde

Updated the error message for EXDEV to match recent kernel fixes.
Fixed nearby indentation.

Use RAW_PART instead of RAWPARTITION.


# 38483 23-Aug-1998 bde

Attempt to fix my breakage of the alpha makebootarea() in rev.1.19.
The previous attempt just converted compile time breakage to runtime
breakage.


# 38474 21-Aug-1998 gpalmer

Try to make this compile on both alpha and i386


# 38411 17-Aug-1998 bde

Fixed style bugs in previous commit.

Added some comments on #endifs.


# 38384 17-Aug-1998 dfr

Teach disklabel how to install a bootstrap on an alpha with SRM console.


# 37865 25-Jul-1998 bde

Fixed bugs in `disklabel -R...':
- nonstandard sector sizes didn't work because the sector size in the
ASCII label was not read before a (default, wrong) sector size was used.
- the exit status was 0 after exiting early due to an invalid ASCII label.

Abort `disklabel -B...' if the secondary bootstrap doesn't fit.


# 37773 20-Jul-1998 bde

Clear d_boot0 and d_boot1 in the virgin label. These are overlaid by
d_packname in in-core labels, so they are garbage if d_packname is
initialized in the dummy label for the whole disk. dsopen() will soon
initialize d_packname to "fictitious" if it is not already initialized.

Fixed nearby error handling. Rev.1.7 apparently confused Perror()
with perror().


# 37234 28-Jun-1998 bde

Fixed printf format errors.


# 36756 08-Jun-1998 charnier

Use warnx()+fprintf() to handle multi-line messages. Correct K&R support and
KNF continuation indent rule.
Requested by: Bruce.


# 36632 04-Jun-1998 charnier

Add section number to .Xr. Use of .Nm. Typo. Add rcsid. Remove unused
#includes. Use err(3).


# 26542 10-Jun-1997 charnier

Add Id. Use err(3). Costmetic in usage string.


# 24359 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# 24180 24-Mar-1997 imp

Use mkstemp rather than mktemp to prevent a small race.

Obtained from: OpenBSD


# 16431 17-Jun-1996 bde

Moved initialization of defaults for the label for the whole disk from
disklabel(8) to the kernel (dsopen()). Drivers should initialize the
hardware values (rpm, interleave, skews). Drivers currently don't do
this, but it usually doesn't matter since rotational position stuff is
normally disabled.


# 13892 03-Feb-1996 joerg

Try to preserve the fdisk table in the primary bootstrap, should it
already exist.

Mention the cases where this doesn't work in the BUGS section of the
man page.


# 13550 21-Jan-1996 joerg

Finally implement the "auto" disktype. It attempts to get all the
required information from the driver, and produce a virgin disklabel
for it. The latter might be further edited with `disklabel -e' to
satisfy the user's need.

The magic sequence is:

disklabel -r -w sdX auto
disklabel -e sdX


# 13544 21-Jan-1996 joerg

Declare functions, resolve printf-format warnings.


# 8871 30-May-1995 rgrimes

Remove trailing whitespace.


# 6643 22-Feb-1995 bde

Don't clobber d_secperunit in `disklabel -e'. `disklabel -e' replaces all
the values that it doesn't print by defaults. This seems wrong. I want
to be able to see the total number of sectors more than edit it. The
default d_secperunit of (sectors/track * tracks/cylinder * cylinders) is
bogus if sectors/track is only an approximation and more bogus if
sectors/track and tracks/cylinder are dummy values such as 4096 and 1
to defeat ufs's pessimizations.


# 5393 04-Jan-1995 gibbs

Allow for the specification of bsize, fsize, and bps (blocks per segment)
for LFS filesystems.


# 3111 26-Sep-1994 pst

disklabel will dump core if you give it too few numbers to process
Obtained from: NetBSD misc/490 - John Kohl


# 1558 26-May-1994 rgrimes

BSD 4.4 Lite sbin Sources

Note: XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.