From Fedora Project Wiki

Revision as of 14:53, 4 April 2022 by Fifofonix (talk | contribs)

Description

Install and validate Fedora CoreOS with swap on zram enabled

Setup

  1. Download and verify the latest FCOS next image (pick the right image for your environment).
  2. Read background on zram here.
  3. Figure out how you'd like to configure your initial zram device.
  4. Read other possible post-boot tests as described here.

How to test

  1. Create an Ignition file.
  2. Configure Zram device validating instructions here.
  3. Launch your Fedora CoreOS system using this Ignition file. See the Quickstart and the provisioning docs for a guide how to launch FCOS in most environments (bare metal, virtual, cloud, etc).

Expected Results

  1. You can SSH successfully into your FCOS system and that it is on the expected version

$ ssh 172.25.81.173 Fedora CoreOS 36.20220325.1.0 Tracker: https://github.com/coreos/fedora-coreos-tracker Discuss: https://discussion.fedoraproject.org/tag/coreos

Last login: Mon Apr 4 14:42:45 2022 from 156.111.209.231 [core@d-zram-test-1 ~]$

  1. Verify the zram configuration injected by ignition is as expected.
$ cat /etc/systemd/zram-generator.conf
# This config file enables a /dev/zram0 device with the default settings
[zram0]
  1. Verify zram has been correctly defined as a swap partition and to the expected size
[core@d-zram-test-1 ~]$ zramctl --output-all
zramctl --output-all
NAME       DISKSIZE DATA COMPR ALGORITHM STREAMS ZERO-PAGES TOTAL MEM-LIMIT MEM-USED MIGRATED MOUNTPOINT
/dev/zram0       4G   4K   80B lzo-rle         4          0   12K        0B      12K       0B [SWAP]
[core@d-zram-test-1 ~]$ swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   4G   0B  100
  1. Saturate memory and confirm usage via zramctl

In the example below we have a 16GB machine. We initially fill memory with 15GB and confirm usage via top. Then add another 3GB of usage and confirm that zram is used.

</dev/zero head -c 15G