While working on one of the Jenkins job, an error popped up - JENKINS_HOME is almost full. This worries me as my root '/' have 60% of total storage whatever I have in distro (CentOS 8.2). So started digging in and found out the culprit. Let's see how you can also do the same.
Step 1: Let's first search which directory is consuming your space by running below command.
$ du -sch /* 2> /dev/null # image-1
Step 2: As we can see in left image, /var directory is consuming more space than any other directory, we will repeat the same process for /var directory now, or for any other directory as well.
$ du -sch /var/* 2> /dev/null # image-2
$ du -sch /var/crash/* 2> /dev/null # image-3
As you can see, there is huge files under /var/crash folder which is nothing but are backups whenever you have updated your OS distro, You can carefully remove these files to recover the storage.
You can also truncate huge log files, sometimes log files are huge to help in restoration. and by carefully means, avoid any latest backup files removal or truncation of any binary files. You can follow below commands to truncate your log files or may be put round robin logging mechanism on software or OS.
Truncate files:
$ tail -5000 filename > filename.new
$ mv filename.new filename
$ sync
We can follow the same procedure for other folders as well but don't delete anything which you don't understand cause Linux systems are so complicated as well as so simple at the same time. A wise person said, "Dont jump off the cliff if you don't know how to fly."
Hoping, this post will help you..I'll see you in next post.. till then.. Happy Learning !!!
Like the below page to get the update
Facebook Page Facebook Group Twitter Feed Telegram Group
Like the below page to get the update
Facebook Page Facebook Group Twitter Feed Telegram Group
No comments:
Post a Comment