]> git.ipfire.org Git - thirdparty/util-linux.git/blame - disk-utils/fdisk.8
Imported from util-linux-2.2 tarball.
[thirdparty/util-linux.git] / disk-utils / fdisk.8
CommitLineData
6dbe3af9
KZ
1.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
2.\" May be distributed under the GNU General Public License
3.TH FDISK 8 "Tue Mar 22 01:00:00 1994" "Linux 1.0" "Linux Programmer's Manual"
4.SH NAME
5fdisk \- Partition table manipulator for Linux
6.SH SYNOPSIS
7.B fdisk
8.B "[ \-l ] [ \-v ] [ \-s partition] ["
9device
10.B ]
11.SH DESCRIPTION
12.B fdisk
13is a menu driven program for manipulation of the hard disk partition table.
14The
15.I device
16is usually one of the following:
17.sp
18.nf
19.RS
20/dev/hda
21/dev/hdb
22/dev/sda
23/dev/sdb
24.RE
25.fi
26The
27.I partition
28is a
29.I device
30name followed by a partition number. For example,
31.B /dev/hda1
32is the first partition on the first hard disk in the system.
33
34If possible,
35.B fdisk
36will obtain the disk geometry automatically. This is
37.I not
38necessarily the
39.I physical
40disk geometry, but is the disk geometry that MS-DOS uses for the partition
41table. If
42.B fdisk
43warns you that you need to set the disk geometry, please believe this
44statement, and set the geometry. This should only be necessary with
45certain SCSI host adapters (the drivers for which are rapidly being
46modified to provide geometry information automatically).
47
48Whenever a partition table is printed out, a consistency check is performed
49on the partition table entries. This check verifies that the physical and
50logical start and end points are identical, and that the partition starts
51and ends on a cylinder boundary (except for the first partition).
52
53Old versions of fdisk (all versions prior to 1.1r [including 0.93])
54incorrectly mapped the cylinder/head/sector specification onto absolute
55sectors. This may result in the first partition on a drive failing the
56consistency check. If you use LILO to boot, this situation can be ignored.
57However, there are reports that the OS/2 boot manager will not boot a
58partition with inconsistent data.
59
60Some versions of MS-DOS create a first partition which does not begin
61on a cylinder boundary, but on sector 2 of the first cylinder.
62Partitions beginning in cylinder 1 cannot begin on a cylinder boundary, but
63this is unlikely to cause difficulty unless you have OS/2 on your machine.
64
65In version 1.1r, a BLKRRPART ioctl() is performed before exiting when the
66partition table is updated. This is primarily to ensure that removable
67SCSI disks have their partition table information updated. If the kernel
68does not update its partition table information, fdisk warns you to
69reboot. If you do not reboot your system after receiving such a warning,
70you may lose or corrupt the data on the disk. Sometimes BLKRRPART fails
71silently, when installing Linux, you should
72.I always
73reboot after editing the partition table.
74
75.SH "DOS 6.x WARNING"
76
77The DOS 6.x FORMAT command looks for some information in the first
78sector of the data area of the partition, and treats this information
79as more reliable than the information in the partition table. DOS
80FORMAT expects DOS FDISK to clear the first 512 bytes of the data area
81of a partition whenever a size change occurs. DOS FORMAT will look at
82this extra information even if the /U flag is given -- we consider
83this a bug in DOS FORMAT and DOS FDISK.
84
85The bottom line is that if you use cfdisk or fdisk to change the size of a
86DOS partition table entry, then you must also use
87.B dd
88to zero the first 512 bytes of that partition before using DOS FORMAT to
89format the partition. For example, if you were using cfdisk to make a DOS
90partition table entry for /dev/hda1, then (after exiting fdisk or cfdisk
91and rebooting Linux so that the partition table information is valid) you
92would use the command "dd if=/dev/zero of=/dev/hda1 bs=512 count=1" to zero
93the first 512 bytes of the partition.
94.B BE EXTREMELY CAREFUL
95if you use the
96.B dd
97command, since a small typo can make all of the data on your disk useless.
98
99.B BE EXTREMELY CAREFUL
100if you use the
101.B dd
102command, since a small typo can make all of the data on your disk useless.
103
104For best resutls, you should always use an OS-specific partition table
105program. For example, you should make DOS partitions with the DOS FDISK
106program and Linux partitions with the Linux fdisk or Linux cfdisk program.
107
108.SH OPTIONS
109.TP
110.B \-v
111Prints version number of
112.B fdisk
113program.
114.TP
115.B \-l
116Lists the partition tables for
117.BR /dev/hda ,
118.BR /dev/hdb ,
119.BR /dev/sda ,
120.BR /dev/sdb ,
121.BR /dev/sdc ,
122.BR /dev/sdd ,
123.BR /dev/sde ,
124.BR /dev/sdf ,
125.BR /dev/sdg ,
126.BR /dev/sdh ,
127and then exits.
128.TP
129.BI \-s partition
130If the
131.I partition
132is not a DOS partition (i.e., the partition id is greater than 10), then
133the
134.I size
135of that partition is printed on the standard output. This value is
136normally used as an argument to the
137.BR mkfs (8)
138program to specify the size of the partition which will be formatted.
139.SH BUGS
140Although this man page (written by faith@cs.unc.edu) is poor, there is
141.I excellent
142documentation in the README.fdisk file (written by LeBlanc@mcc.ac.uk) that
143should always be with the fdisk distribution. If you cannot find this file
144in the
145.I util-linux-*
146directory or with the
147.I fdisk.c
148source file, then you should write to the distributor of your version of
149.B fdisk
150and complain that you do not have all of the available documentation.
151.SH AUTHOR
152A. V. Le Blanc (LeBlanc@mcc.ac.uk)
153.br
154v1.0r: SCSI and extfs support added by Rik Faith (faith@cs.unc.edu)
155.br
156v1.1r: Bug fixes and enhancements by Rik Faith (faith@cs.unc.edu), with
157special thanks to Michael Bischoff (i1041905@ws.rz.tu-bs.de or
158mbi@mo.math.nat.tu-bs.de).
159.br
160v1.3: Latest enhancements and bug fixes by A. V. Le Blanc, including the
161addition of the
162.B \-s
163option.
164.bt
165v2.0: Disks larger than 2GB are now fully supported, thanks to Remy Card's
166llseek support.