Selecting Swap Space in the EndeavourOS Installation

Hi friends.

I need to create a 16gb swap file during the installation of my EndeavourOS.

I haven’t tried the latest EOS ISO yet, but on the previous ISO, when I selected “Erase Disk + Swap to File”, I couldn’t continue with the installation for some reason I don’t remember, but I think a screen appeared to create the partition Swap manually (or something like that), and I didn’t know how to do it.

So how do I create a Swap on EOS after selecting “Erase Disk”?

Also, what is the difference between the 3 Swaps available during EOS installation? Since I have seen several people use the 3 different types of Swap.

I need 16gb of Swap for Blender, since it helps me alleviate the % of work on the PC by preloading the textures before rendering. I know that it is always better to buy more ram, but the Swap helps a little, even if it is not much.

Thanks in advance.

By the way, I am referring to this part of the installation (the screenshot is not mine):

1 Like

There is no trick, you just pick the option you want from the box.

The only difference between hibernate/no hibernate is the size. If you pick hibernate, it ensures swap is at least as big as RAM, otherwise it tops out at 8GB.

If you choose swapfile it uses a file instead of a dedicated partition.

Unless you happen to have 16GB of physical ram, it won’t give you a 16GB swap partition. I would select no swap and then just create a swapfile after the install. It is very easy to do. That being said, I don’t think a very large swap file/partition will make blender all that much faster. Pre-caching things from disk back to disk might makes things slower. You would have to test and see what the performance difference between 8GB and 16GB of swap is.

2 Likes

Hi,

You can always create swap later and choose no swap first.
After a succesfull installation you might consider zram-generator

sudo pacman -S --noconfirm zram-generator;sudo vim /etc/systemd/zram-generator.conf

[zram0]
zram-size = min(ram / 2, 4096)
compression-algorithm = zstd
swap-priority = 100
fs-type = swap
1 Like

The only difference is the size, but do both partitions work the same?

But “With Hibernate” I think it saves everything you are doing when you turn off the computer, like the “fast startup” of Windows, right? And I don’t want that.

I mean, I don’t want to use hibernation, sleep or anything like that, so I disabled everything with this:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Also, is there any performance/speed difference between swap partition or swap file?

Because it seems that the swap file can be deleted/extended/shrinked, but I think not the swap partitions.

But on the other hand the partitions seem more “stable” since they have an “isolated” space, and perhaps the swap file needs to take GBs from the EOS storage, and I don’t know if this can cause instability or something in the future.

I see, thank you very much. I have 16gb of ram, I forgot to mention it.

I know this won’t make much difference, but even if it relieves 5-10%, it will be enough. Sometimes I have to open files I download with very heavy textures and my EOS gets stuck and I have to REISUB. Perhaps this can mitigate or prevent this from happening.

If you don’t recommend the swap partition over the swap file, then I will create a swap file and test the difference.

By the way, I’m reading the wiki tutorial:

https://wiki.archlinux.org/title/swap#Swap_file_creation

And I want to make sure I don’t break something, is this correct and do these commands still work? (I just changed “4gb” to “16gb”):

Use mkswap to create a swap file the size of your choosing. For example, creating an 4 GiB swap file:

# mkswap -U clear --size 16G --file /swapfile

Activate the swap file:

# swapon /swapfile

Finally, edit the fstab configuration to add an entry for the swap file:

/etc/fstab

/swapfile none swap defaults 0 0

The 1st command creates the file, the 2nd command activates it (I didn’t know it needed to be activated). But what do the 3rd and 4th command do? (fstab). Add the swap file to run when starting EOS?

Sorry, a lot of text!

Yes, they do.

While that is true, selecting “With hibernate” in the installer only changes the size. It makes sure the swap partition is big enough to support hibernation.

It is unlikely you would notice any material performance difference in most desktop use cases.

A swapfile won’t create instability.

If you are running out of memory, having some swap can help. However, having lots of swap probably won’t help more than having a reasonable amount of swap. In rare cases, it could decrease performance. I would start with 8GB and see how it goes.

They should, as long as you are not using a btrfs filesystem.

Those aren’t command. The third is the name of a file. The fourth is is a line you should add to the file.

2 Likes

Sorry for the late reply!

I had to do a new installation of EOS, and I chose to create the swap file type.

And you are right, just selecting it is enough, but unfortunately it doesn’t let me choose the file size, if I choose the “swap file” version instead of the other 2.

After installing EOS, I tried rendering in blender, and unfortunately I need more swap, since “swap file” only creates a 512mb swap file:

(I am using ext4)

Swap:
  ID-1: swap-1 type: file size: 512 MiB used: 137.2 MiB (26.8%)
    file: /swapfile

For some reason I think swap helps to ease the load on physical memory and splits it with the help of swap, when loading heavy textures.

I have 16gb and I already know that for loading and rendering heavy textures in Blender more ram is needed, but I only have this one pc. So I’m sure a bigger swap file will help me.

I could have chosen the other 2 types of hibernate swap partitions, but I read in this blog the differences between swap partitions and swap files, and swap file seems to me more flexible and with more advantages:

So when installing EOS and choosing swap file, I can only choose the default size, 512mb, in case I want the swap file and not the swap partition.

So I’m looking in the wiki but they don’t say anything about how I can increase the swap file:

https://wiki.archlinux.org/title/Swap

Maybe it can’t be increased, and I have to delete it and create one from 0?

That’s right, you have to disable the swap and delete the swapfile, and then recreate the file and enable the swap.

1 Like

Seems to me, based on my limited linux installation experience, SWAP partitions have become less mandatory.

1 Like

Thanks friend, sorry for taking so long to answer, I will do it now that I have time.

One noob question, what does # mean in front of the command, should I paste # swapoff /swapfile in the terminal, or is the # not necessary?

There are times that it says $, and I think it is not necessary to put it, $ I think it means that you should put sudo in front of the command, I think.

EDIT:

Sorry, it was only necessary to put sudo instead of #!

Thank you very much, I’ve done almost everything!

sudo swapoff /swapfile
sudo rm -f /swapfile

(swap file remove)

sudo mkswap -U clear --size 16G --file /swapfile
sudo swapon /swapfile

But I don’t understand the last step, I opened the file /etc/fstab with Kate, and I have to modify /swapfile none swap defaults 0 0, but I don’t know in which column I should put each thing (blue, purple, blue again, orange):

Just put none between /swapfile and swap. And remove the second swap.

1 Like

Thanks friend! If my 2 neurons are still working, I did it correctly? :sweat_smile:

1 Like

Yes, it’s fine!

1 Like

When you see a command prefaced by a $ or a #, the symbols are informational. They tell you whether or not you need to have root privileges to run the command.

$ - command is run by your user (no sudo)

# - command is run by root (sudo is needed)

The symbols represent either a normal unprivileged user’s terminal prompt ($), or a root-privileged terminal prompt (#).

You do not enter the symbols into the terminal.

4 Likes

It’s not necessary, see Stagger-Lee answer.

1 Like

Thank you both.

I see, all this time I assumed that $ was $udo, but it was the other way around.

Thanks for the explanation, sometimes I learn little by little but I forget to learn the most basic things because I take them for granted. :sweat_smile:

1 Like

Here’s a nice page to read through, and maybe bookmark for future reference:

https://wiki.archlinux.org/title/Help:Reading

2 Likes

Thanks, I’ll take a look tonight! :smiley:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.