Is ZRAM always installed?

Hi all,

Is zram always used, whatever the way Fedora has been installed?

I’ve been quit out of the loop for a while and just discovered on this documentation page that swap is replaced by zram “on Fedora Workstation”.

The thing is I generally do not specifically install “Fedora Workstation” I use the net install and customize packages. Sometimes installing a very minimal environment and adding GUI and desktop afterwards. The end result is more a less a minimal Fedora Workstation.

Is zram used in this context? Or do I need to set it up explicitly?

You want to know how to query if zram is setup?
You can runzramctl to see what is set up.

Well I’d like to know beforehand if it will be setup.

Since the doc says it is setup for Fedora Workstation, I don’t know if it will be setup if I go my usual netinstall/custom way. I’d prefer to know before doing a useless install.

By default fedora uses zram.
I don’t think this varies between the various spins

2 Likes

Ok, thanks!

By the way, whatever the installer does, you can always enable or disable zram after installation, see Changes/SwapOnZRAM - Fedora Project Wiki for more information.

1 Like

Thanks Flo, I’ll keep that in mind.

I have noticed that on fedora vagrant boxes that zram is installed but not enabled. I do not know if this is also true for other fedora cloud implementations.

I’ve noticed zram points to a swap partition on my hard-drive, tho’ this probably stems from successive updates from when I started using fedora 28

Please post whatever you are seeing that makes you believe that. ZRAM is a virtual swap space in ram that the system uses as needed for swap.

There may be additional swap space on the hdd, but zram exists only in RAM.

The swapon command with no arguments will show all active swap spaces on the system.

# swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   8G 512K  100

While that shows as a “partition” it actually is a segment of the physical RAM on my system.
It will also be displayed similarly with lsblk

# lsblk
NAME                  MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
zram0                 252:0    0    8G  0 disk  [SWAP]

while it is shown in reality with the free command

# free
               total        used        free      shared  buff/cache   available
Mem:        32782444     5407744     4953812      137544    23028896    27374700
Swap:        8388604         512     8388092

If you continuously upgraded from F28 (which is entirely legit), you did not receive swap-on-zram unless you manually installed and enabled it. Only fresh installations starting from F33 enabled swap-on-zram by default (it was installed since F31 but not enabled by default). (see wiki link in my previous post above).

If that were the case then zram should not be configured and /dev/zram0 should not exist.