Remix.run Logo
ZoomZoomZoom 13 hours ago

It's not like it's easy to shuffle partitions around. Swap files are a pain, so you need to reserve space at the end of the table. By the time you need to increase swap the previous partition is going to be full.

Better overcommit right away and live with the feeling you're wasting space.

rascul 10 hours ago | parent | next [-]

> Swap files are a pain

Easier than partitions:

    mkswap --size 2G --file swap.img
    swapon swap.img
ZoomZoomZoom 31 minutes ago | parent [-]

Yeah, until you need to hibernate to one. I understand that calculating file offsets is not rocket science, but still, all the dance required is not exactly uninvolved and feels a bit fragile.

man8alexd 13 hours ago | parent | prev | next [-]

Exactly opposite. Don't use swap partitions, and use swap files, even multiple if necessary. Never allocate too much swap space. It is better to get OOM earlier then to wait for unresponsive system.

ZoomZoomZoom 24 minutes ago | parent [-]

Swap partition is set and forget. Can be detected by label automatically, never fails.

Swap file means fallocating, setting extended attributes (like `nocow`), finding file offset and writing it to kernel params, and other gotchas, like btrfs not allowing snapshotting a subvolume with an active swap file.

Technically it's preferable, won't argue with that.

direwolf20 12 hours ago | parent | prev [-]

Hast thou discovered our lord and savior LVM?