SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE




YUM REPOSITORY

 
 

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

EXT2PREPARE

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

NAME

ext2prepare - ext2 filesystem resizing preparation tool 

SYNOPSIS

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

DESCRIPTION

Theext2preparecommand modifies an unmounted ext2 filesystem ondeviceso thatext2online(8)program can later resize the mounted filesystem to be at least as large assizealthough the actual maximum size will be some larger multiple of variousfilesystem parameters. Whileext2preparemust be run on an unmounted filesystem,devicedoes not have to currently be as large assize.This allows one to later increase the size ofdeviceand do the resize while the filesystem is mounted.

If thesizeparameter does not have a modifier, it will be taken to be in ext2filesystem blocks (which can be 1k, 2k, or 4k - usedumpe2fs(8)to find out more information about the current filesystem). The modifiersb,K,M,G,orTmean thesizeparameter is given in 512-byte blocks, kilo-, mega-, giga-, or terabytesrespectively.

Theext2prepareprogram does not change the size of the actual device. If you wish toenlarge a filesystem, you must make sure you expand the underlying devicefirst. This can be done online for Logical Volumes by usinglvextend(8)from the LVM package, or possibly viamdorRAIDfacilities in the hardware if you are not using partitions. It isnotpossible to do this by using thefdisk(8)family of tools to extend a partition while it is mounted (at least theauthor has not been able to successfully do this).

Because of the original design of the ext2 filesystem did not haveonline resizing in mind, there are certain limitations to the amount ofresizing that can be done while the filesystem is mounted, if youhaven't done any preparation for the resize. The default block size forext2 was 1k blocks until v1.15 of e2fsprogs (1999), where it changed to4k blocks for filesystems larger than 512MB.

With no filesystem preparation, it is always possible to resize to thenext 256MB boundary for 1k filesystems, the next 2GB boundary for for 2kfilesystems, and the next 16GB boundary for 4k filesystems. By usingext2prepareon an unmounted filesystem, it is possible forext2online(8)to increase the size of a mounted ext2 filesystem to at least the givensizeby reserving blocks for group descriptors within the ext2 filesystemstructure.ext2preparedoes this by moving metadata blocks while the filesystem is unmounted,and then allocating the freed blocks to a reserved inode so thatext2online(8)can later use these blocks to safely enlarge the filesystem while thefilesystem is in use.

 

OPTIONS

-d, --debug
Turn on debugging messages.
-f, --force
Force preparation without first checking the filesystem state.
-q, --quiet
Do not print anything but error messages.
-v, --verbose
Turn on normal verbose status messages.
-V, --version
Print the version number and exit.

 

RETURN VALUES

0      Resizing successful
1       Error in options or command-line parameters.
2      Error while preparing filesystem.


 

EXAMPLES

The following example shows how to testext2preparewith a spare partition. First a filesystem of 32MB is created on thedevice. The filesystem is then prepared to grow to a maximum size of 10GB,mounted, and the size is verified. The filesystem is then extended tofill the device (the default action when no size is given), and the newsize is verified.

mke2fs /dev/vg0/lvtest 32768
ext2prepare /dev/vg0/lvtest 10G
mkdir /mnt/test
mount -o debug,check=strict /dev/vg0/lvtest /mnt/test
df /mnt/test
ext2online -d -v /dev/vg0/lvtest
df /mnt/test

By using thedebugandcheck=strictoptions to mount, as well as the-dand-voptions toext2prepare,we will see the user-space status messages, and the kernelmessages will be logged by syslog.

 

WARNING

Note that resizing a mounted filesystem is inherently dangerous and maycorrupt filesystems, although no errors resulting in data loss have everbeen reported to the author. In theory online resizing should work finewith arbitrarily large filesystems, but it has not yet been tested by theauthor on a filesystem larger than 11GB.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

The ext2prepareprogram was written by Andreas Dilger <adilgerAATTclusterfs.com> usingthe ext2 resizing tools developed by Lennert Buytenhek <buytenhAATTgnu.org>.The ext2online kernel patches are available as part of the GNU ext2resizepackage at <http://sourceforge.org/projects/ext2resize/>.

 

BUGS

Becauseext2prepareuses a reserved inode to store blocks needed for a future resize(so that they can't be accidentally used by another program),e2fsck(8)needs to be slightly modified to understand this new reserved inode.If an unmodifiede2fsck(8)is run on a filesystem that has been changed withext2prepare,it will complain about the reserved inode and free all of the blocksassociated with this inode. If this happens, it will not be possibleto resize the filesystem past the default limits given previously.However, the filesystem itself is not affected in any way by these events.The ext2resize programs donotwork on big-endian machines (Alpha, SPARC, PPC, etc).

 

COPYRIGHT

ext2prepareis (C) Copyright 1999, 2000, 2001 by Andreas Dilger and may bedistributed under the terms of the GNU General Public License. 

SEE ALSO

dumpe2fs(8)ext2online(8)ext2resize(8)e2fsck(8)lvextend(8)


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
RETURN VALUES
EXAMPLES
WARNING
AUTHOR
BUGS
COPYRIGHT
SEE ALSO

This document was created byman2html,using the manual pages.