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