5

I'm installing Ubuntu on a Samsung evo 850 SSD drive. System has 4GB memory but no other harddrive. Should I use thedefault partition table or install without swap and make a swap file after installation? Or does it even make a difference whether it’s a partition or a file?

10
  • 1
    It doesn't make much difference. I am voting to close as opinion based.
    – Pilot6
    Jul 24, 2018 at 18:15
  • 1
    Swap on an ssd will cause life-decreasing wear no matter how you implement it. Jul 24, 2018 at 18:20
  • I agree with pilot6 and Nonny Moose. I would advice against swap on an ssd. Just turn the machine off and don't bother about hibernation or suspend.
    – Rinzwind
    Jul 24, 2018 at 18:25
  • 1
    Personally, I use swap files. With sufficient enough amount of RAM swap files are just fine, and swap doesn't get used that much because of RAM. Then again, putting swapfiles/partition on hard drive or USB is an option too. Jul 24, 2018 at 18:33
  • 1
    @oldfred your normal use clearly differs from mine. 9GB used and it's not even 10am yet.
    – jymbob
    Oct 9, 2018 at 8:30

1 Answer 1

10

For new installations of Ubuntu 17.04 and later a swap file is created by default instead of a swap partition. The first LTS release to use a swap file by default is Ubuntu 18.04. It's a logical new feature because of the emergence of SSDs. Creating a swap partition on an SSD will cause life-decreasing wear.*

10
  • For users concerned about SSD wear, another thing worth considering is to reduce swappiness to 0 or perhaps to 5. Although the jury is still out on that... Dec 19, 2018 at 3:12
  • 4
    No-one has said it entirely clearly yet - Does a swap file wear out an SSD less than a swap partition? E.g. due to the SSD being able to shuffle around the specific blocks being worn out by writing more - i.e. SSD wear manager has the whole free space on the system partition to use in case of a swap file versus a very limited amount of space in case of a swap partition.
    – Carolus
    Feb 12, 2020 at 11:07
  • 1
    So in 2020, on Ubuntu 17+, there's no reason for me to bother touching the Swap file, because the OS will handle everything for me? Dec 1, 2020 at 10:51
  • 2
    @EliezerBerlin For new installations of Ubuntu 17.04+ and all release upgrades that are upgraded from the same, the swap file is created automatically (including by default by the Ubuntu installer) without any additional user intervention being necessary.
    – karel
    Dec 1, 2020 at 10:55
  • 1
    You've got it exactly right. It all depends on what you intend to use swap space to do. My computer has lots of RAM and I don't ever hibernate it, so it doesn't need much swap space. btw a swap file in Ubuntu can be configured to be dynamically resized in order to save disk space.
    – karel
    Jan 10, 2021 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.