]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blob - resize/resize2fs.8.in
Merge branch 'maint' into next
[thirdparty/e2fsprogs.git] / resize / resize2fs.8.in
1 .\" -*- nroff -*-
2 .\" Copyright 1997 by Theodore Ts'o. All Rights Reserved.
3 .\"
4 .\" .TH RESIZE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
5 .TH RESIZE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6 .SH NAME
7 resize2fs \- ext2/ext3/ext4 file system resizer
8 .SH SYNOPSIS
9 .B resize2fs
10 [
11 .B \-fFpPMbs
12 ]
13 [
14 .B \-d
15 .I debug-flags
16 ]
17 [
18 .B \-S
19 .I RAID-stride
20 ]
21 [
22 .B \-z
23 .I undo_file
24 ]
25 .I device
26 [
27 .I size
28 ]
29 .SH DESCRIPTION
30 The
31 .B resize2fs
32 program will resize ext2, ext3, or ext4 file systems. It can be used to
33 enlarge or shrink an unmounted file system located on
34 .IR device .
35 If the filesystem is mounted, it can be used to expand the size of the
36 mounted filesystem, assuming the kernel and the file system supports
37 on-line resizing. (Modern Linux 2.6 kernels will support on-line resize
38 for file systems mounted using ext3 and ext4; ext3 file systems will
39 require the use of file systems with the resize_inode feature enabled.)
40 .PP
41 The
42 .I size
43 parameter specifies the requested new size of the filesystem.
44 If no units are specified, the units of the
45 .I size
46 parameter shall be the filesystem blocksize of the filesystem.
47 Optionally, the
48 .I size
49 parameter may be suffixed by one of the following the units
50 designators: 's', 'K', 'M', or 'G',
51 for 512 byte sectors, kilobytes, megabytes, or gigabytes, respectively.
52 The
53 .I size
54 of the filesystem may never be larger than the size of the partition.
55 If
56 .I size
57 parameter is not specified, it will default to the size of the partition.
58 .PP
59 Note: when kilobytes is used above, I mean
60 .IR real ,
61 power-of-2 kilobytes, (i.e., 1024 bytes), which some politically correct
62 folks insist should be the stupid-sounding ``kibibytes''. The same
63 holds true for megabytes, also sometimes known as ``mebibytes'', or
64 gigabytes, as the amazingly silly ``gibibytes''. Makes you want to
65 gibber, doesn't it?
66 .PP
67 The
68 .B resize2fs
69 program does not manipulate the size of partitions. If you wish to enlarge
70 a filesystem, you must make sure you can expand the size of the
71 underlying partition first. This can be done using
72 .BR fdisk (8)
73 by deleting the partition and recreating it with a larger size or using
74 .BR lvextend (8),
75 if you're using the logical volume manager
76 .BR lvm (8).
77 When
78 recreating the partition, make sure you create it with the same starting
79 disk cylinder as before! Otherwise, the resize operation will
80 certainly not work, and you may lose your entire filesystem.
81 After running
82 .BR fdisk (8),
83 run resize2fs to resize the ext2 filesystem
84 to use all of the space in the newly enlarged partition.
85 .PP
86 If you wish to shrink an ext2 partition, first use
87 .B resize2fs
88 to shrink the size of filesystem. Then you may use
89 .BR fdisk (8)
90 to shrink the size of the partition. When shrinking the size of
91 the partition, make sure you do not make it smaller than the new size
92 of the ext2 filesystem!
93 .PP
94 The
95 .B \-b
96 and
97 .B \-s
98 options enable and disable the 64bit feature, respectively. The resize2fs
99 program will, of course, take care of resizing the block group descriptors
100 and moving other data blocks out of the way, as needed. It is not possible
101 to resize the filesystem concurrent with changing the 64bit status.
102 .SH OPTIONS
103 .TP
104 .B \-b
105 Turns on the 64bit feature, resizes the group descriptors as necessary, and
106 moves other metadata out of the way.
107 .TP
108 .B \-d \fIdebug-flags
109 Turns on various resize2fs debugging features, if they have been compiled
110 into the binary.
111 .I debug-flags
112 should be computed by adding the numbers of the desired features
113 from the following list:
114 .br
115 2 \-\ Debug block relocations
116 .br
117 4 \-\ Debug inode relocations
118 .br
119 8 \-\ Debug moving the inode table
120 .br
121 16 \-\ Print timing information
122 .br
123 32 \-\ Debug minimum filesystem size (\-M) calculation
124 .TP
125 .B \-f
126 Forces resize2fs to proceed with the filesystem resize operation, overriding
127 some safety checks which resize2fs normally enforces.
128 .TP
129 .B \-F
130 Flush the filesystem device's buffer caches before beginning. Only
131 really useful for doing
132 .B resize2fs
133 time trials.
134 .TP
135 .B \-M
136 Shrink the file system to minimize its size as much as possible,
137 given the files stored in the file system.
138 .TP
139 .B \-p
140 Prints out a percentage completion bars for each
141 .B resize2fs
142 operation during an offline resize, so that the user can keep track
143 of what the program is doing.
144 .TP
145 .B \-P
146 Print an estimate of the number of file system blocks in the file system
147 if it is shrunk using
148 .BR resize2fs 's
149 .B \-M
150 option and then exit.
151 .TP
152 .B \-s
153 Turns off the 64bit feature and frees blocks that are no longer in use.
154 .TP
155 .B \-S \fIRAID-stride
156 The
157 .B resize2fs
158 program will heuristically determine the RAID stride that was specified
159 when the filesystem was created. This option allows the user to
160 explicitly specify a RAID stride setting to be used by resize2fs instead.
161 .TP
162 .BI \-z " undo_file"
163 Before overwriting a file system block, write the old contents of the block to
164 an undo file. This undo file can be used with e2undo(8) to restore the old
165 contents of the file system should something go wrong. If the empty string is
166 passed as the undo_file argument, the undo file will be written to a file named
167 resize2fs-\fIdevice\fR.e2undo in the directory specified via the
168 \fIE2FSPROGS_UNDO_DIR\fR environment variable.
169
170 WARNING: The undo file cannot be used to recover from a power or system crash.
171 .SH KNOWN BUGS
172 The minimum size of the filesystem as estimated by resize2fs may be
173 incorrect, especially for filesystems with 1k and 2k blocksizes.
174 .SH AUTHOR
175 .B resize2fs
176 was written by Theodore Ts'o <tytso@mit.edu>.
177 .SH COPYRIGHT
178 Resize2fs is Copyright 1998 by Theodore Ts'o and PowerQuest, Inc. All
179 rights reserved.
180 As of April, 2000
181 .B Resize2fs
182 may be redistributed under the terms of the GPL.
183 .SH SEE ALSO
184 .BR fdisk (8),
185 .BR e2fsck (8),
186 .BR mke2fs (8),
187 .BR lvm (8),
188 .BR lvextend (8)