ext2online(8) - Linux man page
Name
ext2online - online (mounted) ext2 filesystem resizerSynopsis
ext2online [-C fd] [-d] [-q] [-v] [-V] {device|mountpoint} [size[b|K|M|G|T]]Note
The ext2online tool can currently only resize ext3 filesystems online, despite references to ext2 filesystems in this manpage. The ext2resize tool can resize either ext2 or ext3 filesystems, offline.Description
The filesystem specified by device (partition, loop device, logical volume, ...) or mountpoint must currently be mounted, and it will be enlarged to fill the device, by default. If the optional size parameter is specified, then this size will be used instead. If the size parameter does not have an optional modifier, it will be taken to be in ext2 filesystem blocks (which can be 1k, 2k, or 4k - use dumpe2fs(8) to find out more information about the current filesystem). The modifiers b, K, M, G, or T mean the size parameter is given in 512-byte blocks, kilo-, mega-, giga-, or terabytes respectively.
The ext2online program does not change the size of the actual device - only the filesystem. If you wish to enlarge a filesystem, you must make sure you expand the underlying device first. This can be done online for Logical Volumes by using lvextend(8) from the LVM package, or for ease-of-use you can use e2fsadm(8) which combines the LV extension and ext2 filesystem resizing into one step. Alternately, you may be able to use facilities in md or RAID facilities in the hardware, if you are not using a partition table. It is not possible to do this by using the fdisk(8) family of tools to extend a partition while it is mounted (at least the author has not been able to successfully do this).
Because of the original design of the ext2 filesystem did not have online resizing in mind, there are certain limitations to the amount of resizing that can be done while the filesystem is mounted, if you haven't done any preparation for the resize. The default block size for ext2 was 1k blocks until v1.15 of e2fsprogs (1999), where it changed to 4k blocks for filesystems larger than 512MB.
With no filesystem preparation, it is always possible to resize to the next 256MB boundary for 1k filesystems, the next 2GB boundary for for 2k filesystems, and the next 16GB boundary for 4k filesystems.
Options
- -C fd, --completion=fd
- Output completion information to file descriptor fd.
- -d, --debug
- Turn on debugging messages.
- -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 command line (options or specified device)
- 2 Error in specified size
- 3 Error in pre-resizing (user space) operation
- 4 Error during the in-kernel resizing operation
- 5 Error in post-resizing operation (update of metadata backups)
- 2 Error in specified size
Examples
The following example shows how to test ext2online with a spare partition. First a filesystem of 32MB is created on the device, mounted, and the size is verified. The filesystem is then extended to fill the device (the default action when no size is given), and the new size is verified. dd if=/dev/zero of=/tmp/file bs=1k count=64k
mke2fs -f /tmp/file 32768
mkdir /mnt/test
mount -o loop,debug,check=strict /tmp/file /mnt/test
df /mnt/test
ext2online -d -v /tmp/testfile
df /mnt/test
By using the debug and check=strict options to mount, as well as the -d and -v flags to ext2online, we will see the user-space status messages, and the kernel messages will be logged by syslog.
