In this case "reorganized" or "repartitioned" could probably be more apt.
If we'd talked about software here (and not disk layout), I'd have considered less leniently the use of "refactoring", and a hint of unclear intentions.
Sorry for being so nitpicky, but this is a sore thumb from too many "refactorings" that are, indeed, somenthing else.
Instead of being sorry for being nitpicky, maybe just keep your nitpicks to yourself in future.
Moreover, if your working set is larger than RAM, you're screwed regardless. So don't do that. Swap exists so you can use more RAM for the disk cache. It's doesn't exist so that buggy programs can crawl instead of dying
I mean, this is patently false. I've used 1TB swapfiles to get out of a sticky situation with some terrible research software that used a ton of memory to solve really valuable problems.
There's nothing wrong with an absolute shit ton of swap when the alternative is OOM.
AFAIK, this cannot work. The swap code does not go through the filesystem, it bypasses the filesystem (it only asks the filesystem code for the swap file extents during the "swapon" call), and it's the filesystem that would be responsible for allocating disk space when writing to a sparse file.
$ du /swapfile
329696 /swapfile
$ du --apparent-size /swapfile
33554432 /swapfile
Looks to me like it's behaving as expected?
Besides, most Linux installs by the numbers are probably web servers/data centers, or large enterprises (think movie studios, large tech companies).
I realize this comes from a position of privilege, but these days I'd just have a second computer that runs Windows; the bonus is if I completely mess up I can just use the working computer to generate OS installation media for the broken machine.
Also, depending on your threat model, "buy the next size up of RAM sticks" may be preferable to having a swap file or partition at all. (Although I recognize that may require replacing the entire system if it soldiered on or something.)
Just buy a new SSD for each OS you plan to run. A bit more expensive than messing with MBRs, but we'll... No more partition or MBR to deal with anymore. Well worth $50.
If you want a 2TB data drive, go on ahead. Both Linux and Windows handle multiple drives just fine.
How so?
There is no requirement on what type of partition type you use for your LUKS2 encrypted partition, so ideally you'd use something that isn't going to be apparent.
Then, as long as knowledge of a tiny USB drive or micro SD card existing isn't known (which is a lot easier to hide) it is more difficult to discover that an encrypted partition even exists.
How does make it harder to determine your encrypted partition exists? The usual way encryption aids plausible deniability is through multiple keys, e.g. when one key unlocks a seemingly innocuous-looking installation, while the other unlocks the nasty bits.
Having an encrypted partition in plain sight offers no plausible deniability at all to me, especially if it contains a default LUKS header. You might get away with arguing the disk is unused when the partition has a detached header, but even then you'd have to argue why a non-functioning machine is fully equipped with monitor, keyboard and network connections.
Because it just looks like random data that hasn't been formatted.
> Having an encrypted partition in plain sight offers no plausible deniability at all to me, especially if it contains a default LUKS header.
First, I do use a detached LUKS header. The LUKS header is on the USB drive. The machine functions fine and appears to be a regular Windows PC without the USB drive, with an extra partition that doesn't have encrypted data in plain sight. It would look like random data, which to someone else wouldn't know if I did a secure wipe and that it is waiting to be partitioned or if it is just old data that has since repurposed after resizing. I'm sure they could find out if they pry hard enough, especially if trimming is enabled or if they really started to question why the supposed random data can't be recovered to produce files.
I'm guessing that SSDs also give up the secret if an attacker has access to custom firmware to read the wear-levelling metadata and finds a bunch of recent writes in the random data.
At this point, unless speed or capacity are at a premium, it probably makes more sense to completely boot and run off of a fast USB drive. Linux + LUKS-header will be fairly obvious on the USB boot drive anyway, making plausible deniability pretty hard.
What's the threat model? State-level attackers (e.g. journalists working with Snowden) or the border police wanting you to provide a passphrase for stored data or to boot a system? For the latter a good solution is don't transport anything important across the border.
This way you only need one computer, but can have multiple completely separated OS'es. Of course, this doesn't work for laptops.