Welcome

After 5 years of living in Japan, and saw so many different views and opinions for this country, I think I should offer some real stories without idealized or preconception.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Space Not Freed After I Delete a Large Log File

My hope is that your server(s) are healthy, up and running!😊 With cloud computing owning a server is just a few clicks away. However maintaining one is another thing; As usual let’s talk about Linux. The pricing for Linux server with small computing capacity are reasonably affordable ones. However with this kind of servers you will often end up into issues such as disk space utilization i.e. server being filled up so fast. Nonetheless you will soon encounter that even when you delete a file no additional space is being claimed. 🤔

You will often hear or be victim of the following; Why is space not being freed from disk after deleting a file? When deleting a large file or files, the file is deleted successfully but the size of the filesystem does not reflect the change. I’ve deleted some files but the amount of free space on the filesystem has not changed. No space left on device even after deleting some files.

In Linux file systems, a file is organized into two parts let’s understand those:

So the file you deleted is locked by a running process that keeps writing data to the file. If the file is still in use by one (or more) process(es). The space occupied by the file will only be released if no processes have the file open. This file is now no longer visible when you do ‘ls’ or ‘ll’ and a new file with same name may have been created already and you have gained no additional free space.

Find the files being held by process(es) or find the processes holding such files. This is all done by below command which will show all the list of files holding memory (disk space) with deleted quote.

OR

Once you find the files kill the process holding them using the process ID and the kill command.

To maintain your log files I recommend that you create a way to rotate the files after every hour or day depending on your volume of data. Find a better strategy that will best fit your needs such as daily log or based on size say around 10mb per log. With log rotate you can even specify how many files you want to keep or gzip.

Add a comment

Related posts:

Rencara Sheila

keesok harinya saat jam pelajaran berlangsung mereka sedang terfokus oleh mata pelajaran yang sedang dipelajarinya, namun berbeda dengan siswi satu ini dia sedang memikirkan bagaimana rencana supaya…

3 TED Talks That Anyone Working in Transportation Innovation Needs to Watch

2018 was a bumper year for mobility technology and for transportation. We (finally) saw the integration of AI and Google Assistant within mass manufactured cars, augmented reality help motorcyclists…

Navigation Graphs

Keeping track of complex UI flows can be challenging for software companies. Many programs have an implicit navigation graph, the structure that determines how one screen leads to another, embedded…