zram-generator
Systemd unit generator for zram swap devices
- Provided by: systemd-zram-generator (Version: 0.3.2-1)
- Source: rust-zram-generator
- Report a bug
Systemd unit generator for zram swap devices
/usr/lib/systemd/system-generators/zram-generator
TARGET_DIR [2RGET_DIR 3RGET_DIR]
/usr/lib/systemd/system-generators/zram-generator --setup-device
DEVICE
/usr/lib/systemd/system-generators/zram-generator --reset-device
DEVICE
zram-generator is a generator that creates systemd units to format and use compressed RAM devices, either as swap or a mount point.
The generator will be invoked by systemd early at boot. The generator will then:
The generator does nothing if run inside a container (as determined by systemd-detect-virt(8) --container).
The generator also understands the kernel command-line option systemd.zram. See zram-generator.conf(5) for details.
Setting the ZRAM_GENERATOR_ROOT environment variable makes
the generator run in test mode, in which case containerisation is ignored
and step 3 is skipped.
For the ramifications of ZRAM_GENERATOR_ROOT on config handling, see
zram-generator.conf(5).
Generated dev-zramN.swap units depend on systemd-swap-create@zramN.service, which will:
Generated path-to-mount-point.mount units depend on systemd-swap-create@zramN.service. The effect is similar to what happens for swap units, but of course they are formatted with a file system.
When the unit is stopped, the zram device is reset, freeing memory and allowing the device to be reused.
zram-generator implements systemd.generator(7).
<https://github.com/systemd/zram-generator/issues>
zram-generator.conf(5), systemd.generator(7), systemd.swap(5)
<https://github.com/systemd/zram-generator>
Linux documentation of zram:
<https://kernel.org/doc/html/latest/admin-guide/blockdev/zram.html>
and the zram sysfs ABI:
<https://kernel.org/doc/Documentation/ABI/testing/sysfs-block-zram>