3 ms·
Isn’t using LVM and holding some space back a better solution for this? Also I keep databases on their own partition so that nothing else can accidentally fill
by 00deadbeef 6y ago
Isn’t using LVM and holding some space back a better solution for this?
Also I keep databases on their own partition so that nothing else can accidentally fill up the space and lead to data loss.
- jstanley 6y agoMaybe, but author says: > On Linux servers it can be incredibly difficult for any process to succeed if the disk is full. You won't feel too clever if you come to grow your LVM volume into the free space and it won't work because there's no free space on the filesystem! :) (I don't actually know if this would fail or not - but the point is "rm spacer.img" is pretty much guaranteed not to fail).
- LinuxBender 6y agoI've used LVM for this purpose plenty of times. lvm2 at least has not prevented me from extending a full disk. lvm + reserved blocks + a small spacer file are all decent options, even better when used together.
- JshWright 6y agorm /path/to/big.file is faster than looking up the commands to expand the LVM volume and grow the filesystem.
- 00deadbeef 6y agoThey’re not hard to memorise. I never look them up.
- JshWright 6y agoGood for you. That's not how my memory works. If I don't use a command regularly, I don't trust myself to remember it correctly. Even if I did though, that's a multi-step process, compared to the single command needed to remove a file.
- nkellenicki 6y agoI don't use lvm often enough to memorise the commands. "rm spacer.img" is short and easy for _anyone_ to remember.
- Spivak 6y agoTomato potato. If you use LVM or anything like it to reserve space then in your failure situation you have to extend the lv, partition, and fs before the space becomes available. More work than just rm'ing the file. I think the ideal ideal is tuning the reserved blocks in your filesystem. xfs_io -x -c 'resblks ...
- 00deadbeef 6y agoIt’s not really much more work. One command extra.