/srv/irclogs.ubuntu.com/2025/07/30/#ubuntu-server.txt

=== sdeziel_ is now known as sdeziel
fooI've deleted multiple files on a ubuntu server, the storage isn't free'ing up, we are at max storage space. df -h not showing free space. I've done lsof and I cannot find a process using the old log files, nothing should be using it. Any suggestions?15:34
fooananke / JanC - thank you. I had a tail command blocking the process and the file was deleted. What was confusing to me is I explicitly checked lsof|grep filename... I would have expected the tail command to show in there, it did not15:54
minimalfoo: well the filename no longer existed once you deleted it (the tail process however kept a FD open pointing to the file however)16:01
minimalthis is a "trick" that for example some malware use to hide themselves16:02
minimalfoo: the "rm" command simply calls the unlink() system call, to quote from its manpage: "unlink() deletes a name from the filesystem. If that name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made available for reuse."16:04
JanCminimal: in some cases lsof will still show the old file name with "(deleted)" appended16:10
JanCbut these things can be complicated indeed, and in general deleting files is no guarantee storage space is deleted16:12
JanCeven after the inode no longer exists in some cases16:13
JanCespecially in more modern file systems16:13
minimalback in the day the "correct" method we used to free up diskspace was ":> filename" to truncate files (so freeing up space) without changing the FD (and so not affecting "tail" etc)16:17
patdkheh, I had the issue last week, freed up 20gigs of data I dont use to make space16:42
patdkbut had no impact, due to the file cache just dumped 20gigs of new data to logs16:42
JanCminimal: that would not help in case of sparse files, deduplicated storage (e.g. snapshots), etc.16:54
JanCin fact, truncating files might require extra storage in some cases...16:55
=== y0sh- is now known as y0sh_
=== Wyly0 is now known as Wyly

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!