Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swapfc path in another partition(? #212

Open
YudhaDev opened this issue Oct 17, 2022 · 1 comment
Open

Swapfc path in another partition(? #212

YudhaDev opened this issue Oct 17, 2022 · 1 comment

Comments

@YudhaDev
Copy link

YudhaDev commented Oct 17, 2022

before that, English is not my first language so please excuse any mistakes.

so today I try to change the path of swapfc into another directory that placed in a partition(ext4). and when I try to start the systemd service I got an error that mentioned PermissionError. I have no clue what to do next except using the default path for now. is it not posibble to do that?

OS: Manjaro 22.0.0 Kernel 5.15.41-1

Systemd status

× systemd-swap.service - Manage swap spaces on zram, files and partitions.
Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Mon 2022-10-17 08:57:56 WIB; 2s ago
Duration: 4min 36.809s
Process: 5694 ExecStart=/usr/bin/systemd-swap start (code=exited, status=1/FAILURE)
Main PID: 5694 (code=exited, status=1/FAILURE)
Status: "Allocating swap file..."
CPU: 197ms

Okt 17 08:57:56 xndrive-linux systemd-swap[5694]: File "/usr/bin/systemd-swap", line 203, in init
Okt 17 08:57:56 xndrive-linux systemd-swap[5694]: self.create_swapfile("swapFC: allocate chunk: ")
Okt 17 08:57:56 xndrive-linux systemd-swap[5694]: File "/usr/bin/systemd-swap", line 311, in create_swapfile
Okt 17 08:57:56 xndrive-linux systemd-swap[5694]: swapfile = self.prepare_swapfile(
Okt 17 08:57:56 xndrive-linux systemd-swap[5694]: File "/usr/bin/systemd-swap", line 359, in prepare_swapfile
Okt 17 08:57:56 xndrive-linux systemd-swap[5694]: os.mknod(path)
Okt 17 08:57:56 xndrive-linux systemd-swap[5694]: PermissionError: [Errno 13] Permission denied
Okt 17 08:57:56 xndrive-linux systemd[1]: systemd-swap.service: Main process exited, code=exited, status=1/FAILURE
Okt 17 08:57:56 xndrive-linux systemd[1]: systemd-swap.service: Failed with result 'exit-code'.
Okt 17 08:57:56 xndrive-linux systemd[1]: Failed to start Manage swap spaces on zram, files and partitions..

This is my configuration

zswap_enabled=1
zswap_compressor=zstd
zswap_max_pool_percent=25
zswap_zpool=z3fold

swapfc_enabled=1
#swapfc_force_use_loop=0
swapfc_frequency=1
swapfc_chunk_size=512M
#swapfc_max_count=32
swapfc_min_count=1
swapfc_free_ram_perc=35
swapfc_free_swap_perc=15
swapfc_remove_free_swap_perc=55
swapfc_priority=50
#swapfc_path=/var/lib/systemd-swap/swapfc/
swapfc_path=/mnt/ForSwap/
#swapfc_nocow=1
#swapfc_directio=1
#swapfc_force_preallocated=0

@heysion
Copy link

heysion commented Apr 18, 2024

Your issue are python os.mknod trouble , This trouble is your filesystem /mnt/ForSwap can not wirte by systemd .

You can check /mnt/ForSwap directory with ls -alh /mnt/ForSwap and getfacl /mnt/ForSwap command .

Or not you can change your path that path can wirte by systemd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants