Systemd Swap Versions Save

Script for creating hybrid swap space from zram swaps, swap files and swap partitions.

4.4.0

3 years ago

Major changes

  • systemd-swap is now completely rewritten in python
  • systemd-swap compression lists available compression algorithms (#93)

Minor changes

  • systemd-swap status now works without root (some info requires root and are not displayed without sudo)
  • systemd-swap can now swapon virtblk disks (for use within VMs)

New dependencies

  • python-sysv-ipc
  • python-systemd
  • >=python-3.7

4.3.3

3 years ago

This is a simple release containing the last fixups of the bash code before moving on to the python rewrite (#164), if there are requests to continue the bash version a 4.3.x branch will be created and maintained for the foreseeable future.

Fixes

  • Properly set swapd_prio (#169)
  • Fix a error message on some Debian based systems when building the package (#168)

4.3.2

3 years ago

4.3.1 did not actually fix this issue

4.3.1

3 years ago
  • Allow for loopback devices once again (however if you need to use loopback please report why)
  • Use dd for all filesystems, fixing #155 when using swapFC on BTRFS
  • Fix a issue where the zram module would not load properly on startup causing all kinds of problems
  • (Debian based distros) don't override configuration files in /etc

4.3.0

3 years ago
  • Properly create btrfs subvolume introduced in 4.2.2
  • New variable swapfc_free_ram_perc for setting the first swapfc file (other swapfc swap files are still managed by swapfc_free_swap_perc)
  • Some performance improvements by rewriting external programs in pure bash code

4.2.3

3 years ago
  • Set swapfc_priority to 50 by default so that systemd doesn't log warning (#135)
  • Check if swapfc_frequency is a valid integer, error otherwise (#121)

4.2.2

3 years ago
  • Now allows swapon for swap partitions found on /dev/sd* and /dev/nvme*.
  • Now always swapon all zram devices (previously the first one would under certain circumstances not be made active).
  • Create a btrfs subvolume in swapfc_path so that snapshots work.
  • SwapFC now more accuratly logs why the swap file was created.

4.2.1

3 years ago

Last release carried a regression causing zrams size to be too large. (#134)

4.2.0

3 years ago

New features

We now read configuration options from the following files and folders:

  • /etc/systemd/swap.conf.d/*.conf
  • /run/systemd/swap.conf.d/*.conf
  • /usr/lib/systemd/swap.conf.d/*.conf
  • /etc/systemd/swap.conf
  • /usr/share/systemd-swap/swap-default.conf (With priority from top to bottom).

We now support some new configuration options:

  • swapfc_remove_free_swap_perc Allows defining at what % of available ram we remove a swap file (defaluts to 55 which is the old value of swapfc_free_swap_perc + 40.
  • swapfc_min_count Just how you can define the maximum number of swap files created by swapfc, you can now define a minimum that will always be allocated (for instanse to restore the old behaviour of creating a swap file on startup set this to 1). Defaults to 0.
  • swapfc_priority Sets the priority of swap files created by swapfc (decreasing by one for every swap file created). Defaults to -2 (old default).

There are two new man pages, 5 swap.conf and 8 systemd-swap.

Please read through them and send in grammar mistakes and anything you would like to be added :partying_face: .

Misc

  • Further removal of use of external programs thus improving performance (thanks zenofile).
  • Additional systemd hardening.
  • Run as type=notify which should improve the output of systemctl status systemd-swap.
  • Run systemd-swap at "realtime" priority (1ac16cbbb526d55f8db8b0ff66f2a3dc055041c6 if you're interested).
  • Code refactoring and cleanup.
  • Log when we start creating swap files and warn if combining zram with zswap/swapfc/swapd.
  • Never shred the swap file before using it (previously it would shred if the filesystem was not ext* or btrfs) (3f2e5a9c6b238f19e73e4bca1d4596f2bf4690ce & 41d86af4557454c182f357f16bf018924ff3fef6).

4.1.0

3 years ago

New features

  • BTRFS swapfile support
  • Only create the first swapfile (swapfc) if we're low on ram instead of on startup
  • Setting to specify zRAM count

Updates

  • Update defaults to zstd compression and z3fold
  • Remove dependencies on external shell programs improving performance
  • Various code cleanups
  • Various documentation updates
  • Harden systemd service

Bug fixes

  • Use dd instead of fallocate if we're on ext4/3, f2fs or xfs (#109)
  • Don't attempt chattr +C on filesystems that don't support the flag

Regressions

If you're running Ubuntu 18.04 or Centos 7 or older, please comment out line 25 in /usr/lib/systemd/system/systemd-swap.service (see #118)