RESIZE2FS(8)
๐ RESIZE2FS(8) ๐
okay bestie, welcome to the glow-up station โ this is the System Manager's Manual page for resize2fs, and we're about to make your ext filesystem bigger or smaller and look cute doing it. ๐
โจ NAME โจ
resize2fs โ the ext2/ext3/ext4 file system resizer ๐ซถ
๐ฆ SYNOPSIS ๐ฆ
resize2fs [ -fFpPMbs ] [ -d debug-flags ] [ -S RAID-stride ] [ -z
undo_file ] device [ size ]
๐ธ DESCRIPTION ๐ธ
So like, the resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. And if the file system is mounted? It can be used to expand the size of the mounted file system โ assuming the kernel and the file system support 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.) ๐
The size parameter specifies the requested new size of the file system. If no units are specified, the units of the size parameter shall be the file system blocksize of the file system. Optionally, the size 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 size of the file system may never be larger than the size of the partition. If size parameter is not specified, it will default to the size of the partition.
The resize2fs program does not manipulate the size of partitions. ๐ซ So if you wish to enlarge a file system, you must make sure you can expand the size of the underlying partition first. This can be done using fdisk(8) by deleting the partition and recreating it with a larger size, or using lvextend(8) if you're using the logical volume manager lvm(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 file system. ๐ After running fdisk(8), run resize2fs to resize the ext2 file system to use all of the space in the newly enlarged partition.
not me emphasizing this again but bestie, SAME STARTING CYLINDER. that's the vibe check. if you fail it, it's giving data loss. ๐ญ
If you wish to shrink an ext2 partition, first use resize2fs to shrink the size of file system. Then you may use fdisk(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 file system!
The -b and -s 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 file system concurrent with changing the 64bit status. ๐ง
๐ OPTIONS ๐
-bโ Turns on the64bitfeature, resizes the group descriptors as necessary, and moves other metadata out of the way. โจ-ddebug-flags โ Turns on variousresize2fsdebugging features, if they have been compiled into the binary. debug-flags should be computed by adding the numbers of the desired features from the following list:2โ Debug block relocations4โ Debug inode relocations8โ Debug moving the inode table16โ Print timing information32โ Debug minimum file system size (-M) calculation
-fโ Forcesresize2fsto proceed with the file system resize operation, overriding some safety checks whichresize2fsnormally enforces. ๐โ๏ธ๐จ-Fโ Flush the file system device's buffer caches before beginning. Only really useful for doingresize2fstime trials.-Mโ Shrink the file system to minimize its size as much as possible, given the files stored in the file system.-pโ Print out percentage completion bars for eachresize2fsphase during an offline (non-trivial) resize operation, so that the user can keep track of what the program is doing. (For very fast resize operations, no progress bars may be displayed.) ๐-Pโ Print an estimate of the number of file system blocks in the file system if it is shrunk usingresize2fs's-Moption and then exit. ๐ข-sโ Turns off the64bitfeature and frees blocks that are no longer in use.-SRAID-stride โ Theresize2fsprogram will heuristically determine the RAID stride that was specified when the file system was created. This option allows the user to explicitly specify a RAID stride setting to be used byresize2fsinstead.-zundo_file โ Before overwriting a file system block, write the old contents of the block to an undo file. This undo file can be used withe2undo(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 namedresize2fs-device.e2undoin the directory specified via theE2FSPROGS_UNDO_DIRenvironment variable. ๐
WARNING: The undo file cannot be used to recover from a power or system crash. ๐ญ fr fr it's not a time machine.
๐ KNOWN BUGS ๐
The minimum size of the file system as estimated by resize2fs may be incorrect, especially for file systems with 1k and 2k blocksizes. ๐ (not the estimate lying to you bestie, it's just doing its best)
๐ AUTHOR ๐
resize2fs was written by Theodore Ts'o <tytso@mit.edu>. iconic tbh ๐ซถ
๐ COPYRIGHT ๐
Resize2fs is Copyright 1998 by Theodore Ts'o and PowerQuest, Inc. All rights reserved. As of April, 2000 Resize2fs may be redistributed under the terms of the GPL.
๐ SEE ALSO ๐
fdisk(8), e2fsck(8), mke2fs(8), lvm(8), lvextend(8)
and that's the whole page bestie, no cap. this was E2fsprogs version 1.47.4, dated March 2025 โ mwah, slay, go resize something responsibly ๐โจ๐
๐ฆ where this page comes from
- alpine 3.24: e2fsprogs-doc 1.47.4-r0 ยท GPL-2.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause AND MIT
- arch rolling: e2fsprogs 1.47.4-1 ยท GPL AND LGPL AND MIT
- nixpkgs unstable: e2fsprogs 1.47.4
- ubuntu stonking: e2fsprogs 1.47.4-1 ยท GPL-2.0-only
- Copyright 1997 by Theodore Ts'o. All Rights Reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms