Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

BTRFS formatted SD card not compressing, but working when I move the files off the sdcard then back on. #8

Open
wearenosotros opened this issue Jul 9, 2022 · 5 comments

Comments

@wearenosotros
Copy link

wearenosotros commented Jul 9, 2022

Hello,

I used your awesome scripts to format my sd card to btrfs. Everything seemingly was working fine but after installing a bunch of games onto the SD card, I noticed not much saving.

Long story short, I installed compsize ( https://github.com/kilobyte/compsize ) to check out how much compression I was getting. When I ran it against my steamapps/common folder on my sdcard, it was reporting next to no compression. I checked mount and it was indeed set to ztsd=15. Thinking maybe I just got really unlucky, and the games I chose just didn't compress well, I moved the files off the sd card and then moved them back on for the compression to "try again" and low and behold, it did.

You can see the whole process happening in my terminal below:
allinone

First compsize command is run pre mv, then I mv Subnautica to /home, then back to the sdcard and re run compsize, resulting in a pretty massive 3GB savings.

So, it would appear when I install new games from Steam, the compression DOESN'T kick on. Odd right? I've tried this with other games that weren't showing compression and had similar results. Just getting this in front of you in case you have any insight.

EDIT: I found the following command will force the compression without moving the files off and then back on the partition:

sudo btrfs filesystem defragment -rvf -czstd [folder of game you want to compress]

@wearenosotros
Copy link
Author

Interestingly enough, installing games from Epic via Heroic Launcher DOES properly compress on install. Steam is doing something that somehow bypasses compression when it's installing.

@Trevo525
Copy link
Owner

Trevo525 commented Aug 4, 2022

I believe that I saw elsewhere that the way steam downloads the games would block the compression. I can't seem to find it, it was something along the lines of Steam reserves the space, then downloads the files, overwriting the reserved space. How the other launchers would probably do it is the same thing, but in a temp folder, then move the file to the game folder. If this is the case, I guess your testing would make sense. Thanks for bringing it up by the way. 😊

I will hopefully find some time to do some testing myself. In the meantime, if you (or anybody else) have done more testing please share here. If given enough info to make an educated decision, I'd love to optimize this repo more. Maybe the best option is to leave it the same but run the defragment and deduplicate commands when your card begins to fill up.

@MinhQNguyen86
Copy link

@wearenosotros Could you list the steps for installing compsize on your steam deck? Thanks :)

@pickledish
Copy link

@NotMinh you'll want to follow the instructions here (note the top comment):

https://www.reddit.com/r/SteamDeck/comments/t8al0i/install_arch_packages_on_your_steam_deck/

Then you can just sudo pacman -S compsize

@pickledish
Copy link

(FWIW Trevo I find myself in this thread having the same problem as the OP, but haven't done any further testing yet than they have so far!)

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

No branches or pull requests

4 participants