Talk:Swap

From ArchWiki

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)Reply[reply]
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)Reply[reply]

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)Reply[reply]

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)Reply[reply]

The btrfs-specific section is Btrfs#Swap file, not Swap#Swap_file. -- Lahwaacz (talk) 16:25, 11 February 2020 (UTC)Reply[reply]
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)Reply[reply]

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)Reply[reply]

Swap file creation: more specific mount options for btrfs

the Swap#Swap_file_creation section has a note that states "When using Btrfs, do not forget to add the created subvolume to the list as well, and remove the discard,autodefrag and compression options." Could we be more specific about which options should be used? Are we sure we should not just use "defaults" as recommended on the man page btrfs(5) § SWAPFILE SUPPORT?

—This unsigned comment is by Thawn (talk) 23:16, 28 December 2021. Please sign your posts with ~~~~!

There are no options that should be used. The note says which options should not be used, the rest is up to you. E.g. to mount a btrfs subvolume, you typically need the subvol or subvolid option, see Btrfs#Mounting subvolumes. — Lahwaacz (talk) 07:36, 29 December 2021 (UTC)Reply[reply]

Expanding swapfile quicly

A section on the best way to expand or shrink the swapfile would be helpful. A stackexchange answer suggested using the `oflag=append conv=notrunc` arguments to dd.

Also, I don't suppose there's any way to speed up the process? On a half-decent laptop, creating a 16GiB swapfile took about 500s.

—This unsigned comment is by Jmcb (talk) 14:51, 21 July 2022‎. Please sign your posts with ~~~~!