From 4e8a2e65325c9ea86dbbd32664ead72dc60ee0dc Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 15 Oct 2020 13:55:20 -0400 Subject: [PATCH] sysconfig: add instructions for configuring SwapOnZRAM Related to https://github.com/coreos/fedora-coreos-tracker/issues/509 --- modules/ROOT/nav.adoc | 1 + .../pages/sysconfig-configure-swaponzram.adoc | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 modules/ROOT/pages/sysconfig-configure-swaponzram.adoc diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index bcd1c019..28c06d84 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -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] diff --git a/modules/ROOT/pages/sysconfig-configure-swaponzram.adoc b/modules/ROOT/pages/sysconfig-configure-swaponzram.adoc new file mode 100644 index 00000000..5392fe69 --- /dev/null +++ b/modules/ROOT/pages/sysconfig-configure-swaponzram.adoc @@ -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`.