RESIZE2FS(8) RESIZE2FS(8)
名前
resize2fs - ext2/ext3 ファイルシステムのサイズを変更する
書式
resize2fs [ -d debug-flags ] [ -S RAID-stride ] [ -f ] [ -F ] [ -p ]
device [ size ]
説明
resize2fs は ext2 または ext3 ファイルシステムのサイズを変更する。こ の
プ ログラムは device 上のアンマウントされたファイルシステムを拡大または
縮小する。ファイルシステムがマウントされている場合、カーネルがオンラ イ
ン でのサイズ変更をサポートしていると仮定して、マウントされているファイ
ルシステムのサイズを拡大する (この man ページを書いて い る 時 点 で は
、Linux 2.6 カーネルにおいて、マウントされているファイルシステムのオン
ラインでのサイズ変更がサポートされているのは、ext3 のみである)。
size パラメータには希望するファイルシステムの新しいサイズを指定する。単
位 が指定されない場合、 size パラメータの単位はファイルシステムのブロッ
クサイズとなる。 size パラメータにはオプションとして以下の単位指定文 字
を後ろに付けることができる。 ’s’, ’K’, ’M’, ’G’ は、それぞれ 512 バイト
セクタ、キロバイト、メガバイト、ギガバイトを表す。ファイルシス テ ム の
size は、パーティションのサイズより大きくすることはできない。 size パラ
メータが指定されない場合、パーティションのサイズをデフォルトとする。
resize2fs プログラムは、パーティションのサイズは操作しない。ファイル シ
ス テムを大きくしようとする場合は、そのファイルシステムがあるパーティシ
ョンのサイズを大きくできるかを最初に確認しなければならない。こ れ は 、
fdisk(8) を使ってパーティションを削除した後により大きなパーティションを
再作成することで確認できるし、論理ボリュームマネージャ lvm(8) を使っ て
いる場合は、 lvextend(8) を使って確認できる。パーティションを再作成する
場合、必ず以前と同じ開始ディスクシリンダで作成すること! そうしないと、
サ イズ変更の操作は絶対にうまく行かず、ファイルシステム全体を失ってしま
う。 fdisk(8) を実行した後、resize2fs を実行すること。これにより 、ext2
フ ァイルシステムのサイズを変更し、拡大した新しいパーティションの全ての
領域を使うことができる。
ext2 パーティションを小さくしようとする場合には、最初に resize2fs を 使
っ てファイルシステムのサイズを小さくする。続いて fdisk(8) を使えばパー
ティションのサイズを小さくできる。パーティションのサイズを小さくする と
きは、新しい ext2 ファイルシステムのサイズより小さくしないこと!
オプション
-d debug-flags
resize2fs のいろいろなデバッグ属性がプログラムに組み込まれている
場合、それらの属性を設定する。 debug-flags は以下のリストのう ち
希望する属性値を足して計算する。
1 - 全てのディスク I/O を表示する。
2 - ブロックの再割り当てをデバッグする。
8 - inode の再割り当てをデバッグする。
16 - inode テーブルの移動をデバッグする。
-S RAID-stride
resize2fs プログラムは、ファイルシステムが作成されたときに指定さ
れた RAID stride をヒューリスティック (heuristic) に基づいて決定
す る。一方、このオプションにより、ユーザは resize2fs で使用され
る RAID stride 設定を明示的に指定することができる。
-p resize2fs の各操作について、作業完了分のパーセントを表すバーを表
示する。これによりユーザーはプログラムの動作を追うことができる。
-f resize2fs が通常行う安全性チェックを無視させて、ファイルシステム
のサイズ変更操作を強制的に進める。
-F サイズ変更を始める前に、ファイルシステムデバイスのバッファキャッ
シュを消去する。 resize2fs のタイムトライアルをする場合にのみ 役
立つ。
著者
resize2fs は Theodore Ts’o
RESIZE2FS(8) RESIZE2FS(8)
NAME
resize2fs - ext2/ext3/ext4 file system resizer
SYNOPSIS
resize2fs [ -fFpPM ] [ -d debug-flags ] [ -S RAID-stride ] device [
size ]
DESCRIPTION
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. If the filesystem is mounted, it can be used to expand the
size of the mounted filesystem, assuming the kernel supports on-line
resizing. (As of this writing, the Linux 2.6 kernel supports on-line
resize for filesystems mounted using ext3 and ext4.).
The size parameter specifies the requested new size of the filesystem.
If no units are specified, the units of the size parameter shall be the
filesystem blocksize of the filesystem. Optionally, the size parameter
may be suffixed by one of the following the units designators: ’s’,
’K’, ’M’, or ’G’, for 512 byte sectors, kilobytes, megabytes, or giga-
bytes, respectively. The size of the filesystem 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. 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
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 oper-
ation will certainly not work, and you may lose your entire filesystem.
After running fdisk(8), run resize2fs to resize the ext2 filesystem to
use all of the space in the newly enlarged partition.
If you wish to shrink an ext2 partition, first use resize2fs to shrink
the size of filesystem. 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 filesystem!
OPTIONS
-d debug-flags
Turns on various resize2fs debugging 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 relocations
4 - Debug inode relocations
8 - Debug moving the inode table
-f Forces resize2fs to proceed with the filesystem resize opera-
tion, overriding some safety checks which resize2fs normally
enforces.
-F Flush the filesystem device’s buffer caches before beginning.
Only really useful for doing resize2fs time trials.
-M Shrink the filesystem to the minimum size.
-p Prints out a percentage completion bars for each resize2fs oper-
ation, so that the user can keep track of what the program is
doing.
-P Print the minimum size of the filesystem and exit.
-S RAID-stride
The resize2fs 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 set-
ting to be used by resize2fs instead.
KNOWN BUGS
The minimum size of the filesystem as estimated by resize2fs may be
incorrect, especially for filesystems with 1k and 2k blocksizes.
AUTHOR
resize2fs was written by Theodore Ts’o
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa