Live data from Hacker News

A warning about 5.12-rc1

lwn.net

11–20 of 115 posts

Re: A warning about 5.12-rc1

#11
post #6

this is unlikely to hurt you unless you use a swap file , rather than a dedicated swap partition. for performance reasons most any modern linux installation would be using a dedicated swap partition, that is defined as swap-only during the install process with mkswap In my experience some of the reasons for using a swap file were more common maybe 10 or 15 years ago. Nowadays with disk space being less costly and rar…

Swapfiles are quite common when you use FDE (say, LUKS) and you don't want your swap to be in plaintext on disk.

(Although, you could just have an entire LUKS-encrypted swap volume instead of a swapfile...)

Re: A warning about 5.12-rc1

#13

I guess because I use a swapfile I am not normal according to Linus? Haha, I just find it easier to use a swap file when dual-booting Windows and my Linux install is encrypted. Otherwise, it'd me more work to ensure my swap partition is encrypted.

I recently ended up using swapfiles because I refactored my disk layout and it was just simpler to chuck the swap on an existing nvme partition. I realised an extra benefit: you can make it a sparse file, so it never even uses disk space at all until you actually need it, which could be never.

But if you suddenly need it and don't have it, you'll get segfaults (I assume). Sounds a bit too dangerous for me :p

Re: A warning about 5.12-rc1

#14
post #11
post #6

this is unlikely to hurt you unless you use a swap file , rather than a dedicated swap partition. for performance reasons most any modern linux installation would be using a dedicated swap partition, that is defined as swap-only during the install process with mkswap In my experience some of the reasons for using a swap file were more common maybe 10 or 15 years ago. Nowadays with disk space being less costly and rar…

Swapfiles are quite common when you use FDE (say, LUKS) and you don't want your swap to be in plaintext on disk. (Although, you could just have an entire LUKS-encrypted swap volume instead of a swapfile...)

most people I know who are paranoid to really go into the details of a FDE linux desktop/workstation environment choose to have no swap file, and at minimum 64GB of RAM. even safer if the swap doesn't exist.

Re: A warning about 5.12-rc1

#15
post #6

this is unlikely to hurt you unless you use a swap file , rather than a dedicated swap partition. for performance reasons most any modern linux installation would be using a dedicated swap partition, that is defined as swap-only during the install process with mkswap In my experience some of the reasons for using a swap file were more common maybe 10 or 15 years ago. Nowadays with disk space being less costly and rar…

I thought partitions used to be faster but files are just as fast now.[1]

[1] http://lkml.iu.edu/hypermail/linux/kernel/0507.0/1690.html

Re: A warning about 5.12-rc1

#16
post #5

I was interested to see the code. Linus's message doesn't provide commit IDs, so you have to go looking yourself. I believe this is the commit which introduces the bug: https://github.com/torvalds/linux/commit/48d15436fde6feebcde... And I believe this is the commit which fixes it: https://github.com/torvalds/linux/commit/caf6912f3f4af723234...

Why do you believe that’s the commit that caused the bug?

Re: A warning about 5.12-rc1

#17
post #8

I guess because I use a swapfile I am not normal according to Linus? Haha, I just find it easier to use a swap file when dual-booting Windows and my Linux install is encrypted. Otherwise, it'd me more work to ensure my swap partition is encrypted.

Dual boot is probably not typical for people who install rc kernels right away? I remember trying to do kernel dev on a dual-boot laptop in college, and I spent a lot of time trying to repair the bootloader while running off of a live-USB environment. 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 come…

It is a lot more uncommon for MBR-based boot partitions these days. It is no longer the default for Windows. With EFI and GPT, it is a lot simpler. Linux can use a Windows EFI boot partition, or vice-versa. Additionally, in my specific case I have a separate EFI partition saved on a USB stick for booting my encrypted root partition. It adds plausible deniability.

Re: A warning about 5.12-rc1

#18
post #11
post #6

this is unlikely to hurt you unless you use a swap file , rather than a dedicated swap partition. for performance reasons most any modern linux installation would be using a dedicated swap partition, that is defined as swap-only during the install process with mkswap In my experience some of the reasons for using a swap file were more common maybe 10 or 15 years ago. Nowadays with disk space being less costly and rar…

Swapfiles are quite common when you use FDE (say, LUKS) and you don't want your swap to be in plaintext on disk. (Although, you could just have an entire LUKS-encrypted swap volume instead of a swapfile...)

While maybe not the most performant my favorite is LVM2 on top of a single large LUKS-encrypted partition (+no boot partition and a single (custom platform key) signed EFI bootable kernel blob containing the initram fs in the EFI partition).

This:

- Allows a encrypted swap partition (on in lvm2 on top of luks, sure not perfect but I don't really use swap)

- Allows hibernation (which I don't really use tbh.)

- Fully encrypted disc

- Fast boot (compared to e.g. encrypted grub, at least last time I checked)

- Easy resizing of partitions on demand

- Which in turn makes it easier to use more partitions (for /, /home, etc.), which is necessary for taking advantage of certain mount flags like noexec for security.

Anyway I think the reason Ubuntu uses a swap file is because it means you don't need to resize a partition when "upgrading" your RAM or similar (for hibernation to work). Through tbh. they should make the choice in the installer dependent of the hardware.

Re: A warning about 5.12-rc1

#19
post #8

Earlier quoted context omitted.

Dual boot is probably not typical for people who install rc kernels right away? I remember trying to do kernel dev on a dual-boot laptop in college, and I spent a lot of time trying to repair the bootloader while running off of a live-USB environment. 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 come…

There's a cheaper, easier option. 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.

That's a perfect solution if you're already using the largest/fastest SSDs available, but otherwise be aware that you're sacrificing throughput: Each 1TB SSD will have around half the throughput of a single 2TB SSD because large SSDs are essentially a RAID0+ECC array of smaller SSDs

Re: A warning about 5.12-rc1

#20

Earlier quoted context omitted.

I recently ended up using swapfiles because I refactored my disk layout and it was just simpler to chuck the swap on an existing nvme partition. I realised an extra benefit: you can make it a sparse file, so it never even uses disk space at all until you actually need it, which could be never.

But if you suddenly need it and don't have it, you'll get segfaults (I assume). Sounds a bit too dangerous for me :p

You'll get OOM killed as if you ran out of RAM. This doesn't happen unless the program is buggy.

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

Post reply on HN