Skip to content

Commit

Permalink
sysconfig: add instructions for configuring SwapOnZRAM
Browse files Browse the repository at this point in the history
  • Loading branch information
dustymabe committed Oct 21, 2020
1 parent 1a16de7 commit 4e8a2e6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*** xref:authentication.adoc[Configuring Users and Groups]
*** xref:hostname.adoc[Setting a Hostname]
*** xref:customize-nic.adoc[How to Customize a NIC Name]
*** xref:sysconfig-configure-swaponzram.adoc[Configuring SwapOnZRAM]
** OS updates
*** xref:update-streams.adoc[Update Streams]
*** xref:auto-updates.adoc[Auto-Updates]
Expand Down
26 changes: 26 additions & 0 deletions modules/ROOT/pages/sysconfig-configure-swaponzram.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
= Configuring Swap on ZRAM

In Fedora 33 some editions https://www.fedoraproject.org/wiki/Releases/33/ChangeSet#swap_on_zram[enabled swap on ZRAM by default]. Fedora CoreOS currently has the `zram-generator` included but no configuration in place to enable swap on ZRAM by default. In order to configure swap on ZRAM you can lay down a configuration file via Ignition that will tell the zram generator to set up swap on top of a zram device.

The documentation for the config file format lives in the https://github.com/systemd/zram-generator/blob/master/man/zram-generator.conf.md[upstream documentation] along with a comprehensive https://github.com/systemd/zram-generator/blob/master/zram-generator.conf.example[example]. The most basic form of a configuration file that will set up a `zram0` device for swap is:

[source,yaml]
----
variant: fcos
version: 1.1.0
passwd:
users:
- name: core
ssh_authorized_keys:
- $pubkey
storage:
files:
- path: /etc/systemd/zram-generator.conf
mode: 0644
contents:
inline: |
# This config file enables a /dev/zram0 device with the default settings
[zram0]
----

Once booted, you can verify the swap device is set up by viewing the `swapon --show` output. You can also view the true compression ratio of the currently configured zram devices by running `zramctl`.

0 comments on commit 4e8a2e6

Please sign in to comment.