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

RWFus failing to mount on brand new SteamOS Install #12

Closed
NiHaiden opened this issue Aug 31, 2022 · 13 comments
Closed

RWFus failing to mount on brand new SteamOS Install #12

NiHaiden opened this issue Aug 31, 2022 · 13 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@NiHaiden
Copy link

Hi there, I have a little issue 😅.

I followed the steps on your GitHub Readme to install RWFus on my brand new SteamOS install (SteamOS 3.3.1). But everytime (done multiple reinstalls) the mount systemd targets fail to mount because of a bad option in the mount command. Since I'm a Linux novice and not sure what I should do here I am asking you directly if you know anything.

Screenshot_20220831_135209

Screenshot_20220831_135243

Screenshot_20220831_135305

@ValShaped
Copy link
Owner

I've been trying to reproduce this problem for a while now! Thanks for letting me know it happens on a fresh install. I'll do a fresh install on my Deck and get back to you as soon as I can!

@ValShaped
Copy link
Owner

ValShaped commented Sep 6, 2022

I spent a good 12 hours troubleshooting this, and as it turns out, there's a major difference between how Valve formats the Deck at the factory, and a Deck that's been "recovered" using Valve's so-called recovery image.

Sometime between then and now, Valve started formatting the home partition with -O casefold, and overlayFS will always fail when that option is enabled. This is never stated in any documentation AT ALL, ANYWHERE.

There are a few options from this point:

  1. Boot into a linux image that has a nightly build of tune2fs, and then use that to disable casefolding
  2. Resize nvme0n1p8 (/home) to provide more space for Rwfus, and then create a new partition to store Rwfus stuff in
  3. Repartition your Deck to use a filesystem which overlayfs supports (ext4, btrfs, ...), without casefolding enabled

As for me, I'm going to err on the side of caution, and test if casefolding is enabled on the target filesystem before proceeding, for now. It may be possible to fix this problem in a shell script, but I can't guarantee it'll work, and it has the potential to bork the deck bad enough to require reimaging with the recovery image. Rwfus was never meant to be anywhere near that invasive.

@ValShaped ValShaped added the bug Something isn't working label Sep 6, 2022
@ValShaped
Copy link
Owner

ValShaped commented Sep 10, 2022

Here's my plan for solving this issue:

  1. Create a large, empty file
  2. Format the file with mkfs.[ext4|btrfs], without case-folding
  3. Bind-mount the file somewhere (maybe in a subdirectory of /opt?)
  4. Create the overlays as usual

TODO: How large should the file be?

@NightHammer1000
Copy link

Disabling Casefold is greatly discuraged if you work with Windows Applications.
Especially on the Steam Deck.
Games WILL break with it off.

@ValShaped
Copy link
Owner

ValShaped commented Sep 18, 2022

Disabling Casefold is greatly discuraged if you work with Windows Applications. Especially on the Steam Deck. Games WILL break with it off.

Wine/Proton implements user-space casefolding, which will kick in if native casefolding is not available. It's just slower than the filesystem driver implementation. If you haven't reimaged your Deck, your home partition will have ext4 casefolding disabled. You'll know this is the case if Rwfus works for you. Windows games still work, falling back to Wine/Proton's casefolding implementation.

@NightHammer1000
Copy link

I had multiple games failing while loading dlls with diffrent names in the Hardcoding than they have in the Folder.

Wines Casefolding is not a catch all.
Just as a Information. In case people wonder why their stuff is not working.

@ValShaped
Copy link
Owner

ValShaped commented Nov 6, 2022

This should be fixed on dev branch as of this morning. I've instituted a workaround, creating a 4GB (sparse, it doesn't actually take up 4GB even if it says it does) disk image w/ btrfs on it, and storing all the upper and workdirs in that. Hopefully, that doesn't have any weird gotchas.

@dodfsk
Copy link

dodfsk commented Nov 9, 2022

This should be fixed on dev branch as of this morning. I've instituted a workaround, creating a 4GB (sparse, it doesn't actually take up 4GB even if it says it does) disk image w/ btrfs on it, and storing all the upper and workdirs in that. Hopefully, that doesn't have any weird gotchas.

It is useful,but it only 4GB can be used?

@ValShaped
Copy link
Owner

4GB at the moment, yeah. I should probably add that to the config file, but I chose 4GB because it's ~4x the size of the largest Rwfus directories I found when asking around on the Steam Deck Homebrew discord.
The size doesn't matter in my testing. With compression enabled, mine is 56MB, down from 480MB
I think I'll double it for the main release, and add some way to grow the maximum size of the disk.

@ValShaped ValShaped mentioned this issue Nov 10, 2022
@ValShaped
Copy link
Owner

ValShaped commented Nov 13, 2022

