安装 xfsdump
yum -y install xfsdump
centos7调整/home大小
把/home内容备份,然后将/home文件系统所在的逻辑卷删除,扩大/root文件系统,新建/home:
tar cvf /tmp/home.tar /home
umount /home
lvremove /dev/centos/home
lvextend -L +500G /dev/centos/root
xfs_growfs /dev/centos/root
lvcreate -L 33G -n home centos
mkfs.xfs /dev/centos/home
mount /dev/centos/home /home
df -h
查看进程命令
fuser -mv /data/
详情
[root@localhost /]
umount: /home: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
USER PID ACCESS COMMAND
/home: root kernel mount /home
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
Do you really want to remove active logical volume centos/home? [y/n]: y
Logical volume "home" successfully removed
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
Size of logical volume centos/root changed from 50.00 GiB (12800 extents) to 550.00 GiB (140800 extents).
Logical volume centos/root successfully resized.
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
meta-data=/dev/mapper/centos-root isize=512 agcount=4, agsize=3276800 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=13107200, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=6400, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 13107200 to 144179200
[root@localhost /]
[root@localhost /]
Logical volume "home" created.
[root@localhost /]
[root@localhost /]
meta-data=/dev/centos/home isize=512 agcount=4, agsize=2162688 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=8650752, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=4224, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]
[root@localhost /]