Today, I suddenly found that all the microservices projects were dead and couldn’t be restarted.free -h
I found that I had enough memory and 10GB, and then I ran out of hard disk space
Run the df -lh command to find that the available space of /dev/mapper/centos-root is 20K. The next step is to check which causes the space usage
Run du -h -x –max-depth=1 to find that data1 contains 43 GB of Java log files
The next step is to delete these files. After the deletion, it was found that the space did not increase much, and not all the space was released. Through Baidu, I learned that this was caused by the storage mechanism and storage structure of files under Linux. After referring to myself, I chose the most stupid method init 6 to restart generous, and the problem was solved
(Before restart)
(After restart)
The available space of /dev/mapper/centos-home is 815 GB. Can centos-root be expanded
- Back up the home partition files
tar cvf /tmp/home.tar/home
Copy the code
- Uninstall home. If this is not possible, terminate the processes that use the /home file system
fuser -km /home/
umount /home
Copy the code
- Delete the LV of /home
lvremove/dev/mapper/centos-home
Copy the code
- Add 800 GB to the LV of /root
lvextend -L +800G/dev/mapper/centos-root
Copy the code
- Extending the /root file system
xfs_growfs/dev/mapper/centos-root
Copy the code
- Recreate the home LV
lvcreate -L 73G -n/dev/mapper/centos-home
Copy the code
- Creating a File System
mkfs.xfs /dev/mapper/centos-home
Copy the code
- Mount the home
mount /dev/mapper/centos-home
Copy the code
- Home File Recovery
tar xvf /tmp/home.tar -C/home/ cd /home/home/ mv * .. /Copy the code
reference
link