Live data from Hacker News

All my servers have an 8 GB empty file on disk

brianschrader.com

281–290 of 715 posts

Re: All my servers have an 8 GB empty file on disk

#281

Earlier quoted context omitted.

An extra failsafe? You can do both. What if your cron/netdata are not forwarding emails for some reason (eg nullmailer gets errors from Mailgun)?

Right, but again, what good does the spacer file do if you're not aware that you're running low on disk space? That is: if your monitoring isn't working, how do you know that you need to quickly make room? And if your monitoring is working correctly, the spacer file really serves no purpose other than lowering the available disk space.

The reason was, I thought, discussed in the article.

When you actually fill up your disc, many linux commands will simply fail to run, meaning getting out of that state is extremely difficult. Deleting the file means you have room to move files around / run emacs / whatever, to fix the problem.

Re: All my servers have an 8 GB empty file on disk

#282

Please use LVM (Logical Volume Manager) if you really are afraid of filling up disks. If the disk would ever fill up: 1. Buy an additional virtual disk 2. Add the disk to the LVM volume group 3. Expand the Logical volume A really good primer on LVM: https://wiki.archlinux.org/index.php/LVM

Can you do all that while blocking the original request for space?

Re: All my servers have an 8 GB empty file on disk

#285
post #20

Careful how you create it. Several ways to create large files can make a sparse file, which I don't think removing will actually help later.

I think that in the past I saw that when creating a file with e.g. ... dd if=/dev/zero of=deleteme.file bs=1M count=8196 ...the "free space" shown by "df" slowly decreased while the file was being created, but then once the operation completed that "free space" magically went back to its original value => the big existing file (full of "0"s) was basically not using any storage. Is this what you mean? I just tried to…

dd will create sparse files if you use the seek option, like:

  dd if=/dev/zero of=a_sparse_file bs=1 count=0 seek=8G

Re: All my servers have an 8 GB empty file on disk

#286

[flagged]

I still know people that pre-emptively buy toilet paper "because hoarders might buy the rest of it" with absolutely no introspection.

The introspection or lack thereof, might be defined by Nash equilibrium. Nevertheless, the situation depicted in the article is a life hack -- exactly as described. There is no malicious intent/compliance, rather it is about having the foresight and ingenuity to save the day.

https://theconversation.com/a-toilet-paper-run-is-like-a-ban...

Re: All my servers have an 8 GB empty file on disk

#288

I am reminded of a tweet that suggested adding a sleep() call to your application that makes some part of it needlessly slow, so that you can give users a reason to upgrade when there's a security fix (it's 1 second faster now)!

Apple did something like that... https://www.npr.org/2020/11/18/936268845/apple-agrees-to-pay...

Re: All my servers have an 8 GB empty file on disk

#289

Please use LVM (Logical Volume Manager) if you really are afraid of filling up disks. If the disk would ever fill up: 1. Buy an additional virtual disk 2. Add the disk to the LVM volume group 3. Expand the Logical volume A really good primer on LVM: https://wiki.archlinux.org/index.php/LVM

Can you do all that while blocking the original request for space?

Yes you can. And all of this is on-line.

Re: All my servers have an 8 GB empty file on disk

#290
post #144

That's a dumb idea? Iirc some filesystems allow you to reserve a percentage of blocks for this particular use case (recovery by root). Ext2/3 for sure, ext4 probably too. Not sure you can do that on linode on the rootfs, since the filesystem is mounted, tho.

tune2fs -m
Post reply on HN