赞
踩
本文以Linux5.4 32Bit操作系统为例,简要说明LVM的管理操作。
此操作系统版本旧,LVM功能相对于rhel6和rhel7有很多不足之处,可用参数也不够多。
以下操作是在vmware虚拟机中测试。
在生产中建议尽快升级操作系统,或迁移应用到更高的操作系统版本上。
1、在线缩小,无法在线完成,需要umount文件系统才能做缩小,,风险较大,建议备份数据后再操作
[root@linux54 ~]# resize2fs /dev/datavg/datalv01 4g
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/datavg/datalv01 is mounted on /data; on-line resizing required
On-line shrinking from 1572864 to 1048576 not supported.
[root@linux54 ~]# umount /data
[root@linux54 ~]# resize2fs /dev/datavg/datalv01 4g
resize2fs 1.39 (29-May-2006)
Please run 'e2fsck -f /dev/datavg/datalv01' first.
[root@linux54 ~]# e2fsck -f /dev/datavg/datalv01
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/datavg/datalv01: 11/786432 files (9.1% non-contiguous), 60560/1572864 blocks
[root@linux54 ~]# resize2fs /dev/datavg/datalv01 4g
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/datavg/datalv01 to 1048576 (4k) blocks.
The filesystem on /dev/datavg/datalv01 is now 1048576 blocks long.
[root@linux54 ~]# lvreduce -L 4G /dev/datavg/datalv01
WARNING: Reducing active logical volume to 4.00 GB
THIS MAY DESTROY
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。