Trying to set a custom path for the swapfc_path to a different drive but when restarting systemd-swap shows a permission denied error to a folder I named swap.
running $systemctl status systemd-swap shows
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 Fri 2022-04-15 15:22:51 PST; 6s ago
Process: 7456 ExecStart=/usr/bin/systemd-swap start (code=exited, status=1/FAILURE)
Main PID: 7456 (code=exited, status=1/FAILURE)
Status: "Monitoring memory status..."
CPU: 395ms
Apr 15 15:22:51 PZ0-ASUSTufGaming-FX505DT-HN657T systemd-swap[7456]: File "/usr/bin/systemd-swap", line 179, in __init__
Apr 15 15:22:51 PZ0-ASUSTufGaming-FX505DT-HN657T systemd-swap[7456]: makedirs(self.swapfc_path)
Apr 15 15:22:51 PZ0-ASUSTufGaming-FX505DT-HN657T systemd-swap[7456]: File "/usr/bin/systemd-swap", line 539, in makedirs
Apr 15 15:22:51 PZ0-ASUSTufGaming-FX505DT-HN657T systemd-swap[7456]: os.makedirs(path, exist_ok=True)
Apr 15 15:22:51 PZ0-ASUSTufGaming-FX505DT-HN657T systemd-swap[7456]: File "/usr/lib/python3.10/os.py", line 225, in makedirs
Apr 15 15:22:51 PZ0-ASUSTufGaming-FX505DT-HN657T systemd-swap[7456]: mkdir(name, mode)
Apr 15 15:22:51 PZ0-ASUSTufGaming-FX505DT-HN657T systemd-swap[7456]: PermissionError: [Errno 13] Permission denied: '/home/user/swap'
Apr 15 15:22:51 PZ0-ASUSTufGaming-FX505DT-HN657T systemd[1]: systemd-swap.service: Main process exited, code=exited, status=1/FAILURE
Apr 15 15:22:51 PZ0-ASUSTufGaming-FX505DT-HN657T systemd[1]: systemd-swap.service: Failed with result 'exit-code'.
Apr 15 15:22:51 PZ0-ASUSTufGaming-FX505DT-HN657T systemd[1]: Failed to start Manage swap spaces on zram, files and partitions..
So far, I’ve tried chown the swap folder to root or 777 but I still get the error.
Here’s my swap.conf for reference in case it’s needed:
Also, is there a limit to the swapfc_chunk_size? I was thinking of increasing it to 4096M since the game XCOM2 WotC modded triggers oom and causes the game to close down at certain parts due to memory leaks or unoptimized code.
Just thought of this, I don’t know if I’m right or not. But IIRC it’s not just simply changing a path. There is a whole procedure to do it, and I don’t know it. Best would be to look here: