Provided by: ext2resize_1.1.19-3_i386
ext2resize - GNU ext2 filesystem resizer
ext2resize [-d] [-f] [ -q] [-u] [-v] [-V] device [size[b|K|M|G|T]]
The ext2resize tool resizes an unmounted ext2 or ext3 file system. It
enlarges or shrinks the file system located on device (partition, loop
device, logical volume, ...) so that it will have size ext2 filesystem
blocks. If the size parameter is not specified, the filesystem will be
resized to fill the given device. The size parameter may have one of
the optional modifiers b, K, M, G, or T which means the size parameter
is given in 512-byte blocks, kilo-, mega-, giga-, or terabytes
The ext2resize program does not manipulate the size of the device. If
you wish to enlarge a filesystem, you must make sure you expand the
underlying device first. This can be done using fdisk(8) for
partitions, by deleting the partition and recreating it with a larger
size (assuming there is free space after the partition in question).
Make sure you re-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. Logical Volumes can be extended
with lvextend(8) prior to growing a filesystem, or after shrinking it.
Alternately, the e2fsadm(8) tool can be used to combine the operations
of resizing the Logical Volume and the filesystem into one step.
If you wish to shrink an ext2 or ext3 partition, first use ext2resize
to shrink the file system. You may then use fdisk(8) or lvreduce(8) to
shrink the device. When shrinking the size of the device, make sure you
do not make it smaller than the reduced size of the ext2 filesystem.
If you are not sure of the exact device size, shrink the filesystem
slightly more than desired, shrink the device, and then run ext2resize
again to increase the filesystem to fill the new device size.
Turns on various debugging messages, normally only useful if you
are working on a problem.
Force, do not perform sanity checks. Use with EXTREME care, you
are on your own.
Do not flush the device’s buffer cache during the resize
Do not print anything but error messages.
Turn on extra progress status messages.
Print the version number and exit.
0 Resizing successful.
1 Error in command line.
2 Error during resize operation.
The following example shows how to test ext2resize on a loop device.
First a file of 10MB is created which is mounted on the loop device.
Then an 5MB ext2 filesystem is created on the loop device, after
mounting its size is verified. Before extending unmounting is
necessary, when the size parameter is not specified the filesystem is
extended to fill the loop device.
dd if=/dev/zero of=/tmp/file bs=1k count=10240
losetup /dev/loop0 /tmp/file
mke2fs /dev/loop0 5120
mount /dev/loop0 /mnt/test
mount /dev/loop0 /mnt/test
For shrinking the loop device we need to unmount it first, then run
ext2resize with a size parameter, in this case 8MB.
ext2resize /dev/loop0 8M
Note that resizing a filesystem is inherently dangerous and may corrupt
filesystems, although no errors resulting in data loss have ever been
reported to the author. Use with caution. Backups are always a good
idea, because your disk may fail at any time, you delete files by
accident, or your computer is struck by a meteor.
GNU ext2resize was written by Lennert Buytenhek <email@example.com> with
the help of volunteers around the net. This man page was originally
written by Joey Hess <firstname.lastname@example.org>, and Dirk de Rycke
significantly improved that version.
GNU ext2resize is (C) Copyright 1998, 1999 by Lennert Buytenhek, and
2000, 2001 Andreas Dilger, and may be distributed under the terms of
the GNU General Public License.
fdisk(8) e2fsck(8) e2fsadm(8) mke2fs(8) losetup(8) lvextend(8)