Rwfus 0.4.0 defaults to 8GB, and the size can be increased by editing /etc/opt/rwfus.conf and uncommenting the Disk_Image_Size line. It takes any size you can pass to truncate -s (because that's what ends up happening.)
Some examples: 8G, 8192M, 8388608K

Once the config file has been edited, run rwfus --update to apply the new config.

@dodfsk
Copy link

dodfsk commented Nov 13, 2022

Rwfus 0.4.0 defaults to 8GB, and the size can be increased by editing /etc/opt/rwfus.conf and uncommenting the Disk_Image_Size line. It takes any size you can pass to truncate -s (because that's what ends up happening.) Some examples: 8G, 8192M, 8388608K

Once the config file has been edited, run rwfus --update to apply the new config.

It's perfect!

(deck@dodfsk rwfus)$ sudo systemctl status rwfusd.service
● rwfusd.service - Rwfus: Carry Pacman across SteamOS updates!
     Loaded: loaded (/etc/systemd/system/rwfusd.service; enabled; vendor preset: disabled)
     Active: active (exited) since Mon 2022-11-14 02:22:35 CST; 8s ago
    Process: 21030 ExecStart=/opt/rwfus/service/rwfusd.sh --start (code=exited, status=0/SUCCESS)
   Main PID: 21030 (code=exited, status=0/SUCCESS)
        CPU: 69ms

11 14 02:22:35 dodfsk rwfusd.sh[21030]: Creating overlay (/opt/rwfus/mount/upper/etc-pacman.d, /opt/rwfus/mount/work/etc-pacman.d) on /etc/pacman.d
11 14 02:22:35 dodfsk rwfusd.sh[21057]: mount: overlay mounted on /etc/pacman.d.
11 14 02:22:35 dodfsk rwfusd.sh[21030]: Successfully overlaid /opt/rwfus/mount/upper/etc-pacman.d on /etc/pacman.d
11 14 02:22:35 dodfsk rwfusd.sh[21030]: Creating overlay (/opt/rwfus/mount/upper/var-lib-pacman, /opt/rwfus/mount/work/var-lib-pacman) on /var/lib/pacman
11 14 02:22:35 dodfsk rwfusd.sh[21059]: mount: overlay mounted on /var/lib/pacman.
11 14 02:22:35 dodfsk rwfusd.sh[21030]: Successfully overlaid /opt/rwfus/mount/upper/var-lib-pacman on /var/lib/pacman
11 14 02:22:35 dodfsk rwfusd.sh[21030]: Creating overlay (/opt/rwfus/mount/upper/var-cache-pacman, /opt/rwfus/mount/work/var-cache-pacman) on /var/cache/>
11月 14 02:22:35 dodfsk rwfusd.sh[21061]: mount: overlay mounted on /var/cache/pacman.
11月 14 02:22:35 dodfsk rwfusd.sh[21030]: Successfully overlaid /opt/rwfus/mount/upper/var-cache-pacman on /var/cache/pacman
11月 14 02:22:35 dodfsk systemd[1]: Finished Rwfus: Carry Pacman across SteamOS updates!.
lines 1-17/17 (END)

(148)(deck@dodfsk rwfus)$ ./rwfus --status
● rwfusd.service - Rwfus: Carry Pacman across SteamOS updates!
     Loaded: loaded (/etc/systemd/system/rwfusd.service; enabled; vendor preset: disabled)
     Active: active (exited) since Mon 2022-11-14 02:22:35 CST; 5min ago
    Process: 21030 ExecStart=/opt/rwfus/service/rwfusd.sh --start (code=exited, status=0/SUCCESS)
   Main PID: 21030 (code=exited, status=0/SUCCESS)
        CPU: 69ms

Label: 'Rwfus'  uuid: 85b9fe8e-b211-4c41-b717-b321bf4be428
        Total devices 1 FS bytes used 115.52MiB
        devid    1 size 8.00GiB used 428.00MiB path /opt/rwfus/rwfus.btrfs

@dodfsk
Copy link

dodfsk commented Nov 15, 2022

Rwfus 0.4.0 defaults to 8GB, and the size can be increased by editing /etc/opt/rwfus.conf and uncommenting the Disk_Image_Size line. It takes any size you can pass to truncate -s (because that's what ends up happening.) Some examples: 8G, 8192M, 8388608K

Once the config file has been edited, run rwfus --update to apply the new config.

Hey!there is a issue.When I reboot steamos, /var/cache/pacman will fail to mount with wrong fs type.
This directory is from /home/.steamos/offload/var/cache.
So i remove this path from /etc/opt/rwfus.conf.
Then I reboot system and the service can be loaded correctly.
Now,I add /var/cache/pacman path into config,it works.
But after rebooting the system, it will print an error with mount /var/cache/pacman wrong fs type .
cycle like this

of course,/usr /etc/pacman.d /var/lib/pacman,these three directories are enough

@ValShaped
Copy link
Owner

Ah! Knew something from steamos-offload would kick me in the butt. Seems overlayfs won't even accept a case-folding lowerdir. Shame on it, but I suppose that makes some sense. I'll have a fix soon, hopefully. My ideal is to have all the pacman state stored inside Rwfus, so when you wipe Rwfus or use the backup/restore functionality it's actually gone. Thanks for testing it out!

ValShaped added a commit that referenced this issue Nov 24, 2022
- Actually loads config files now.
    - How did I miss that?
- Actually stores config files now.
    - Loaded config options are marked CF_REQUIRE
    - CF_REQUIREd config options are uncommented
    - This is kinda jank, but it's bash. Jank happens.
- Config file specifies which systemd units to enable, disable, and mask now
    - This fixes #12
- Rwfusd now aborts and unmounts if it can't successfully mount_all
    - This should hopefully make it less painful to work with in the event of a catastrophic failure.
- Preparations have begun for porting parts of the script to a better language
    - I hope I can actually do that sometime. Bash is syntactic-sugar-coated hell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants