<p>
<strong>resize2fs命令</strong>被用来增大或者收缩未加载的“ext2/ext3”文件系统的大小。如果文件系统是处于<span class="wp_keywordlink"><a href="http://rowsea.com/linux/mount.html" title="mount命令" target="_blank">mount</a></span>状态下,那么它只能做到扩容,前提条件是内核支持在线resize。,linux kernel 2.6支持在mount状态下扩容但仅限于ext3文件系统。
</p>
<h3>
语法<br/>
</h3>
resize2fs(选项)(参数)
<h3>
选项<br/>
</h3>
-d:打开调试特性; -p:打印已完成的百分比进度条; -f:强制执行调整大小操作,覆盖掉安全检查操作; -F:开始执行调整大小前,刷新文件系统设备的缓冲区。
<h3>
参数<br/>
</h3>
- 设备文件名:增大要调整大小的文件系统所对应的设备文件名;
- 大小:文件系统的新大小。
<h3>
实例<br/>
</h3>
<p>
LV分区重设大小
</p>
<span style="color:#B22222;">resize2fs /dev/vbirdvg/vbirdlv</span> resize2fs 1.39 (29-May-2006) Filesystem <span class="wp_keywordlink">at</span> /dev/vbirdvg/vbirdlv is mounted on /mnt/lvm; on-line resizing Performing an on-line resize of /dev/vbirdvg/vbirdlv to 2191360 (4k) blocks. The filesystem on /dev/vbirdvg/vbirdlv is now 2191360 blocks long.