【运维篇】resize2fs命令 – 调整文件系统大小

resize2fs命令是用来增大或者收缩未加载的“ext2/ext3/ext4”文件系统的大小。

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 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 fea‐

       ture enabled.)

语法格式:resize2fs [参数] [文件]

常用参数:

-d打开调试特性
-p打印已完成的百分比进度条
-f强制执行调整大小操作,覆盖掉安全检查操作
-F开始执行调整大小前,刷新文件系统设备的缓冲区

参考实例

调整逻辑卷文件系统大小:

[root@linuxcool ~]# resize2fs /dev/linuxprobe/vo

打开调试特性:

[root@linuxcool ~]# resize2fs -d /dev/linuxprobe/vo

打印已完成的百分比进度条:

[root@linuxcool ~]# resize2fs -p /dev/linuxprobe/vo

强制执行调整大小操作,覆盖掉安全检查操作:

[root@linuxcool ~]# resize2fs -f /dev/linuxprobe/vo

开始执行调整大小前,刷新文件系统设备的缓冲区:

[root@linuxcool ~]# resize2fs -F /dev/linuxprobe/vo

https://www.linuxcool.com/resize2fs

https://blog.youkuaiyun.com/weixin_33701617/article/details/92898330?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-3.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-3.control

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值