SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE




YUM REPOSITORY

 
 

MAN page from Mandriva 2010 ext2resize-1.1.19-4mdv2010.0.i586.rpm

EXT2RESIZE

Section: Maintenance Commands (8)
Updated: July 2002
Index 

NAME

ext2resize - GNU ext2 filesystem resizer 

SYNOPSIS

ext2resize [-d] [-f] [-q] [-u] [-v] [-V]device [size[b|K|M|G|T]] 

DESCRIPTION

Theext2resizetool resizes an unmounted ext2 or ext3 file system. It enlarges or shrinksthe file system located ondevice(partition, loop device, logical volume, ...)so that it will havesizeext2 filesystem blocks.If thesizeparameter is not specified, the filesystem will be resized to fill thegiven device.Thesizeparameter may have one of the optional modifiersb,K,M,G,orTwhich means thesizeparameter is given in 512-byte blocks, kilo-, mega-, giga-, orterabytes respectively.

Theext2resizeprogram does not manipulate the size of the device. If you wish toenlarge a filesystem, you must make sure you expand the underlyingdevice first. This can be done usingfdisk(8)for partitions, by deleting the partition and recreating it with alarger size (assuming there is free spaceafterthe partition in question). Make sure you re-create it with thesame starting disk cylinder as before! Otherwise, the resize operationwill certainly not work, and you may lose your entire filesystem.Logical Volumes can be extended withlvextend(8)prior to growing a filesystem, or after shrinking it. Alternately, thee2fsadm(8)tool can be used to combine the operations of resizing the Logical Volumeand the filesystem into one step.

If you wish to shrink an ext2 or ext3 partition, first useext2resizeto shrink the file system. You may then usefdisk(8)orlvreduce(8)to shrink the device. When shrinking the size of the device, make sureyou 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 filesystemslightly more than desired, shrink the device, and then runext2resizeagain to increase the filesystem to fill the new device size.

-d, --debug
Turns on various debugging messages, normally only useful if you areworking on a problem.
-f, --force
Force, do not perform sanity checks. Use with EXTREME care, you areon your own.
-u, --unsafe
Do not flush the device's buffer cache during the resize operation.
-q, --quiet
Do not print anything but error messages.
-v, --verbose
Turn on extra progress status messages.
-V, --version
Print the version number and exit.

 

RETURN VALUES

0      Resizing successful.
1       Error in command line.
2      Error during resize operation.


 

EXAMPLES

The following example shows how to testext2resizeon a loop device. First a file of 10MB is created which is mounted onthe loop device. Then an 5MB ext2 filesystem is created on the loop device,after mounting its size is verified. Before extending unmounting isnecessary, when the size parameter is not specified the filesystem isextended 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
mkdir /mnt/test
mount /dev/loop0 /mnt/test
df /mnt/test
umount /mnt/test
ext2resize /dev/loop0
mount /dev/loop0 /mnt/test
df /mnt/test

For shrinking the loop device we need to unmount it first, then runext2resizewith a size parameter, in this case 8MB.

umount /mnt/test
ext2resize /dev/loop0 8M
mount /mnt/test
df /mnt/test

 

WARNING

Note that resizing a filesystem is inherently dangerous and may corruptfilesystems, although no errors resulting in data loss have ever beenreported to the author.Use with caution.Backups arealwaysa good idea, because your disk may fail at any time, you delete files byaccident, or your computer is struck by a meteor.

 

AUTHOR

GNU ext2resizewas written by Lennert Buytenhek <buytenhAATTgnu.org> with the help ofvolunteers around the net. This man page was originally writtenby Joey Hess <joeyAATTkitenet.net>, and Dirk de Rycke significantlyimproved that version.

 

COPYRIGHT

GNU ext2resizeis (C) Copyright 1998, 1999 by Lennert Buytenhek, and 2000, 2001Andreas Dilger, and may be distributedunder the terms of the GNU General Public License. 

SEE ALSO

fdisk(8)e2fsck(8)e2fsadm(8)mke2fs(8)losetup(8)lvextend(8)lvreduce(8)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
EXAMPLES
WARNING
AUTHOR
COPYRIGHT
SEE ALSO

This document was created byman2html,using the manual pages.