281 lines
7.7 KiB
HTML
281 lines
7.7 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of RESIZE2FS</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>RESIZE2FS</H1>
|
|
Section: Maintenance Commands (8)<BR>Updated: January 2020<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
resize2fs - ext2/ext3/ext4 file system resizer
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>resize2fs</B>
|
|
|
|
[
|
|
<B>-fFpPMbs</B>
|
|
|
|
]
|
|
[
|
|
<B>-d</B>
|
|
|
|
<I>debug-flags</I>
|
|
|
|
]
|
|
[
|
|
<B>-S</B>
|
|
|
|
<I>RAID-stride</I>
|
|
|
|
]
|
|
[
|
|
<B>-z</B>
|
|
|
|
<I>undo_file</I>
|
|
|
|
]
|
|
<I>device</I>
|
|
|
|
[
|
|
<I>size</I>
|
|
|
|
]
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B>resize2fs</B>
|
|
|
|
program will resize ext2, ext3, or ext4 file systems. It can be used to
|
|
enlarge or shrink an unmounted file system located on
|
|
<I>device</I>.
|
|
|
|
If the filesystem is mounted, it can be used to expand the size of the
|
|
mounted filesystem, assuming the kernel and the file system supports
|
|
on-line resizing. (Modern Linux 2.6 kernels will support on-line resize
|
|
for file systems mounted using ext3 and ext4; ext3 file systems will
|
|
require the use of file systems with the resize_inode feature enabled.)
|
|
<P>
|
|
|
|
The
|
|
<I>size</I>
|
|
|
|
parameter specifies the requested new size of the filesystem.
|
|
If no units are specified, the units of the
|
|
<I>size</I>
|
|
|
|
parameter shall be the filesystem blocksize of the filesystem.
|
|
Optionally, the
|
|
<I>size</I>
|
|
|
|
parameter may be suffixed by one of the following units
|
|
designators: 'K', 'M', 'G', 'T' (either upper-case or lower-case) or 's'
|
|
for power-of-two kilobytes, megabytes, gigabytes, terabytes or 512 byte
|
|
sectors respectively. The
|
|
<I>size</I>
|
|
|
|
of the filesystem may never be larger than the size of the partition.
|
|
If
|
|
<I>size</I>
|
|
|
|
parameter is not specified, it will default to the size of the partition.
|
|
<P>
|
|
|
|
The
|
|
<B>resize2fs</B>
|
|
|
|
program does not manipulate the size of partitions. If you wish to enlarge
|
|
a filesystem, you must make sure you can expand the size of the
|
|
underlying partition first. This can be done using
|
|
<B><A HREF="/cgi-bin/man/man2html?8+fdisk">fdisk</A></B>(8)
|
|
|
|
by deleting the partition and recreating it with a larger size or using
|
|
<B><A HREF="/cgi-bin/man/man2html?8+lvextend">lvextend</A></B>(8),
|
|
|
|
if you're using the logical volume manager
|
|
<B><A HREF="/cgi-bin/man/man2html?8+lvm">lvm</A></B>(8).
|
|
|
|
When
|
|
recreating the partition, make sure you create it with the same starting
|
|
disk cylinder as before! Otherwise, the resize operation will
|
|
certainly not work, and you may lose your entire filesystem.
|
|
After running
|
|
<B><A HREF="/cgi-bin/man/man2html?8+fdisk">fdisk</A></B>(8),
|
|
|
|
run resize2fs to resize the ext2 filesystem
|
|
to use all of the space in the newly enlarged partition.
|
|
<P>
|
|
|
|
If you wish to shrink an ext2 partition, first use
|
|
<B>resize2fs</B>
|
|
|
|
to shrink the size of filesystem. Then you may use
|
|
<B><A HREF="/cgi-bin/man/man2html?8+fdisk">fdisk</A></B>(8)
|
|
|
|
to shrink the size of the partition. When shrinking the size of
|
|
the partition, make sure you do not make it smaller than the new size
|
|
of the ext2 filesystem!
|
|
<P>
|
|
|
|
The
|
|
<B>-b</B>
|
|
|
|
and
|
|
<B>-s</B>
|
|
|
|
options enable and disable the 64bit feature, respectively. The resize2fs
|
|
program will, of course, take care of resizing the block group descriptors
|
|
and moving other data blocks out of the way, as needed. It is not possible
|
|
to resize the filesystem concurrent with changing the 64bit status.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-b</B>
|
|
|
|
<DD>
|
|
Turns on the 64bit feature, resizes the group descriptors as necessary, and
|
|
moves other metadata out of the way.
|
|
<DT id="2"><B>-d </B><I>debug-flags</I>
|
|
|
|
<DD>
|
|
Turns on various resize2fs debugging features, if they have been compiled
|
|
into the binary.
|
|
<I>debug-flags</I>
|
|
|
|
should be computed by adding the numbers of the desired features
|
|
from the following list:
|
|
<BR>
|
|
|
|
<TT> </TT>2<TT> </TT>- Debug block relocations<BR>
|
|
<BR>
|
|
|
|
<TT> </TT>4<TT> </TT>- Debug inode relocations<BR>
|
|
<BR>
|
|
|
|
<TT> </TT>8<TT> </TT>- Debug moving the inode table<BR>
|
|
<BR>
|
|
|
|
<TT> </TT>16<TT> </TT>- Print timing information<BR>
|
|
<BR>
|
|
|
|
<TT> </TT>32<TT> </TT>- Debug minimum filesystem size (-M) calculation<BR>
|
|
<DT id="3"><B>-f</B>
|
|
|
|
<DD>
|
|
Forces resize2fs to proceed with the filesystem resize operation, overriding
|
|
some safety checks which resize2fs normally enforces.
|
|
<DT id="4"><B>-F</B>
|
|
|
|
<DD>
|
|
Flush the filesystem device's buffer caches before beginning. Only
|
|
really useful for doing
|
|
<B>resize2fs</B>
|
|
|
|
time trials.
|
|
<DT id="5"><B>-M</B>
|
|
|
|
<DD>
|
|
Shrink the file system to minimize its size as much as possible,
|
|
given the files stored in the file system.
|
|
<DT id="6"><B>-p</B>
|
|
|
|
<DD>
|
|
Prints out a percentage completion bars for each
|
|
<B>resize2fs</B>
|
|
|
|
operation during an offline resize, so that the user can keep track
|
|
of what the program is doing.
|
|
<DT id="7"><B>-P</B>
|
|
|
|
<DD>
|
|
Print an estimate of the number of file system blocks in the file system
|
|
if it is shrunk using
|
|
<B>resize2fs</B>'s
|
|
|
|
<B>-M</B>
|
|
|
|
option and then exit.
|
|
<DT id="8"><B>-s</B>
|
|
|
|
<DD>
|
|
Turns off the 64bit feature and frees blocks that are no longer in use.
|
|
<DT id="9"><B>-S </B><I>RAID-stride</I>
|
|
|
|
<DD>
|
|
The
|
|
<B>resize2fs</B>
|
|
|
|
program will heuristically determine the RAID stride that was specified
|
|
when the filesystem was created. This option allows the user to
|
|
explicitly specify a RAID stride setting to be used by resize2fs instead.
|
|
<DT id="10"><B>-z</B><I> undo_file</I>
|
|
|
|
<DD>
|
|
Before overwriting a file system block, write the old contents of the block to
|
|
an undo file. This undo file can be used with <A HREF="/cgi-bin/man/man2html?8+e2undo">e2undo</A>(8) to restore the old
|
|
contents of the file system should something go wrong. If the empty string is
|
|
passed as the undo_file argument, the undo file will be written to a file named
|
|
resize2fs-<I>device</I>.e2undo in the directory specified via the
|
|
<I>E2FSPROGS_UNDO_DIR</I> environment variable.
|
|
<P>
|
|
WARNING: The undo file cannot be used to recover from a power or system crash.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>KNOWN BUGS</H2>
|
|
|
|
The minimum size of the filesystem as estimated by resize2fs may be
|
|
incorrect, especially for filesystems with 1k and 2k blocksizes.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
<B>resize2fs</B>
|
|
|
|
was written by Theodore Ts'o <<A HREF="mailto:tytso@mit.edu">tytso@mit.edu</A>>.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
Resize2fs is Copyright 1998 by Theodore Ts'o and PowerQuest, Inc. All
|
|
rights reserved.
|
|
As of April, 2000
|
|
<B>Resize2fs</B>
|
|
|
|
may be redistributed under the terms of the GPL.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+fdisk">fdisk</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mke2fs">mke2fs</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+lvm">lvm</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+lvextend">lvextend</A></B>(8)
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="11"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="12"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="13"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="14"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="15"><A HREF="#lbAF">KNOWN BUGS</A><DD>
|
|
<DT id="16"><A HREF="#lbAG">AUTHOR</A><DD>
|
|
<DT id="17"><A HREF="#lbAH">COPYRIGHT</A><DD>
|
|
<DT id="18"><A HREF="#lbAI">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:15 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|