Systemd-swap: swapon errors "swap file has holes"

Created on 7 Jul 2020  ·  16Comments  ·  Source: Nefelim4ag/systemd-swap

On the latest version of systemd-swap on (manjaro testing) I'm only able to get zram to work, the other swapfc zswap doesn't work. On the version 4.0.1-2 all works fine. (I don't have tested other previous versions)

bug

All 16 comments

Hardware Configuration:

System:
  Host: Workstation Kernel: 5.7.6-1-MANJARO x86_64 bits: 64 compiler: gcc 
  v: 10.1.0 Desktop: Xfce 4.14.2 tk: Gtk 3.24.20 info: xfce4-panel wm: xfwm4 
  dm: LightDM 1.30.0 Distro: Manjaro Linux 
Machine:
  Type: Desktop Mobo: Gigabyte model: GA-78LMT-S2P v: x.x serial: <filter> 
  BIOS: Award v: F3 date: 10/18/2012 
CPU:
  Topology: Dual Core model: AMD Athlon II X2 250 bits: 64 type: MCP 
  arch: K10 rev: 3 L2 cache: 2048 KiB 
  flags: lm nx pae sse sse2 sse3 sse4a svm bogomips: 12057 
  Speed: 800 MHz min/max: 800/3000 MHz Core speeds (MHz): 1: 1800 2: 800 
Graphics:
  Device-1: AMD RV730 PRO [Radeon HD 4650] 
  vendor: Hightech Information System driver: radeon v: kernel 
  bus ID: 01:00.0 chip ID: 1002:9498 
  Display: x11 server: X.Org 1.20.8 driver: ati,radeon unloaded: modesetting 
  alternate: fbdev,vesa resolution: 1920x1080~60Hz 
  OpenGL: renderer: AMD RV730 (DRM 2.50.0 / 5.7.6-1-MANJARO LLVM 10.0.0) 
  v: 3.3 Mesa 20.1.2 compat-v: 3.0 direct render: Yes 
Audio:
  Device-1: AMD SBx00 Azalia vendor: Gigabyte driver: snd_hda_intel 
  v: kernel bus ID: 00:14.2 chip ID: 1002:4383 
  Device-2: AMD RV710/730 HDMI Audio [Radeon HD 4000 series] 
  vendor: Hightech Information System driver: snd_hda_intel v: kernel 
  bus ID: 01:00.1 chip ID: 1002:aa38 
  Sound Server: ALSA v: k5.7.6-1-MANJARO 
Network:
  Device-1: Qualcomm Atheros AR8161 Gigabit Ethernet vendor: Gigabyte 
  driver: alx v: kernel port: df00 bus ID: 02:00.0 chip ID: 1969:1091 
  IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
  IF-ID-1: vmnet1 state: unknown speed: N/A duplex: N/A mac: <filter> 
  IF-ID-2: vmnet8 state: unknown speed: N/A duplex: N/A mac: <filter> 
Drives:
  Local Storage: total: 223.58 GiB used: 29.45 GiB (13.2%) 
  ID-1: /dev/sda vendor: SanDisk model: SDSSDA120G size: 111.79 GiB 
  speed: 3.0 Gb/s serial: <filter> rev: 00RL scheme: MBR 
  ID-2: /dev/sdb vendor: Samsung model: SSD 840 EVO 120GB size: 111.79 GiB 
  speed: 3.0 Gb/s serial: <filter> rev: DB6Q scheme: GPT 
Partition:
  ID-1: / size: 111.79 GiB used: 28.70 GiB (25.7%) fs: btrfs dev: /dev/sda2 
  ID-2: /home size: 111.79 GiB used: 28.70 GiB (25.7%) fs: btrfs 
  dev: /dev/sda2 
Sensors:
  System Temperatures: cpu: 26.0 C mobo: N/A gpu: radeon temp: 62 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 228 Uptime: 31m Memory: 3.84 GiB used: 2.17 GiB (56.4%) 
  Init: systemd v: 245 Compilers: gcc: 10.1.0 Shell: zsh v: 5.8 
  running in: xfce4-terminal inxi: 3.0.37

I use btrfs if this can help, to troubleshoot

There was a botched PR (https://github.com/Nefelim4ag/systemd-swap/pull/140) modifying the btrfs code path, with the possible fix still being worked on (https://github.com/Nefelim4ag/systemd-swap/pull/144) as it seems.

Since #144 hasn't seen an update in a while by the submitter could I fix it up and merge it.

Whops, didn't mean to close this just yet.
Did c8431ddbd728e7da14eaa69362a2ef0becf6074d fix it for you?

@Jarel1337 I will give you Feedback when I‘m back at home. Should I use the version in the arch repo or git clone here?

@Jarel1337 I will give you Feedback when I‘m back at home. Should I use the version in the arch repo or git clone here?

Please use master (aur package here or just make install)

Doesn't seem to be working for me I've tried deleting the old systemd-swap folder and rebooting the system and it keeps on errorring out for me.

I'm using the aur package btw

systemctl status systemd-swap

● systemd-swap.service - Manage swap spaces on zram, files and partitions.
     Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; disabled; vendor preset: disabled)
     Active: active (running) since Wed 2020-07-08 22:29:05 +08; 2s ago
   Main PID: 2168 (bash)
     Status: "Monitoring memory status..."
      Tasks: 1 (limit: 19132)
     Memory: 8.7M
     CGroup: /system.slice/systemd-swap.service
             └─2168 bash /usr/bin/systemd-swap start

Jul 08 22:29:05 ryzen-linux systemd-swap[2168]: INFO: swapD: searching swap devices
Jul 08 22:29:05 ryzen-linux systemd-swap[2168]: INFO: swapFC: allocate chunk:  1
Jul 08 22:29:05 ryzen-linux systemd-swap[2254]: Job failed. See "journalctl -xe" for details.
Jul 08 22:29:05 ryzen-linux systemd[1]: systemd-swap.service: Got notification message from PID 2254, but reception only permitted for main PID 2168
Jul 08 22:29:06 ryzen-linux systemd-swap[2168]: INFO: swapFC: free swap: 0 < 15 - allocate chunk:  2
Jul 08 22:29:06 ryzen-linux systemd-swap[2288]: Job failed. See "journalctl -xe" for details.
Jul 08 22:29:06 ryzen-linux systemd[1]: systemd-swap.service: Got notification message from PID 2288, but reception only permitted for main PID 2168
Jul 08 22:29:07 ryzen-linux systemd-swap[2168]: INFO: swapFC: free swap: 0 < 15 - allocate chunk:  3
Jul 08 22:29:07 ryzen-linux systemd-swap[2324]: Job failed. See "journalctl -xe" for details.
Jul 08 22:29:07 ryzen-linux systemd[1]: systemd-swap.service: Got notification message from PID 2324, but reception only permitted for main PID 2168

relevant part of journalctl -xe:

Jul 08 22:29:41 ryzen-linux systemd[1]: Activating swap Swap File...
-- Subject: A start job for unit var-lib-systemd\x2dswap-swapfc-32.swap has begun execution
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit var-lib-systemd\x2dswap-swapfc-32.swap has begun execution.
-- 
-- The job identifier is 1414.
Jul 08 22:29:41 ryzen-linux swapon[3377]: swapon: /var/lib/systemd-swap/swapfc/32: skipping - it appears to have holes.
Jul 08 22:29:41 ryzen-linux systemd[1]: var-lib-systemd\x2dswap-swapfc-32.swap: Swap process exited, code=exited, status=255/EXCEPTION
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- An n/a= process belonging to unit var-lib-systemd\x2dswap-swapfc-32.swap has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 255.
Jul 08 22:29:41 ryzen-linux systemd[1]: var-lib-systemd\x2dswap-swapfc-32.swap: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The unit var-lib-systemd\x2dswap-swapfc-32.swap has entered the 'failed' state with result 'exit-code'.
Jul 08 22:29:41 ryzen-linux systemd[1]: Failed to activate swap Swap File.
-- Subject: A start job for unit var-lib-systemd\x2dswap-swapfc-32.swap has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit var-lib-systemd\x2dswap-swapfc-32.swap has finished with a failure.
-- 
-- The job identifier is 1414 and the job result is failed.
Jul 08 22:29:41 ryzen-linux systemd-swap[3376]: Job failed. See "journalctl -xe" for details.
Jul 08 22:29:41 ryzen-linux systemd[1]: Cannot find unit for notify message of PID 3376, ignoring.

@Jarel1337 same to me (like @nathanielcwm) installed via make install

newest version > journalctl -p err -b swap File failed to activate

@nathanielcwm Are you also using btrfs?

To work around this until a fix is merged you can set swapfc_force_use_loop=true

EDIT: apparently loop devices weren't allowed by the systemd-swap.service unit, the fix is a simple one liner and is on the current master.

Should be fixed by using dd instead of fallocate (I even forgot dd was not used for some filesystems, this should have happened long ago)

I hope it will fix it, the workaround: swapfc_force_use_loop=true show me invalide argument in systemctl status systemd-swap.service

Can also be Hardware related?

I hope it will fix it, the workaround: swapfc_force_use_loop=true show me invalide argument in systemctl status systemd-swap.service

Can also be Hardware related?

You will need to manually backport both commits for it to work, I would recommend just using master for now

Finally make install from master and the issue is gone. Thanks you so much @Jarel1337 !
I will wait until this is in arch Linux upstream repos.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

terencode picture terencode  ·  31Comments

cerebrux picture cerebrux  ·  4Comments

adrelanos picture adrelanos  ·  3Comments

TeslaBargain picture TeslaBargain  ·  7Comments

Nefelim4ag picture Nefelim4ag  ·  3Comments