编程知识 cdmana.com

Methods of directory expansion under Linux system

1、 The phenomenon :

The log server was not well thought of at the beginning , The partition is not reasonable :

2、 The goal is :

take /home Disk space reduction And expand the new partition to / root directory

uninstall /home Partition and compress partitions

uninstall /home when Prompt target busy ,fuser -m /home See who uses /home There is no fuser command

[root@localhost zabbix]# umount /home
umount: /home: destination is busy .

( In some cases through lsof(8) or fuser(1) You can find useful information about the processes that use the device )

[root@localhost zabbix]# fuser -m /home
-bash: fuser:  Command not found 

No solution fuser The question of orders :

stay CentOS/RHEL 7 I can't find fuser command

-bash: fuser: command not found 
yum install psmisc 

fuser -m /home   // Keep looking for who's using /home

kill -9 11757    // Stop the process 
umount /home    // uninstall /home file system 

Compress partitions :

resize2fs -p /dev/mapper/centos-home 100G

Confirmation is xfs Format system

cat /etc/fstab|grep centos-home

xfs File system expansion must be installed xfsdump Tools

yum install xfsdump -y

Reduce /home Space to 100GB, Increase the root directory , extend / Directory space And then mount it again /home

[root@localhost ~]# mount /home
mount: /dev/mapper/centos-home: Can't read super blocks 

Must format /home Partition , To mount ---- So cut back /home You have to back up before partitioning /home The content of ( Bear in mind !!!) Re mount mount /home Recommended reading :Linux The operation process of expanding the partition

original text :https://www.talkwithtrend.com...

image

版权声明
本文为[Migrant worker brother]所创,转载请带上原文链接,感谢

Scroll to Top