]>
Commit | Line | Data |
---|---|---|
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 | 7 | resize2fs \- 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 |
30 | The |
31 | .B resize2fs | |
4f858546 | 32 | program will resize ext2, ext3, or ext4 file systems. It can be used to |
4780e870 | 33 | enlarge or shrink an unmounted file system located on |
792a0881 | 34 | .IR device . |
bf69235a | 35 | If the filesystem is mounted, it can be used to expand the size of the |
061c566e TT |
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.) | |
bf69235a | 40 | .PP |
4780e870 | 41 | The |
f4b2a6db | 42 | .I size |
792a0881 TT |
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. | |
4780e870 | 47 | Optionally, the |
792a0881 | 48 | .I size |
94f20cd5 LC |
49 | parameter may be suffixed by one of the following units |
50 | designators: 'K', 'M', 'G', 'T' (either upper-case or lower-case) or 's' | |
51 | for power-of-two kilobytes, megabytes, gigabytes, terabytes or 512 byte | |
52 | sectors respectively. The | |
f4b2a6db | 53 | .I size |
792a0881 | 54 | of the filesystem may never be larger than the size of the partition. |
4780e870 | 55 | If |
792a0881 TT |
56 | .I size |
57 | parameter is not specified, it will default to the size of the partition. | |
f4b2a6db TT |
58 | .PP |
59 | The | |
60 | .B resize2fs | |
61 | program does not manipulate the size of partitions. If you wish to enlarge | |
3e9f8632 | 62 | a filesystem, you must make sure you can expand the size of the |
4780e870 | 63 | underlying partition first. This can be done using |
f4b2a6db | 64 | .BR fdisk (8) |
41e55437 TT |
65 | by deleting the partition and recreating it with a larger size or using |
66 | .BR lvextend (8), | |
67 | if you're using the logical volume manager | |
68 | .BR lvm (8). | |
4780e870 | 69 | When |
f4b2a6db | 70 | recreating the partition, make sure you create it with the same starting |
4780e870 TT |
71 | disk cylinder as before! Otherwise, the resize operation will |
72 | certainly not work, and you may lose your entire filesystem. | |
23658ffa TT |
73 | After running |
74 | .BR fdisk (8), | |
4780e870 | 75 | run resize2fs to resize the ext2 filesystem |
23658ffa | 76 | to use all of the space in the newly enlarged partition. |
f4b2a6db | 77 | .PP |
4780e870 | 78 | If you wish to shrink an ext2 partition, first use |
f4b2a6db | 79 | .B resize2fs |
4780e870 | 80 | to shrink the size of filesystem. Then you may use |
f4b2a6db | 81 | .BR fdisk (8) |
4780e870 TT |
82 | to shrink the size of the partition. When shrinking the size of |
83 | the partition, make sure you do not make it smaller than the new size | |
f4b2a6db | 84 | of the ext2 filesystem! |
fe12931f DW |
85 | .PP |
86 | The | |
87 | .B \-b | |
88 | and | |
89 | .B \-s | |
90 | options enable and disable the 64bit feature, respectively. The resize2fs | |
91 | program will, of course, take care of resizing the block group descriptors | |
92 | and moving other data blocks out of the way, as needed. It is not possible | |
93 | to resize the filesystem concurrent with changing the 64bit status. | |
24b2c7a7 TT |
94 | .SH OPTIONS |
95 | .TP | |
fe12931f DW |
96 | .B \-b |
97 | Turns on the 64bit feature, resizes the group descriptors as necessary, and | |
98 | moves other metadata out of the way. | |
99 | .TP | |
46c5490d | 100 | .B \-d \fIdebug-flags |
4780e870 | 101 | Turns on various resize2fs debugging features, if they have been compiled |
f4b2a6db | 102 | into the binary. |
c762c8e6 | 103 | .I debug-flags |
4780e870 | 104 | should be computed by adding the numbers of the desired features |
c762c8e6 TT |
105 | from the following list: |
106 | .br | |
4780e870 | 107 | 2 \-\ Debug block relocations |
c762c8e6 | 108 | .br |
4780e870 | 109 | 4 \-\ Debug inode relocations |
c762c8e6 | 110 | .br |
4780e870 | 111 | 8 \-\ Debug moving the inode table |
1eb31c48 TT |
112 | .br |
113 | 16 \-\ Print timing information | |
e231f175 TT |
114 | .br |
115 | 32 \-\ Debug minimum filesystem size (\-M) calculation | |
116 | .TP | |
46c5490d | 117 | .B \-f |
4780e870 | 118 | Forces resize2fs to proceed with the filesystem resize operation, overriding |
f4b2a6db TT |
119 | some safety checks which resize2fs normally enforces. |
120 | .TP | |
46c5490d | 121 | .B \-F |
c762c8e6 | 122 | Flush the filesystem device's buffer caches before beginning. Only |
4780e870 | 123 | really useful for doing |
c762c8e6 TT |
124 | .B resize2fs |
125 | time trials. | |
199ddaaa JB |
126 | .TP |
127 | .B \-M | |
97b7a946 TT |
128 | Shrink the file system to minimize its size as much as possible, |
129 | given the files stored in the file system. | |
199ddaaa JB |
130 | .TP |
131 | .B \-p | |
132 | Prints out a percentage completion bars for each | |
133 | .B resize2fs | |
4780e870 | 134 | operation during an offline resize, so that the user can keep track |
230709ae | 135 | of what the program is doing. |
199ddaaa JB |
136 | .TP |
137 | .B \-P | |
ce20096f | 138 | Print an estimate of the number of file system blocks in the file system |
97b7a946 TT |
139 | if it is shrunk using |
140 | .BR resize2fs 's | |
141 | .B \-M | |
142 | option and then exit. | |
199ddaaa | 143 | .TP |
fe12931f DW |
144 | .B \-s |
145 | Turns off the 64bit feature and frees blocks that are no longer in use. | |
146 | .TP | |
199ddaaa JB |
147 | .B \-S \fIRAID-stride |
148 | The | |
149 | .B resize2fs | |
150 | program will heuristically determine the RAID stride that was specified | |
151 | when the filesystem was created. This option allows the user to | |
152 | explicitly specify a RAID stride setting to be used by resize2fs instead. | |
03f9fd2a DW |
153 | .TP |
154 | .BI \-z " undo_file" | |
155 | Before overwriting a file system block, write the old contents of the block to | |
156 | an undo file. This undo file can be used with e2undo(8) to restore the old | |
157 | contents of the file system should something go wrong. If the empty string is | |
158 | passed as the undo_file argument, the undo file will be written to a file named | |
159 | resize2fs-\fIdevice\fR.e2undo in the directory specified via the | |
160 | \fIE2FSPROGS_UNDO_DIR\fR environment variable. | |
161 | ||
162 | WARNING: The undo file cannot be used to recover from a power or system crash. | |
199ddaaa JB |
163 | .SH KNOWN BUGS |
164 | The minimum size of the filesystem as estimated by resize2fs may be | |
165 | incorrect, especially for filesystems with 1k and 2k blocksizes. | |
24b2c7a7 | 166 | .SH AUTHOR |
c762c8e6 | 167 | .B resize2fs |
24b2c7a7 | 168 | was written by Theodore Ts'o <tytso@mit.edu>. |
fac9c206 TT |
169 | .SH COPYRIGHT |
170 | Resize2fs is Copyright 1998 by Theodore Ts'o and PowerQuest, Inc. All | |
4780e870 | 171 | rights reserved. |
0cee8a5c | 172 | As of April, 2000 |
fac9c206 | 173 | .B Resize2fs |
0cee8a5c | 174 | may be redistributed under the terms of the GPL. |
24b2c7a7 | 175 | .SH SEE ALSO |
f4b2a6db | 176 | .BR fdisk (8), |
24b2c7a7 | 177 | .BR e2fsck (8), |
41e55437 | 178 | .BR mke2fs (8), |
4780e870 | 179 | .BR lvm (8), |
41e55437 | 180 | .BR lvextend (8) |