What should I do if my Linux system’s hard disk is full?

888u

Last update at :2024-05-20,Edit by888u

When we use VPS or independent servers, we often encounter that the system disk is full and cannot be used, so what should we do? Our solution here is to clean up the system disk temporarily, but the fundamental solution is still: the system disk is only used to store system files. Websites and other related applications are best saved in the data disk, and the system disk and data disk must be reasonably allocated. Ensure that there is a certain amount of reserved space. Let’s briefly talk about how to clean the system disk:

1. Execute df -h to check the total disk usage 2. Execute du -sh /* to view the disk space occupied by all directories. From this we can see that the two directories /usr and /var take up a large amount of space. 3. Execute du -sh /usr/* to check the disk usage of the subdirectories under the /usr directory. From this, you can see that the subdirectory /usr/local takes up a lot of disk space. 4. Execute du -sh /usr/local/* | sort -r | head -n 10 to view the 10 files that occupy a large space in the /usr/local directory and sort them in descending order 5. At this point, the files occupying the system disk have been found. However, this is only for testing. The actual situation requires detailed analysis. If you find a strange directory file, you can search online to see if the file is useful and whether it can be deleted. However, files under /boot /bin /etc /lib /lib64 are usually non-system files. Deletion should have little impact on the system, but be sure to confirm before deleting.

Recommended site search: cheap virtual host, virtual host evaluation, all-round virtual host, Hong Kong high-defense server, Xinwang domain name registration permanent free server address, cloud server rental, Guangzhou server hosting, overseas server, apply for free space and domain name,

What should I do if my Linux system’s hard disk is full?

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码