Comments (12)
Please provide the the error message (journalctl -u var-lib-systemd-systemd\x2dswap-swapfc-28.swap
).
from systemd-swap.
I'd recommend keeping the default swapfc_path
and not set anything by yourself (the program is meant to automate everything)
from systemd-swap.
ok, i used the config from https://github.com/Nefelim4ag/systemd-swap/blob/master/include/swap-default.conf and only set swapfc_enabled=1
But it seems i get another error this way once more memory is consumed:
~ >>> systemctl status systemd-swap.service
● systemd-swap.service - Manage swap spaces on zram, files and partitions.
Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2020-12-20 16:17:51 CET; 52s ago
Process: 1380 ExecStart=/usr/bin/systemd-swap start (code=exited, status=1/FAILURE)
Main PID: 1380 (code=exited, status=1/FAILURE)
Status: "Allocating swap file..."
Dez 20 16:17:51 Zaubertrank systemd-swap[1380]: swap_fc.run()
Dez 20 16:17:51 Zaubertrank systemd-swap[1380]: File "/usr/bin/systemd-swap", line 227, in run
Dez 20 16:17:51 Zaubertrank systemd-swap[1380]: self.create_swapfile(
Dez 20 16:17:51 Zaubertrank systemd-swap[1380]: File "/usr/bin/systemd-swap", line 329, in create_swapfile
Dez 20 16:17:51 Zaubertrank systemd-swap[1380]: subprocess.run(["systemctl", "start", unit_name], check=True)
Dez 20 16:17:51 Zaubertrank systemd-swap[1380]: File "/usr/lib/python3.9/subprocess.py", line 524, in run
Dez 20 16:17:51 Zaubertrank systemd-swap[1380]: raise CalledProcessError(retcode, process.args,
Dez 20 16:17:51 Zaubertrank systemd-swap[1380]: subprocess.CalledProcessError: Command '['systemctl', 'start', 'var-lib-systemd\\x2dswap-swapfc-1.swap']' returned non-zero exit status 1.
Dez 20 16:17:51 Zaubertrank systemd[1]: systemd-swap.service: Main process exited, code=exited, status=1/FAILURE
Dez 20 16:17:51 Zaubertrank systemd[1]: systemd-swap.service: Failed with result 'exit-code'.
from systemd-swap.
ok, now it seems to be working correclty - i didn't change anything, so it has to be something in manjaros testing-update from the 22nd: https://lists.manjaro.org/pipermail/manjaro-packages/Week-of-Mon-20201221/034718.html
from systemd-swap.
apparently it's still present, just much later:
~ >>> systemctl status systemd-swap.service
● systemd-swap.service - Manage swap spaces on zram, files and partitions.
Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2020-12-27 01:36:53 CET; 31min ago
Process: 1370 ExecStart=/usr/bin/systemd-swap start (code=exited, status=1/FAILURE)
Main PID: 1370 (code=exited, status=1/FAILURE)
Status: "Allocating swap file..."
Dez 27 01:36:53 Zaubertrank systemd-swap[1370]: swap_fc.run()
Dez 27 01:36:53 Zaubertrank systemd-swap[1370]: File "/usr/bin/systemd-swap", line 237, in run
Dez 27 01:36:53 Zaubertrank systemd-swap[1370]: self.create_swapfile(
Dez 27 01:36:53 Zaubertrank systemd-swap[1370]: File "/usr/bin/systemd-swap", line 329, in create_swapfile
Dez 27 01:36:53 Zaubertrank systemd-swap[1370]: subprocess.run(["systemctl", "start", unit_name], check=True)
Dez 27 01:36:53 Zaubertrank systemd-swap[1370]: File "/usr/lib/python3.9/subprocess.py", line 524, in run
Dez 27 01:36:53 Zaubertrank systemd-swap[1370]: raise CalledProcessError(retcode, process.args,
Dez 27 01:36:53 Zaubertrank systemd-swap[1370]: subprocess.CalledProcessError: Command '['systemctl', 'start', 'var-lib-systemd\x2dswap-swapfc-28.swap']' returned non-zero exit status 1.
Dez 27 01:36:53 Zaubertrank systemd[1]: systemd-swap.service: Main process exited, code=exited, status=1/FAILURE
Dez 27 01:36:53 Zaubertrank systemd[1]: systemd-swap.service: Failed with result 'exit-code'.
from systemd-swap.
~ >>> journalctl -u var-lib-systemd-systemd\x2dswap-swapfc-28.swap [3]
-- Journal begins at Sun 2020-12-13 14:39:38 CET, ends at Sun 2020-12-27 02:29:01 CET. --
-- No entries --
not very much... i've also tried some other numbers (swapfc-1.swap, swapfc-8.swap and so on), no entries for any of them
journalctl -b | grep swap
gives me:
Dez 27 01:30:52 Zaubertrank systemd-swap[1370]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 27
Dez 27 01:30:53 Zaubertrank systemd[1]: Activating swap Swap File...
Dez 27 01:30:53 Zaubertrank systemd[1]: Activated swap Swap File.
Dez 27 01:30:53 Zaubertrank kernel: Adding 262140k swap on /var/lib/systemd-swap/swapfc/27. Priority:24 extents:1 across:262140k DscFS
Dez 27 01:36:53 Zaubertrank systemd-swap[1370]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 28
Dez 27 01:36:53 Zaubertrank systemd[1]: Activating swap Swap File...
Dez 27 01:36:53 Zaubertrank swapon[265560]: swapon: /var/lib/systemd-swap/swapfc/28: swapon fehlgeschlagen: Die Operation ist nicht erlaubt
Dez 27 01:36:53 Zaubertrank systemd[1]: var-lib-systemd\x2dswap-swapfc-28.swap: Swap process exited, code=exited, status=255/EXCEPTION
Dez 27 01:36:53 Zaubertrank systemd[1]: var-lib-systemd\x2dswap-swapfc-28.swap: Failed with result 'exit-code'.
Dez 27 01:36:53 Zaubertrank systemd[1]: Failed to activate swap Swap File.
Dez 27 01:36:53 Zaubertrank swapon[265560]: swapon: /var/lib/systemd-swap/swapfc/28: swapon fehlgeschlagen: Die Operation ist nicht erlaubt
translates to "swapon failed: the operation is not permitted"
from systemd-swap.
i've observed it the last couple days and the error still appears on swapfc-1.swap most of the times :/
from systemd-swap.
You could manually use the bash branch (4.3.x) for now (you should probably just be able to just replace /usr/bin/systemd-swap with the bash version), development has stalled on the python branch since I've stopped using it. I do plan on ramping up development come summer
from systemd-swap.
oh, i wasn't aware of the rewrite - i've downgraded to 4.3.3 and will keep you posted!
May i ask how you setup your swap now if you stopped using you script here? For me, it seems like the most elegant way i've found yet :)
from systemd-swap.
I only use zram so this is enough https://github.com/systemd/zram-generator
from systemd-swap.
Same issue observed here, with exactly the same swap chunk number. Log from both systemd units:
[ben@thoth arm-linux-gnueabihf-binutils]$ sudo journalctl -f -u systemd-swap
[sudo] password for ben:
-- Journal begins at Fri 2020-08-14 09:28:36 CEST. --
Feb 09 11:03:30 thoth systemd-swap[461]: INFO: Zswap: backup current configuration: complete
Feb 09 11:03:30 thoth systemd-swap[461]: INFO: Zswap: set new parameters: start
Feb 09 11:03:30 thoth systemd-swap[461]: INFO: Zswap: Enable: 1, Comp: zstd, Max pool %: 25, Zpool: z3fold
Feb 09 11:03:30 thoth systemd-swap[461]: INFO: Zswap: set new parameters: complete
Feb 09 11:03:30 thoth systemd-swap[461]: INFO: Writing destroy info...
Feb 09 11:03:30 thoth systemd-swap[461]: INFO: swapD: pick up devices from systemd-gpt-auto-generator
Feb 09 11:03:30 thoth systemd-swap[461]: INFO: swapD: searching swap devices
Feb 09 11:03:30 thoth systemd-swap[461]: INFO: swapFC: on-demand swap activation at >10329 MiB memory usage
Feb 09 11:03:30 thoth systemd[1]: Started Manage swap spaces on zram, files and partitions..
Feb 09 11:26:16 thoth systemd-swap[461]: INFO: swapFC: free ram: 34 < 35 - allocate chunk: 1
Feb 09 11:29:11 thoth systemd-swap[461]: INFO: swapFC: free swap: 13 < 15 - allocate chunk: 2
Feb 09 11:29:39 thoth systemd-swap[461]: INFO: swapFC: free swap: 13 < 15 - allocate chunk: 3
Feb 09 11:29:58 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 4
Feb 09 11:30:04 thoth systemd-swap[461]: INFO: swapFC: free swap: 8 < 15 - allocate chunk: 5
Feb 09 11:30:06 thoth systemd-swap[461]: INFO: swapFC: free swap: 11 < 15 - allocate chunk: 6
Feb 09 11:30:22 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 7
Feb 09 11:30:25 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 8
Feb 09 11:30:48 thoth systemd-swap[461]: INFO: swapFC: free swap: 13 < 15 - allocate chunk: 9
Feb 09 11:31:06 thoth systemd-swap[461]: INFO: swapFC: free swap: 9 < 15 - allocate chunk: 10
Feb 09 11:31:08 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 11
Feb 09 11:31:23 thoth systemd-swap[461]: INFO: swapFC: free swap: 11 < 15 - allocate chunk: 12
Feb 09 11:31:25 thoth systemd-swap[461]: INFO: swapFC: free swap: 11 < 15 - allocate chunk: 13
Feb 09 11:31:28 thoth systemd-swap[461]: INFO: swapFC: free swap: 13 < 15 - allocate chunk: 14
Feb 09 11:31:48 thoth systemd-swap[461]: INFO: swapFC: free swap: 13 < 15 - allocate chunk: 15
Feb 09 11:31:50 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 16
Feb 09 11:32:03 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 17
Feb 09 11:32:06 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 18
Feb 09 11:32:28 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 19
Feb 09 11:32:34 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 20
Feb 09 11:32:37 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 21
Feb 09 11:32:40 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 22
Feb 09 11:33:35 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 23
Feb 09 11:33:39 thoth systemd-swap[461]: INFO: swapFC: free swap: 13 < 15 - allocate chunk: 24
Feb 09 11:33:52 thoth systemd-swap[461]: INFO: swapFC: free swap: 13 < 15 - allocate chunk: 25
Feb 09 11:34:08 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 26
Feb 09 11:34:25 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 27
Feb 09 11:35:00 thoth systemd-swap[461]: INFO: swapFC: free swap: 14 < 15 - allocate chunk: 28
Feb 09 11:35:02 thoth systemd-swap[260592]: Job failed. See "journalctl -xe" for details.
Feb 09 11:35:02 thoth systemd-swap[461]: Traceback (most recent call last):
Feb 09 11:35:02 thoth systemd-swap[461]: File "/usr/bin/systemd-swap", line 904, in <module>
Feb 09 11:35:02 thoth systemd-swap[461]: main()
Feb 09 11:35:02 thoth systemd-swap[461]: File "/usr/bin/systemd-swap", line 892, in main
Feb 09 11:35:02 thoth systemd-swap[461]: start()
Feb 09 11:35:02 thoth systemd-swap[461]: File "/usr/bin/systemd-swap", line 734, in start
Feb 09 11:35:02 thoth systemd-swap[461]: swap_fc.run()
Feb 09 11:35:02 thoth systemd-swap[461]: File "/usr/bin/systemd-swap", line 237, in run
Feb 09 11:35:02 thoth systemd-swap[461]: self.create_swapfile(
Feb 09 11:35:02 thoth systemd-swap[461]: File "/usr/bin/systemd-swap", line 329, in create_swapfile
Feb 09 11:35:02 thoth systemd-swap[461]: subprocess.run(["systemctl", "start", unit_name], check=True)
Feb 09 11:35:02 thoth systemd-swap[461]: File "/usr/lib/python3.9/subprocess.py", line 524, in run
Feb 09 11:35:02 thoth systemd-swap[461]: raise CalledProcessError(retcode, process.args,
Feb 09 11:35:02 thoth systemd-swap[461]: subprocess.CalledProcessError: Command '['systemctl', 'start', 'var-lib-systemd\\x2dswap-swapfc-28.swap']' returned non-zero exit status 1.
Feb 09 11:35:02 thoth systemd[1]: systemd-swap.service: Main process exited, code=exited, status=1/FAILURE
Feb 09 11:35:02 thoth systemd[1]: systemd-swap.service: Failed with result 'exit-code'.
^C
[ben@thoth arm-linux-gnueabihf-binutils]$ sudo journalctl -u var-lib-systemd\\x2dswap-swapfc-28.swap
[sudo] password for ben:
-- Journal begins at Fri 2020-08-14 09:28:36 CEST, ends at Tue 2021-02-09 11:37:16 CET. --
Feb 08 17:04:47 thoth systemd[1]: Activating swap Swap File...
Feb 08 17:04:47 thoth swapon[1776984]: swapon: /var/lib/systemd-swap/swapfc/28: swapon failed: Operation not permitted
Feb 08 17:04:47 thoth systemd[1]: var-lib-systemd\x2dswap-swapfc-28.swap: Swap process exited, code=exited, status=255/EXCEPTION
Feb 08 17:04:47 thoth systemd[1]: var-lib-systemd\x2dswap-swapfc-28.swap: Failed with result 'exit-code'.
Feb 08 17:04:47 thoth systemd[1]: Failed to activate swap Swap File.
-- Boot d9d41bc175cb4199a5918b6445f2f9e1 --
Feb 09 11:35:02 thoth systemd[1]: Activating swap Swap File...
Feb 09 11:35:02 thoth swapon[260593]: swapon: /var/lib/systemd-swap/swapfc/28: swapon failed: Operation not permitted
Feb 09 11:35:02 thoth systemd[1]: var-lib-systemd\x2dswap-swapfc-28.swap: Swap process exited, code=exited, status=255/EXCEPTION
Feb 09 11:35:02 thoth systemd[1]: var-lib-systemd\x2dswap-swapfc-28.swap: Failed with result 'exit-code'.
Feb 09 11:35:02 thoth systemd[1]: Failed to activate swap Swap File.
In the log, it looks like the same swap chunk failed on a previous boot as well.
from systemd-swap.
There is a kernel limit for the amount of active swap files. Should be 32 and it seems like additional limitations imposed by some kernel configuration options can bring that down to 27 (https://unix.stackexchange.com/a/638358). That would explain why the exact number of swap files when it fails is 28. We should probably update the default settings accordingly.
from systemd-swap.
Related Issues (20)
- Parse error HOT 1
- Suggestion: update zram algo list in default config HOT 7
- TypeError HOT 1
- systemd-swap fails after install. HOT 11
- daemon notify TypeError on armbian HOT 2
- Inproper configurations can cause infinite loop
- swapfc_priority reaching negative values on long running systems
- Chrome-based browsers do not use swap HOT 1
- systemd-swap fails to start as service (exit code 203) HOT 3
- Recommendation for Swapfc defaults
- ModuleNotFoundError: No module named 'systemd'
- FileNotFoundError /run/systemd/system/var-lib-systemd\\x2dswap-swapfc-1.swap HOT 1
- Failed deactivating swap at shutdown HOT 1
- long boot times with zram_count=16 HOT 6
- subprocess.CalledProcessError: Command '['mkswap', '-L', 'SWAP_f2fs_1', '/var/lib/systemd-swap/swapfc/1']' returned non-zero exit HOT 1
- Cannot Create SwapFC on non-root Drive HOT 2
- Systemd-swap doesn't handle swap_fc path already existing on btrfs HOT 1
- ERRO: swapfc_path is located on an unknown filesystem
- Swapfc path in another partition(? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from systemd-swap.