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