2

With the release of Ubuntu 18.04 (and 17.04) the swap partition will be replaced with a swap file. Has this been the case with previous Ubuntu releases?

I ask this because I've found several mentions of this term, "swap file" dated from 2011-2015 here on askubuntu, notably this post How do I configure swappiness?, but it's not clear if they are just using loose terminology referring to the swap partition (calling it a file), or if they mean an actual swap file.

jordy
  • 1,670
  • No and also see https://askubuntu.com/questions/904372/swap-partition-and-swap-file – Rinzwind Jun 20 '18 at 08:56
  • Swap file is an actual file. There's particular steps to create one, and I've made a script that automates the steps as well. As for history, they weren't used by default installation - it was something a user had ro configure themselves. It's been sort of practice to add swap on demand, particularly used when SSDs just came out, so having whole partition for swap didn't make sense - that contributed to SSD wear – Sergiy Kolodyazhnyy Jun 20 '18 at 09:12
  • Read man swapon swapon, swapoff - enable/disable devices and files for paging and swapping – waltinator Jun 20 '18 at 13:07
  • I've installed Ubuntu 18.04 and I've a swap partition and it works fine. And I'm sure swap partitions make sense also in future releases. – abu_bua Jun 22 '18 at 08:15

1 Answers1

3

File or partition, vm.swappiness affects swap as a whole. It doesn't matter where the swap area comes from (so the post could say simply "swap area"). Swap files were usable for years before Ubuntu ever existed. And Ubuntu has always used a swap partition by default until 17.04. Switching to swap files when installing has been proposed multiple times, but never implemented till now.

muru
  • 197,895
  • 55
  • 485
  • 740
  • 1
    It's good to know changing swappiness settings will work the same way as before. It will be the same method, is that right? – jordy Jun 20 '18 at 09:19
  • 1
    @danthonyd I'm reasonably certain it will be. Linus hates changes that break userspace, and userspace has had over a decade now to get used to vm.swappiness. – muru Jun 20 '18 at 09:21
  • 1
    Perhaps I'll open a question about that, if for no other reason than to act as a resource. – jordy Jun 20 '18 at 10:40