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?
-
1It doesn't make much difference. I am voting to close as opinion based.– Pilot6Commented Jul 24, 2018 at 18:15
-
1Swap on an ssd will cause life-decreasing wear no matter how you implement it.– Nonny MooseCommented 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.– RinzwindCommented Jul 24, 2018 at 18:25
-
1Personally, 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.– Sergiy KolodyazhnyyCommented Jul 24, 2018 at 18:33
-
1@oldfred your normal use clearly differs from mine. 9GB used and it's not even 10am yet.– jymbobCommented Oct 9, 2018 at 8:30
|
Show 5 more comments
1 Answer
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.*
-
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... Commented Dec 19, 2018 at 3:12
-
4No-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.– CarolusCommented Feb 12, 2020 at 11:07
-
1So 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? Commented 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.– karelCommented Dec 1, 2020 at 10:55
-
1You'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.– karelCommented Jan 10, 2021 at 15:01