Install and validate Fedora CoreOS with swap on zram enabled
- Download and verify the latest FCOS next image (pick the right image for your environment).
- Read background on zram here.
- Figure out how you'd like to configure your initial zram device.
- Read other possible post-boot tests as described here.
How to test
- Create an Ignition file.
- Configure Zram device validating instructions here.
- 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).
- Verify 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 126.96.36.199
- Verify the zram configuration injected by ignition is as expected.
[core@d-zram-test-1 ~]$ cat /etc/systemd/zram-generator.conf # This config file enables a /dev/zram0 device with the default settings [zram0]
- Verify zram has been correctly defined as a swap partition and to the expected size
The default is min(ram/4,4096) which in our 16GB machine instance means 4G.
[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
- Verify the linked documentation makes sense, nothing is obviously missing, and the instructions are clear.