What should I do if the hard disk of the Linux system is full?


When we use VPS or stand-alone servers, we often encounter the system disk is full and cannot be used, so what should we do? Our solution here is to temporarily clean up the system disk, but the fundamental solution is: the system disk is only used for system file storage, and related applications such as websites are best stored in the data disk, and the system disk and data disk should be allocated reasonably. Ensure that there is a certain amount of reserved space. The following roughly talk about how to clean up the system disk:


1. Execute df -h to view 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 lot of space

3. Execute du -sh /usr/* to view the disk occupancy of the subdirectories in the /usr directory, and you can see that the subdirectory /usr/local occupies a lot of disk space

4. Execute du -sh /usr/local/* | sort -r | head -n 10 to view the 10 files occupying a larger space in the /usr/local directory, and sort them in descending order

5. So far, the files occupying the system disk have been found. However, this is only for testing. The real situation needs to be analyzed in detail. If you find a strange directory file, you can search the Internet to find out whether the file is useful and whether it can be deleted. However, usually the files not under /boot /bin /etc /lib /lib64 are non-system files. Deleting should have little effect on the system, but be sure to confirm before deleting.

at 12/06/2020, 18:23pm

Been read 39 times

Similar Articles

BBR acceleration

       This article introduces one-key fool-style upgrade of the kernel and installation of BBR acceleration. Affirm: The tutorial for one-click installation of BBR was created by Teddy! Google's TCP BBR congestion control...

How to mount a disk under Linux

Theoretically adapt to all Linux systems, just determine the mount point Copy all the following commands directly and paste them into the SS terminal: mkfs.ext4 /dev/vdb echo'/dev/vdb /home ext4 defaults 0 0'>> /etc/fstab mount...

What People wrote...

Powered by WHMCompleteSolution