From ArchWiki
Revision as of 19:56, 31 December 2018 by Mearon (talk | contribs) (Swapfile fstab entry: reply)
Jump to navigation Jump to search


Can we add more documentation on what this is? How it works? What's the difference between Swap File Universal and Swap File Chunked? Do we need to activate both zram and zswap? Do we need both swapfu and swapfc? When would we want a certain configuration? Where is the swap file located? Can we use this to enable hibernation?

—This unsigned comment is by An2quo (talk) 16:41, 11 January 2017‎. Please sign your posts with ~~~~!

That information seriously belongs to -- not here, since they are just details for the script. We already describe the background info in Swap, Zswap, Improving_performance#Zram_or_zswap and Power_management/Suspend_and_hibernate#Hibernation, your questions can be answered by simply reading the script. -- Lahwaacz (talk) 16:59, 11 January 2017 (UTC)
I want to cast my vote for a bit more documentation (may be just a few sentences, as it is done for many other articles in the wiki) as to how different the systemd-swap is. I'd agree that most information should be somewhere else, but I'd really appreciate if I can have enough to make a decision about using it. As an example, will hibernate be still supported if I chose to go with systemd-swap? -- Romstor (talk) 04:27, 30 December 2018 (UTC)


Before I just go and do it, I wish to know if a section about swapspace (aur) would be useful. It dynamically allocates SWAP as needed.

—This unsigned comment is by Krutonium (talk) 03:13, 1 September 2017‎. Please sign your posts with ~~~~!

There is already systemd-swap, so why not... -- Lahwaacz (talk) 08:23, 1 September 2017 (UTC)

can we add a little more detail to "edit fstab to add an entry for swap file"?

it's not clear to me whether the user should type what follows (both lines) into an elevated terminal, or whether it is saying to navigate to /etc/fstab and then use xed (or whatever) to add the second line.

—This unsigned comment is by PainfulQs (talk) 15:25, 12 September 2017‎. Please sign your posts with ~~~~!

See Help:Reading#Append, add, create, edit, which explains the conventions for this kind of instructions. Also, since there is a link to fstab, it is a good idea to follow it and learn about the format of the string you're being asked to insert. -- Lahwaacz (talk) 15:29, 12 September 2017 (UTC)
I followed and read the fstab page. it's not spelled out (to me at least) *how* to edit fstab. Wouldnt it be clearer to say run terminal, switch to root by "su -" and then "nano /etc/fstab" ? or is that against convention? PainfulQs (talk) 15:43, 12 September 2017 (UTC)
Editing text files is a basic prerequisite for using this wiki, there are so many different options that explaining everything everywhere is pointless. -- Lahwaacz (talk) 15:48, 12 September 2017 (UTC)

Swapfile fstab entry

Today I tried to setup hibernation on my installation without swap partition thus I had to create a swapfile. Everything worked fine apart from the the fact the the file was not "swaponed" after a reboot. After some googleing I changed the line:

   /swapfile none swap defaults 0 0


   /swapfile swap swap defaults 0 0

as RedHat and CentOS have it and it resolved the problem. Can someone comment on this / verify that this is not only an issue on my system? Apart from RetHat and CentOS the other distributions / tuts / forums use the current fstab line. -- Eyenseo (talk) 17:48, 19 November 2017 (UTC)

I just followed the instructions on a brand new install and the first version (the one in the wiki) worked. Swap was on after reboot as well. It will be good to know (or have an example) if we can use UUID instead (the one that mkswap returns) of a label. Although when I tried - it couldn't be mounted during boot. It probably makes sense as the swap is a file in this case and not exactly a valid partition, but still -- it would be good to have a note there from someone with good understanding of the process. -- Romstor (talk) 04:21, 30 December 2018 (UTC)
In fstab(5) it says under section "The second field (fs_file).":
   For swap partitions, this field should be specified as `none'.
For me, setting the second field to 'none' does indeed work. Additionally I have my swap device specified by UUID. -- Mearon (talk) 19:56, 31 December 2018 (UTC)