• he/him

one more cute disaster… it’s hard here in paradise

last.fm listening



NireBryce
@NireBryce

an old sysadmin once told me "on every drive, write 20gb to a file as ballast to delete in an emergency if you run out of disk" and in my old age, i am passing it on to you


DecayWTF
@DecayWTF

Absolute galaxy brain move. Incredible. I stand in awe. This person was the only true sysadmin, the rest of us were just pretenders to the throne.


tamber
@tamber

Also, another gem to keep in your back pocket in case you need it... Sometimes, when you really run out of disc space, there isn't enough disc space to delete the ballast file (Try not to think about it too hard.):
rm: can not remove Ballast: No space left on device

If this happens, feed it to the disc space bird:
:> Ballast

The disc space bird will eat all the contents of the file, leaving it at 0 bytes, and you with enough disc space to delete things again!


ireneista
@ireneista

we are not going to do this

but it's pretty cool

especially the disc space bird. that's hilarious


ireneista
@ireneista

if you're using ext4 or another Linux-first filesystem, you actually have more disk space than the tools tell you about

there's an extra percent or so that is hidden from the free-space reports and can only be accessed by root. stuff running as non-root users is told "can't do that, no free space" before it's actually true.

of course if all your daemons run as root, then the logs or whatever that are filling your disk to the breaking point will also fill the extra space. good distros will run each daemon as its own user because that's the modern way, but you may still run into trouble with your own custom services if you didn't set up a user for them

this means that if you are ever trying to free up disk space and everything is jammed so tight that it can't do that, sometimes you can get it unjammed by doing stuff as root


You must log in to comment.

in reply to @NireBryce's post:

I follow this practice, but a few things to note:

  • The size of the buffer should be proportional to the capacity of the disk/volume. I aim for 15%.
  • Instead of a buffer file, I use a buffer partition - this way I can control the location of the data on the disk itself, placing it at the end of the disk (where performance is worse), therefor reserving the faster performing areas for actual data.
    • This only applies to HDDs. I still do this on SSDs just for consistency but it has no impact on performance.
    • This does have the caveat that you need to be using a filesystem for the data partition that supports online extending (or offline extending if you can deal with that).

yeah! i wrote about it because i was reminded by having 6kb left in my home dir thanks to Go and a github install script sudo curl | bash misfiring and installing Several Gigabytes of dependencies for something.

it's good additional context :)

in reply to @DecayWTF's post:

in reply to @tamber's post:

my favorite trick with : is using it as part of the powerline10k transient prompt for zsh, where all prompts but your current are a custom line.

So I use ${${${EUID:#0}:+;: $(date +%T) ;}:-#}

which yields: ;: timestamp ; command

which lets me copy and paste lines and run them while still having timestamps in the transient prompt while, hopefully, having enough escapes that it will never bite me in a bad way. Someone else wrote them, it's theology at this point, not engineering.

I don't have good examples though

in reply to @ireneista's post: