Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of disk cleaning in linux system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "the method of disk cleaning in linux system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Due to the unreasonable design of the original installation system, some partitions are too small, as well as network communication failures and other reasons such as the growth of log files and other reasons can be shown as the disk space is full, resulting in unable to read and write the disk, the application can not be executed and so on. Here are some tips (take / home full as an example):

1. Scan important file systems regularly, compare them, and analyze which files are read and written frequently

# IS-IR/home >; files.txt

# diff filesold.txt files.txt

By analyzing the growth of the predicted space, we can also consider compressing the files that read and write infrequently to reduce the space occupied.

two。 View the inodes consumption of the spatial file system

# df-i/home

If there is still a large number of inpde available, it means that large files take up space, otherwise thieves may take up a large number of small files.

3. Find out the directory that takes up more space.

View the space occupied by / home

# du-hs/home

View / home occupies more than 1000m space

# du/awk'$1 >; 2000'

4. Find out the files that take up more space.

# find/home-size + 2000K

5. Find files that have been recently modified or created

First TOUCH a file of the time you want is as follows

# TOUCH-t 08190800 test

# find/home-newer test-print

6. Delete Log

# rm-rf/var/log/*

7. Connect the partition

In a partition with space, make a connection to the partition that has no space.

# in-s/home/use/home

8. Find a process that consumes a lot of space

According to different applications, find out the corresponding process and analyze the reasons.

9. Check and repair the file system

# fsck-y/home

10. Restart the machine

With the above ten tips, you should be able to solve most of the problems, but the key is to plan the partition during installation. In addition, it is found that the disk is rough, can not be urgent, operate carefully, carefully analyze the reasons, and then deal with it carefully. It should be noted that the above ten moves do not need to be carried out sequentially, some may seal the throat in one move, and some may need to use several moves at the same time. Delete operations must be careful. If it doesn't work, we can only take "hard" measures such as adding the hard drive and reinstalling the system.

You can also:

Cd/

Du-h--max-depth=q/grep M/sort-n

Find the largest directory and enter it

Run du-h-max-depth=1/grep M / sort-n again

Find out the documents to see if they are useful.

Delete it if it's useless.

This is the end of the content of "the method of disk cleaning in linux system". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report