In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "linux how to find deleted but the disk space has not been released large files and empty", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "linux how to find deleted but disk space has not been released large files and empty" bar!
Linux finds the large files that have been deleted but not free of disk space and empties them.
1. Find the files that have been deleted but the disk space has not been freed. If the file has been deleted but the actual disk space has not been released, the file handle fd information is still in memory and can be found through the lsof command, such as the pid that opens the file and the system fd that reads and writes the file.
Lsof | grep-i delete java 20302 5351 hbase 3w REG 253people 1 25778031203 43040 / var/log/hbase/gc.log-201812251535 (deleted) java 20302 5354 hbase 3w REG 253 people 1 25778031203 43040 / var/log/hbase/gc.log-201812251535 (deleted) java 20302 5988 hbase 3w REG 253 REG 253 Gc.log-201812251535 (deleted) java 20302 12680 hbase 3w REG 253people 1 25778031203 43040 / var/log/hbase/gc.log-201812251535 (deleted) java 20302 15047 hbase 3w REG 253 REG 253 Law 1 25778031203 43040 / var/log/hbase/gc.log-201812251535 (deleted) java 20302 16379 hbase 3w REG 253 / hbase/gc.log-201812251535 (deleted) java 20302 16380 hbase 3w REG 253 25778031203 43040 / var/log/hbase/gc.log-201812251535 (deleted)
2. How to empty large files that have been deleted but not released? if you want to delete large files completely, you usually need to restart the process of opening files, but sometimes the online service is not convenient to restart, affecting the availability of the service. At this time, you can find the system fd that opened the file through / proc/$ {pid} / fd information, and then use fd to empty the file.
# ll / proc/20302/fd/ | grep 201812251535l hbase hadoop 64 Oct 18 21:02 3-> / var/log/hbase/gc.log-201812251535 (deleted)
Empty the file
Echo > / proc/20302/fd/3 Thank you for your reading, the above is the content of "linux how to find out the large files that have been deleted but the disk space has not been released and empty them". After the study of this article, I believe you have a deeper understanding of how linux finds out the deleted but unreleased large files and empty them, and the specific usage still needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.