view usr/src/man/man1m/fdisk.1m @ 13659:57451298f940

1469 ttyc/ttyd should be an allowed console device Reviewed by: Milan Jurik <milan.jurik@xylab.cz> Reviewed by: Alexander Eremin <alexander.r.eremin@gmail.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Gary Mills <gary_mills@fastmail.fm>
date Thu, 05 Apr 2012 08:47:21 -0500
parents 5b2854ecc12d
children
line wrap: on
line source

'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH FDISK 1M "Jul 2, 2009"
.SH NAME
fdisk \- create or modify fixed disk partition table
.SH SYNOPSIS
.LP
.nf
\fBfdisk\fR [\fB-o\fR \fIoffset\fR] [\fB-s\fR \fIsize\fR] [\fB-P\fR \fIfill_patt\fR] [\fB-S\fR \fIgeom_file\fR]
     [\fB-w\fR | \fB-r\fR | \fB-d\fR | \fB-n\fR | \fB-I\fR | \fB-B\fR | \fB-t\fR | \fB-T\fR | \fB-g\fR | \fB-G\fR | \fB-R\fR | \fB-E\fR]
     [-\fB-F\fR \fIfdisk_file\fR] [ [\fB-v\fR] \fB-W\fR {\fIfdisk_file\fR | \(mi}]
     [\fB-h\fR] [\fB-b\fR \fImasterboot\fR]
     [\fB-A\fR \fIid\fR : \fIact\fR : \fIbhead\fR : \fIbsect\fR : \fIbcyl\fR : \fIehead\fR : \fIesect\fR :
         \fIecyl\fR : \fIrsect\fR : \fInumsect\fR]
     [\fB-D\fR \fIid\fR : \fIact\fR : \fIbhead:\fR \fIbsect\fR : \fIbcyl\fR : \fIehead:\fR \fIesect\fR :
         \fIecyl\fR : \fIrsect\fR : \fInumsect\fR] \fIrdevice\fR
.fi

.SH DESCRIPTION
.sp
.LP
This command is used to do the following:
.RS +4
.TP
.ie t \(bu
.el o
Create and modify an \fBfdisk\fR partition table on x86 systems
.RE
.RS +4
.TP
.ie t \(bu
.el o
Create and modify an \fBfdisk\fR partition table on removable media on SPARC or
x86 systems
.RE
.RS +4
.TP
.ie t \(bu
.el o
Install the master boot record that is put in the first sector of the fixed
disk on x86 systems only
.RE
.sp
.LP
This table is used by the first-stage bootstrap (or firmware) to identify parts
of the disk reserved for different operating systems, and to identify the
partition containing the second-stage bootstrap (the \fIactive\fR Solaris
partition). The \fIrdevice\fR argument must be used to specify the raw device
associated with the fixed disk, for example, \fB/dev/rdsk/c0t0d0p0\fR.
.sp
.LP
The program can operate in three different modes. The first is interactive
mode. In interactive mode, the program displays the partition table as it
exists on the disk, and then presents a menu allowing the user to modify the
table. The menu, questions, warnings, and error messages are intended to be
self-explanatory.
.sp
.LP
In interactive mode, if there is no partition table on the disk, the user is
given the options of creating a default partitioning or specifying the initial
table values. The default partitioning allocates the entire disk for the
Solaris system and makes the Solaris system partition active. In either case,
when the initial table is created, \fBfdisk\fR also writes out the first-stage
bootstrap (x86 only) code along with the partition table. In this mode, (x86
only) when creating an  entry for a non-EFI partition on a disk that is larger
than 2 TB (terabytes), \fBfdisk\fR warns that the maximum size of the partition
is 2 TB. Under these conditions percentages displayed by \fBfdisk\fR are based
on 2 TB.
.sp
.LP
The second mode of operation is used for automated entry addition, entry
deletion, or replacement of the entire \fBfdisk\fR table. This mode can add or
delete an entry described on the command line. In this mode the entire
\fBfdisk\fR table can be read in from a file replacing the original table.
\fBfdisk\fR can also be used to create this file. There is a command line
option that will cause \fBfdisk\fR to replace any \fBfdisk\fR table with the
default of the whole disk for the Solaris system.
.sp
.LP
The third mode of operation is used for disk diagnostics. In this mode, a
section of the disk can be filled with a user-specified pattern and mode
sections of the disk can also be read or written.
.LP
Note -
.sp
.RS 2
The third mode of operation is not currently supported for extended partitions
.RE
.sp
.LP
When \fBfdisk\fR creates a partition, the space is allocated in the \fBfdisk\fR
partition table, but the allocated disk space is not initialized.
\fBnewfs\fR(1M) is required to create and write file system metadata to the new
partition, and \fBformat\fR(1M) is required to write the VTOC or EFI/GPT
metadata.
.SS "Menu Options"
.sp
.LP
The menu options for interactive mode given by the \fBfdisk\fR program are:
.sp
.ne 2
.na
\fB\fBCreate a partition\fR\fR
.ad
.sp .6
.RS 4n
This option allows the user to create a new partition. The maximum number of
partitions is 4. The program will ask for the type of the partition (SOLARIS,
MS-DOS, UNIX, or other). It will then ask for the size of the partition as a
percentage of the disk. The user may also enter the letter \fBc\fR at this
point, in which case the program will ask for the starting cylinder number and
size of the partition in cylinders. If a \fBc\fR is not entered, the program
will determine the starting cylinder number where the partition will fit. In
either case, if the partition would overlap an existing partition or will not
fit, a message is displayed and the program returns to the original menu.
.RE

.sp
.ne 2
.na
\fB\fBChange Active (Boot from) partition\fR\fR
.ad
.sp .6
.RS 4n
This option allows the user to specify the partition where the first-stage
bootstrap will look for the second-stage bootstrap, otherwise known as the
\fIactive\fR partition.
.RE

.sp
.ne 2
.na
\fB\fBDelete a partition\fR\fR
.ad
.sp .6
.RS 4n
This option allows the user to delete a previously created partition. Note that
this will destroy all data in that partition.
.RE

.sp
.ne 2
.na
\fB\fBChange between Solaris and Solaris2 Partition IDs\fR\fR
.ad
.sp .6
.RS 4n
This option allows the user to switch between the current \fBfdisk\fR operating
system partition identifier and the previous one. This does not affect any data
in the disk partition and is provided for compatibility with older software.
.RE

.sp
.ne 2
.na
\fB\fBEdit/View extended partitions\fR\fR
.ad
.sp .6
.RS 4n
This option provides the extended partition menu to the user. Use the extended
partition menu to add and delete logical drives, change the sysid of the
logical drives, and display logical drive information. To commit the changes
made in the extended partition, you must return to the main menu using the
extended partition submenu option \fBr\fR. There is also an option to display
the list of options that the extended partition submenu supports. Given below
is the list:
.sp
.ne 2
.na
\fB\fBa\fR\fR
.ad
.RS 5n
Add a logical drive.
.sp
Use this submenu option to add a logical drive. There are three pieces of
information that are required: The beginning cylinder, the size (in cylinders
or in human readable form - KB, MB, or GB), and the partition ID. While
specifying the partition ID, there is an option (\fBI\fR) that you can use to
list the supported partitions.
.RE

.sp
.ne 2
.na
\fB\fBd\fR\fR
.ad
.RS 5n
Delete a logical drive.
.sp
Use this submenu option to delete a logical drive. The only input required is
the number of the logical drive that is to be deleted.
.RE

.sp
.ne 2
.na
\fB\fBh\fR\fR
.ad
.RS 5n
Display the help menu.
.sp
This submenu option displays the supported operations in the extended partition
submenu.
.RE

.sp
.ne 2
.na
\fB\fBi\fR\fR
.ad
.RS 5n
Change the id of the logical drive.
.sp
Use this submenu option to change the system ID of the existing logical drives.
A list of supported system IDs is displayed when you use the \fBI\fR option
when in this submenu.
.RE

.sp
.ne 2
.na
\fB\fBp\fR\fR
.ad
.RS 5n
Display the logical drive layout.
.sp
Displays the logical drive information to stdout. This output reflects any
changes made during the current run of the \fBfdisk\fR program. The changes are
not committed to the disk until return to the main menu (using the submenu
\fBr\fR) and choose the option to commit the changes to the disk.
.RE

.sp
.ne 2
.na
\fB\fBr\fR\fR
.ad
.RS 5n
Return to the main \fBfdisk\fR menu.
.sp
Exit the extended partition submenu and return to the main menu.
.RE

.RE

.sp
.LP
Use the following options to include your modifications to the partition table
at this time or to cancel the session without modifying the table:
.sp
.ne 2
.na
\fB\fBExit\fR\fR
.ad
.RS 10n
This option writes the new version of the table created during this session
with \fBfdisk\fR out to the fixed disk, and exits the program.
.RE

.sp
.ne 2
.na
\fB\fBCancel\fR\fR
.ad
.RS 10n
This option exits without modifying the partition table.
.RE

.SH OPTIONS
.sp
.LP
The following options apply to \fBfdisk\fR:
.sp
.ne 2
.na
\fB\fB-A\fR \fIid:act:bhead:bsect:bcyl:ehead:esect:ecyl:rsect:numsect\fR\fR
.ad
.sp .6
.RS 4n
Add a partition as described by the argument (see the \fB-F\fR option below for
the format). Use of this option will zero out the \fBVTOC\fR on the Solaris
partition if the \fBfdisk\fR table changes.
.RE

.sp
.ne 2
.na
\fB\fB-b\fR \fImaster_boot\fR\fR
.ad
.sp .6
.RS 4n
Specify the file \fImaster_boot\fR as the master boot program. The default
master boot program is \fB/usr/lib/fs/ufs/mboot\fR.
.RE

.sp
.ne 2
.na
\fB\fB-B\fR\fR
.ad
.sp .6
.RS 4n
Default to one Solaris partition that uses the whole disk. On an x86 machine,
if the disk is larger than 2 TB (terabytes), the default size of the Solaris
partition will be limited to 2 TB.
.RE

.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.sp .6
.RS 4n
Turn on verbose \fIdebug\fR mode. This will cause \fBfdisk\fR to print its
state on stderr as it is used. The output from this option should not be used
with \fB-F\fR.
.RE

.sp
.ne 2
.na
\fB\fB-D\fR \fIid:act:bhead:bsect:bcyl:ehead:esect:ecyl:rsect:numsect\fR\fR
.ad
.sp .6
.RS 4n
Delete a partition as described by the argument (see the \fB-F\fR option below
for the format). Note that the argument must be an exact match or the entry
will not be deleted! Use of this option will zero out the \fBVTOC\fR on the
Solaris partition if the \fBfdisk\fR table changes.
.RE

.sp
.ne 2
.na
\fB\fB-E\fR\fR
.ad
.sp .6
.RS 4n
Create an \fBEFI\fR partition that uses the entire disk.
.RE

.sp
.ne 2
.na
\fB\fB-F\fR \fIfdisk_file\fR\fR
.ad
.sp .6
.RS 4n
Use fdisk file \fIfdisk_file\fR to initialize table. Use of this option will
zero out the \fBVTOC\fR on the Solaris partition if the \fBfdisk\fR table
changes.
.sp
The \fIfdisk_file\fR contains four specification lines for the primary
partitions followed by specification lines for the logical drives. You must
have four lines for the primary partitions if there is at least one logical
drive. In this case, if the number of primary partitions to be configured is
less than four, the remaining lines should be filled with zeros.
.sp
Each line is composed of entries that are position-dependent, are separated by
whitespace or colons, and have the following format:
.sp
\fIid act bhead bsect bcyl ehead esect ecyl rsect numsect\fR
.sp
\&...where the entries have the following values:
.sp
.ne 2
.na
\fB\fIid\fR\fR
.ad
.RS 11n
This is the type of partition and the correct numeric values may be found in
\fBfdisk.h\fR.
.RE

.sp
.ne 2
.na
\fB\fIact\fR\fR
.ad
.RS 11n
This is the active partition flag; \fB0\fR means not active and \fB128\fR means
active. For logical drives, this flag will always be set to 0 even if specified
as 128 by the user.
.RE

.sp
.ne 2
.na
\fB\fIbhead\fR\fR
.ad
.RS 11n
This is the head where the partition starts. If this is set to \fB0\fR,
\fBfdisk\fR will correctly fill this in from other information.
.RE

.sp
.ne 2
.na
\fB\fIbsect\fR\fR
.ad
.RS 11n
This is the sector where the partition starts. If this is set to \fB0\fR,
\fBfdisk\fR will correctly fill this in from other information.
.RE

.sp
.ne 2
.na
\fB\fIbcyl\fR\fR
.ad
.RS 11n
This is the cylinder where the partition starts. If this is set to \fB0\fR,
\fBfdisk\fR will correctly fill this in from other information.
.RE

.sp
.ne 2
.na
\fB\fIehead\fR\fR
.ad
.RS 11n
This is the head where the partition ends. If this is set to \fB0\fR,
\fBfdisk\fR will correctly fill this in from other information.
.RE

.sp
.ne 2
.na
\fB\fIesect\fR\fR
.ad
.RS 11n
This is the sector where the partition ends. If this is set to \fB0\fR,
\fBfdisk\fR will correctly fill this in from other information.
.RE

.sp
.ne 2
.na
\fB\fIecyl\fR\fR
.ad
.RS 11n
This is the cylinder where the partition ends. If this is set to \fB0\fR,
\fBfdisk\fR will correctly fill this in from other information.
.RE

.sp
.ne 2
.na
\fB\fIrsect\fR\fR
.ad
.RS 11n
The relative sector from the beginning of the disk where the partition starts.
This must be specified and can be used by \fBfdisk\fR to fill in other fields.
For logical drives, you must make sure that there are at least 63 free sectors
before the \fIrsect\fR specified for a logical drive.
.RE

.sp
.ne 2
.na
\fB\fInumsect\fR\fR
.ad
.RS 11n
The size in sectors of this disk partition. This must be specified and can be
used by \fBfdisk\fR to fill in other fields.
.RE

.RE

.sp
.ne 2
.na
\fB\fB-g\fR\fR
.ad
.sp .6
.RS 4n
Get the label geometry for disk and display on stdout (see the \fB-S\fR option
for the format).
.RE

.sp
.ne 2
.na
\fB\fB-G\fR\fR
.ad
.sp .6
.RS 4n
Get the physical geometry for disk and display on stdout (see the \fB-S\fR
option for the format).
.RE

.sp
.ne 2
.na
\fB\fB-h\fR\fR
.ad
.sp .6
.RS 4n
Issue verbose message; message will list all options and supply an explanation
for each.
.RE

.sp
.ne 2
.na
\fB\fB-I\fR\fR
.ad
.sp .6
.RS 4n
Forgo device checks. This is used to generate a file image of what would go on
a disk without using the device. Note that you must use \fB-S\fR with this
option (see above).
.RE

.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.sp .6
.RS 4n
Don't update \fBfdisk\fR table unless explicitly specified by another option.
If no other options are used, \fB-n\fR will only write the master boot record
to the disk. In addition, note that \fBfdisk\fR will not come up in interactive
mode if the \fB-n\fR option is specified.
.RE

.sp
.ne 2
.na
\fB\fB-o\fR \fIoffset\fR\fR
.ad
.sp .6
.RS 4n
Block offset from start of disk. This option is used for \fB-P\fR, \fB-r\fR,
and \fB-w\fR. Zero is assumed when this option is not used.
.RE

.sp
.ne 2
.na
\fB\fB-P\fR \fIfill_patt\fR\fR
.ad
.sp .6
.RS 4n
Fill disk with pattern \fIfill_patt\fR. \fIfill_patt\fR can be decimal or hex
and is used as number for constant long word pattern. If \fIfill_patt\fR is
\fB#\fR, then pattern is block # for each block. Pattern is put in each block
as long words and fills each block (see \fB-o\fR and \fB-s\fR).
.RE

.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.sp .6
.RS 4n
Read from disk and write to stdout. See \fB-o\fR and \fB-s\fR, which specify
the starting point and size of the operation.
.RE

.sp
.ne 2
.na
\fB\fB-R\fR\fR
.ad
.sp .6
.RS 4n
Treat disk as read-only. This is for testing purposes.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR \fIsize\fR\fR
.ad
.sp .6
.RS 4n
Number of blocks to perform operation on (see \fB-o\fR).
.RE

.sp
.ne 2
.na
\fB\fB-S\fR \fIgeom_file\fR\fR
.ad
.sp .6
.RS 4n
Set the label geometry to the content of the \fIgeom_file\fR. The
\fIgeom_file\fR contains one specification line. Each line is delimited by a
new-line character (\fB\n\fR). If the first character of a line is an asterisk
(*), the line is treated as a comment. Each line is composed of entries that
are position-dependent, are separated by white space, and have the following
format:
.sp
.in +2
.nf
\fIpcyl ncyl acyl bcyl nheads nsectors sectsiz\fR
.fi
.in -2
.sp

where the entries have the following values:
.sp
.ne 2
.na
\fB\fIpcyl\fR\fR
.ad
.RS 12n
This is the number of physical cylinders for the drive.
.RE

.sp
.ne 2
.na
\fB\fIncyl\fR\fR
.ad
.RS 12n
This is the number of usable cylinders for the drive.
.RE

.sp
.ne 2
.na
\fB\fIacyl\fR\fR
.ad
.RS 12n
This is the number of alt cylinders for the drive.
.RE

.sp
.ne 2
.na
\fB\fIbcyl\fR\fR
.ad
.RS 12n
This is the number of offset cylinders for the drive (should be zero).
.RE

.sp
.ne 2
.na
\fB\fInheads\fR\fR
.ad
.RS 12n
The number of heads for this drive.
.RE

.sp
.ne 2
.na
\fB\fInsectors\fR\fR
.ad
.RS 12n
The number of sectors per track.
.RE

.sp
.ne 2
.na
\fB\fIsectsiz\fR\fR
.ad
.RS 12n
The size in bytes of a sector.
.RE

.RE

.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.sp .6
.RS 4n
Adjust incorrect slice table entries so that they will not cross partition
table boundaries.
.RE

.sp
.ne 2
.na
\fB\fB-T\fR\fR
.ad
.sp .6
.RS 4n
Remove incorrect slice table entries that span partition table boundaries.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.sp .6
.RS 4n
Output the HBA (virtual) geometry dimensions. This option must be used in
conjunction with the \fB-W\fR flag. This option will work for platforms which
support virtual geometry. (x86 only)
.RE

.sp
.ne 2
.na
\fB\fB-w\fR\fR
.ad
.sp .6
.RS 4n
Write to disk and read from stdin. See \fB-o\fR and \fB-s\fR, which specify the
starting point and size of the operation.
.RE

.sp
.ne 2
.na
\fB\fB-W\fR \fB\(mi\fR\fR
.ad
.sp .6
.RS 4n
Output the disk table to \fBstdout\fR.
.RE

.sp
.ne 2
.na
\fB\fB-W\fR \fIfdisk_file\fR\fR
.ad
.sp .6
.RS 4n
Create an \fBfdisk\fR file \fIfdisk_file\fR from disk table. This can be used
with the \fB-F\fR option below.
.RE

.SH FILES
.sp
.ne 2
.na
\fB\fB/dev/rdsk/c0t0d0p0\fR\fR
.ad
.RS 25n
Raw device associated with the fixed disk.
.RE

.sp
.ne 2
.na
\fB\fB/usr/lib/fs/ufs/mboot\fR\fR
.ad
.RS 25n
Default master boot program.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Architecture	x86 and SPARC
.TE

.SH SEE ALSO
.sp
.LP
\fBuname\fR(1), \fBfmthard\fR(1M), \fBformat\fR(1M), \fBnewfs\fR(1M),
\fBprtvtoc\fR(1M), \fBattributes\fR(5)
.SH DIAGNOSTICS
.sp
.LP
Most messages will be self-explanatory. The following may appear immediately
after starting the program:
.sp
.ne 2
.na
\fB\fBFdisk\fR: \fBcannot open\fR <\fBdevice\fR>\fR
.ad
.sp .6
.RS 4n
This indicates that the device name argument is not valid.
.RE

.sp
.ne 2
.na
\fB\fBFdisk\fR: \fBunable to get device parameters for device\fR
<\fBdevice\fR>\fR
.ad
.sp .6
.RS 4n
This indicates a problem with the configuration of the fixed disk, or an error
in the fixed disk driver.
.RE

.sp
.ne 2
.na
\fB\fBFdisk\fR: \fBerror reading partition table\fR\fR
.ad
.sp .6
.RS 4n
This indicates that some error occurred when trying initially to read the fixed
disk. This could be a problem with the fixed disk controller or driver, or with
the configuration of the fixed disk.
.RE

.sp
.ne 2
.na
\fB\fBFdisk\fR: \fBerror writing boot record\fR\fR
.ad
.sp .6
.RS 4n
This indicates that some error occurred when trying to write the new partition
table out to the fixed disk. This could be a problem with the fixed disk
controller, the disk itself, the driver, or the configuration of the fixed
disk.
.RE