{"id":3546,"date":"2022-12-20T17:08:58","date_gmt":"2022-12-20T20:08:58","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/resize2fs-man8\/"},"modified":"2022-12-20T17:08:58","modified_gmt":"2022-12-20T20:08:58","slug":"resize2fs-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/resize2fs-man8\/","title":{"rendered":"RESIZE2FS (man8)"},"content":{"rendered":"<h1 align=\"center\">RESIZE2FS<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#KNOWN BUGS\">KNOWN BUGS<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#COPYRIGHT\">COPYRIGHT<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">resize2fs \u2212 ext2\/ext3\/ext4 file system resizer<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>resize2fs<\/b> [ <b>\u2212fFpPMbs<\/b> ] [ <b>\u2212d<\/b> <i>debug-flags<\/i> ] [ <b>\u2212S<\/b> <i>RAID-stride<\/i> ] [ <b>\u2212z<\/b> <i>undo_file<\/i> ] <i>device<\/i> [ <i>size<\/i> ]<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>resize2fs<\/b> program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on <i>device<\/i>. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel and the file system supports 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.)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>size<\/i> parameter specifies the requested new size of the filesystem. If no units are specified, the units of the <i>size<\/i> parameter shall be the filesystem blocksize of the filesystem. Optionally, the <i>size<\/i> parameter may be suffixed by one of the following units designators: \u2019K\u2019, \u2019M\u2019, \u2019G\u2019, \u2019T\u2019 (either upper-case or lower-case) or \u2019s\u2019 for power-of-two kilobytes, megabytes, gigabytes, terabytes or 512 byte sectors respectively. The <i>size<\/i> of the filesystem may never be larger than the size of the partition. If <i>size<\/i> parameter is not specified, it will default to the size of the partition.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>resize2fs<\/b> program does not manipulate the size of partitions. If you wish to enlarge a filesystem, you must make sure you can expand the size of the underlying partition first. This can be done using <b>fdisk<\/b>(8) by deleting the partition and recreating it with a larger size or using <b>lvextend<\/b>(8), if you\u2019re using the logical volume manager <b>lvm<\/b>(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 filesystem. After running <b>fdisk<\/b>(8), run resize2fs to resize the ext2 filesystem to use all of the space in the newly enlarged partition.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If you wish to shrink an ext2 partition, first use <b>resize2fs<\/b> to shrink the size of filesystem. Then you may use <b>fdisk<\/b>(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 filesystem!<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>\u2212b<\/b> and <b>\u2212s<\/b> 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 filesystem concurrent with changing the 64bit status.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><b>\u2212b<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">Turns on the 64bit feature, resizes the group descriptors as necessary, and moves other metadata out of the way.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>\u2212d<\/b> <i>debug-flags<\/i><\/p>\n<p style=\"margin-left:22%;\">Turns on various resize2fs debugging features, if they have been compiled into the binary. <i>debug-flags<\/i> should be computed by adding the numbers of the desired features from the following list: <br \/> 2 \u2212\u00a0Debug block relocations <br \/> 4 \u2212\u00a0Debug inode relocations <br \/> 8 \u2212\u00a0Debug moving the inode table <br \/> 16 \u2212\u00a0Print timing information <br \/> 32 \u2212\u00a0Debug minimum filesystem size (\u2212M) calculation<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212f<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Forces resize2fs to proceed with the filesystem resize operation, overriding some safety checks which resize2fs normally enforces.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212F<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Flush the filesystem device\u2019s buffer caches before beginning. Only really useful for doing <b>resize2fs<\/b> time trials.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212M<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Shrink the file system to minimize its size as much as possible, given the files stored in the file system.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212p<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Prints out a percentage completion bars for each <b>resize2fs<\/b> operation during an offline resize, so that the user can keep track of what the program is doing.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212P<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Print an estimate of the number of file system blocks in the file system if it is shrunk using <b>resize2fs<\/b>\u2019s <b>\u2212M<\/b> option and then exit.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212s<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Turns off the 64bit feature and frees blocks that are no longer in use.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>\u2212S<\/b> <i>RAID-stride<\/i><\/p>\n<p style=\"margin-left:22%;\">The <b>resize2fs<\/b> program will heuristically determine the RAID stride that was specified when the filesystem was created. This option allows the user to explicitly specify a RAID stride setting to be used by resize2fs instead.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212z<\/b> <i>undo_file<\/i><\/p>\n<p style=\"margin-left:22%;\">Before overwriting a file system block, write the old contents of the block to an undo file. This undo file can be used with e2undo(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 named resize2fs-<i>device<\/i>.e2undo in the directory specified via the <i>E2FSPROGS_UNDO_DIR<\/i> environment variable.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">WARNING: The undo file cannot be used to recover from a power or system crash.<\/p>\n<h2>KNOWN BUGS <a name=\"KNOWN BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The minimum size of the filesystem as estimated by resize2fs may be incorrect, especially for filesystems with 1k and 2k blocksizes.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>resize2fs<\/b> was written by Theodore Ts\u2019o <tytso@mit.edu>.<\/p>\n<h2>COPYRIGHT <a name=\"COPYRIGHT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Resize2fs is Copyright 1998 by Theodore Ts\u2019o and PowerQuest, Inc. All rights reserved. As of April, 2000 <b>Resize2fs<\/b> may be redistributed under the terms of the GPL.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>fdisk<\/b>(8), <b>e2fsck<\/b>(8), <b>mke2fs<\/b>(8), <b>lvm<\/b>(8), <b>lvextend<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  resize2fs \u2212 ext2\/ext3\/ext4 file system resizer <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,666],"class_list":["post-3546","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-resize2fs"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3546"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3546\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}