Post AUufDH7U29jUt9DDAO by ikkeT@mastodontti.fi
 (DIR) More posts by ikkeT@mastodontti.fi
 (DIR) Post #AUuSwcPERKgmX9nxk8 by rolle@mementomori.social
       2023-04-22T12:06:49Z
       
       0 likes, 0 repeats
       
       One of the wonders are the "dead" files on the Linux server. After reboot gigabytes of data is freed. That data should not exist but it's still taking space. #Linux #SysAdmin
       
 (DIR) Post #AUuT8ToqBwtjNQRICe by thingsiplay@mstdn.games
       2023-04-22T12:15:04Z
       
       0 likes, 0 repeats
       
       @rolle Isn't it the fault of the applications not deleting temporary files after they are not needed anymore? When i do scripting or anything programmatically, always delete temporary files after they are no longer needed.
       
 (DIR) Post #AUuTXLVgDnngqXKlQ8 by rolle@mementomori.social
       2023-04-22T12:20:11Z
       
       0 likes, 0 repeats
       
       @thingsiplay Yes, but sometimes it's not clear. Even if tmp is cleared out and all the files have been removed, something seems to hold the space for some files and it's only going to be freed after the reboot. I've seen this many times throughout my career, those files are nowhere to be found and those processes are not running.
       
 (DIR) Post #AUuTqepEdDgAFogmaO by thingsiplay@mstdn.games
       2023-04-22T12:23:52Z
       
       0 likes, 1 repeats
       
       @rolle Zombie files! Sounds like system locked those files because a process didn't free the lock. Either process crashed or end without freeing the file. Just a guess.
       
 (DIR) Post #AUuTzvJufpHO1BSO5w by rolle@mementomori.social
       2023-04-22T12:25:39Z
       
       0 likes, 0 repeats
       
       @thingsiplay Yep, I mean just those. And there can be gigabytes of them if you haven't rebooted for a long time. My record is like 80gb.
       
 (DIR) Post #AUuVZbVJvUm0wHN0eu by dustinrue@mastodon.chateaude.luxe
       2023-04-22T12:42:44Z
       
       0 likes, 0 repeats
       
       @rolle this is almost certainly because an app can open a file and then unlink the file while keeping it open. As soon as the app quits, the file and the space it consumed is returned to the system
       
 (DIR) Post #AUuWDdAv8JDThkulRw by dustinrue@mastodon.chateaude.luxe
       2023-04-22T12:44:04Z
       
       0 likes, 0 repeats
       
       @rolle this is normal, even desired behavior. You only need to restart the app, not the whole system
       
 (DIR) Post #AUuWDdpKi3Xhj5p2RM by rolle@mementomori.social
       2023-04-22T12:50:28Z
       
       0 likes, 0 repeats
       
       @dustinrue I have no idea what is causing it so the reboot is necessary. I have also had situations in the past where seemingly NOTHING is causing it and everything is killed and quit and something is still taking space. 🤷‍♂️
       
 (DIR) Post #AUuXLudcBs1S8SqhZw by dustinrue@mastodon.chateaude.luxe
       2023-04-22T13:03:06Z
       
       0 likes, 0 repeats
       
       @rolle you can use lsof -a +L1 *mountpoint* to help find who is doing this. Mountpoint is of course / or /home or whatever mounted file system you want to check
       
 (DIR) Post #AUudpfhQtYZIDXCyGW by ikkeT@mastodontti.fi
       2023-04-22T14:15:50Z
       
       0 likes, 0 repeats
       
       @rolle You can actually find those. I remember I was investigating such long ago. Look all processes open files from under /proc/<id>/fs or smth, and there are files with 'd' on the line (or smth) telling the file is open but deleted. Restart the process and it gets cleaned away.
       
 (DIR) Post #AUufDGO6krR8cPyyRM by ikkeT@mastodontti.fi
       2023-04-22T14:17:05Z
       
       0 likes, 0 repeats
       
       @rolle Typical reason being misconfigured log file rotation.
       
 (DIR) Post #AUufDH7U29jUt9DDAO by ikkeT@mastodontti.fi
       2023-04-22T14:24:00Z
       
       0 likes, 0 repeats
       
       @rolle I recall writing a script listing such processes bases on info under /proc and restarting the services.
       
 (DIR) Post #AUufDHgDwzWQctSxJg by rolle@mementomori.social
       2023-04-22T14:31:13Z
       
       0 likes, 0 repeats
       
       @ikkeT Logrotate and log sizes are ok. That's the first thing I make sure is not the culprit.
       
 (DIR) Post #AUuiF3g5HUsndmwEPg by rolle@mementomori.social
       2023-04-22T15:05:10Z
       
       0 likes, 0 repeats
       
       @dragon ncdu is better. But no clue in these situation. No actual files show up there in this scenario. @ikkeT