Talk:Swap

From ArchWiki
Jump to navigation Jump to search

systemd-swap

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 https://github.com/Nefelim4ag/systemd-swap -- 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)

swapspace

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)

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

to

   /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)
Nevermind, was confusing swap file with swap partition. But, I'm not comfortable with the latest change of Swap: https://wiki.archlinux.org/index.php?title=Swap&action=historysubmit&type=revision&diff=560894&oldid=553734 - since the reason given to the change seems just to be that using UUID for a swap file didn't work for Romstor (see comment above). -- Mearon (talk) 20:12, 31 December 2018 (UTC)
I can't test it today, but I don't see how it would be possible to refer to a swap file by UUID. -- nl6720 (talk) 11:47, 1 January 2019 (UTC)

swapfile creation on btrfs

On btrfs the swapfile should be located in its own subvolume regardless of using snapper or not. The benefit of adding swapfile in its own subvolume is that it does not block performing a snapshot of /. There was a note regarding this which was reverted. It is uncertain if the notice should be included in Snapper or in Swap#Swap_file because 1) the method is not limited to be beneficial to snapper user. 2) the configuration of swapfiles for btrfs appears to be in Swap#Swap_file Krismorel (talk) 16:21, 11 February 2020 (UTC)

The btrfs-specific section is Btrfs#Swap file, not Swap#Swap_file. -- Lahwaacz (talk) 16:25, 11 February 2020 (UTC)
and Btrfs#Swap file refers to Swap#Swap_file :-). The exact quote "The proper way to initialize a swap file is described in Swap file#Swap file creation." —This unsigned comment is by Krismorel (talk) 16:31, 11 February 2020‎. Please sign your posts with ~~~~!
So? Everybody reading your note in Btrfs#Swap file can substitute /swapfile for the appropriate path. Also note that Btrfs#Swap file already contains a note about the same problem and that using "@" to refer to a subvolume is highly confusing outside of the Snapper page. -- Lahwaacz (talk) 16:48, 11 February 2020 (UTC)

Clarify swap discovery

The systemd-gpt-auto-generator(8)manual and the Systemd#GPT_partition_automounting explicitly state the automount capability to be exclusively tied to the GPT and the The Discoverable Partitions Specification. Also the wiki page somewhat honors this by "linking" to the systemd section with "see below". Shouldn't the wiki page be revised to clearly differentiate between MBR partition type and GPT partition type by deliberately untangling the introductory paragraph of the "Swap partition" section with its mix of MBR and GPT specific features? Drich (talk) 12:24, 18 February 2021 (UTC)