by cesarb · 2mo ago · 0 comments
Why not "mkswap --size ... --file ...", which does these three things and more? For instance, according to the mkswap man page, "[...] sets the nocow attribute for newly created files [...]" which is a detail that seems to be missing from this gist.
The --size and --file options are relatively new, though: they were added in util-linux v2.40, released in 2024.
I feel like if there's a malicious user (or program) on your system with the necessary access for this, you have much bigger problems.