CryoByte33 / steam-deck-utilities

A utility to improve performance and help manage storage on Steam Deck.
GNU General Public License v3.0
3.24k stars 80 forks source link

Swap operations fail when using CLI #163

Open LukeShortCloud opened 1 year ago

LukeShortCloud commented 1 year ago

Trying to run commands such as

$ sudo -E ~/.cryo_utilities/cryo_utilities swap 17

and

$ sudo -E ~/.cryo_utilities/cryo_utilities swappiness 2

fail. This might be related to the fact that running the command with sudo does not work and requires sudo -E which has variables from the deck user. Refer to: https://github.com/CryoByte33/steam-deck-utilities/issues/124

I ran an strace to get more debug logging for the first command. I found that this is the dd command that it tries to run for the swap resize. Notice that the of= is blank. It should be of=/home/swapfile.

$ sudo -E strace -vfs 512 -o /tmp/strace.k ~/.cryo_utilities/cryo_utilities swap 17
$ sudo vim /tmp/strace.k
5849  execve("/usr/bin/dd", ["dd", "if=/dev/zero", "of=", "bs=1G", "count=17", "status=progress"], ["LANG=en_US.UTF-8", "TERM=xterm-256color", "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/home/deck/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl", "MAIL=/var/mail/root", "LOGNAME=root", "USER=root", "HOME=/root", "SHELL=/bin/bash", "SUDO_COMMAND=/usr/bin/dd if=/dev/zero of= bs=1G count=17 status=progress", "SUDO_USER=root", "SUDO_UID=0", "SUDO_GID=0"]) = 0

Tested on SteamOS 3.4.11 with CryoUtilities 2.2.0.

CryoByte33 commented 1 year ago

Very interesting, thank you for the report! Are you using a Steam Deck running SteamOS, and if so have you used the BTRFS script?

LukeShortCloud commented 1 year ago

And thank you for the response!

Yes, I am on the Steam Deck with SteamOS.

No, I have not converted my ext4 partitions to Btrfs. I know there are a few projects to do that and I have never downloaded or used any before.