this post was submitted on 13 Sep 2023
82 points (91.8% liked)

Steam Deck

14781 readers
311 users here now

A place to discuss and support all things Steam Deck.

Replacement for r/steamdeck_linux.

As Lemmy doesn't have flairs yet, you can use these prefixes to indicate what type of post you have made, eg:
[Flair] My post title

The following is a list of suggested flairs:
[Discussion] - General discussion.
[Help] - A request for help or support.
[News] - News about the deck.
[PSA] - Sharing important information.
[Game] - News / info about a game on the deck.
[Update] - An update to a previous post.
[Meta] - Discussion about this community.

Some more Steam Deck specific flairs:
[Boot Screen] - Custom boot screens/videos.
[Selling] - If you are selling your deck.

These are not enforced, but they are encouraged.

Rules:

Link to our Matrix Space

founded 3 years ago
MODERATORS
 

Btrfs is a filesystem (like FAT, NTFS, and ext4), but has some distinct advantages:

  • Increased storage - thanks to compression and file deduplication, Btrfs can save you considerable amounts of storage. I have 517G of files on my Deck's SSD, but it only uses up 410G of storage to hold those files. Compressing your filesystem can also shorten load times, especially for slower memory devices like the SD card.

  • Snapshotting - save snapshots of the file system and easily roll back if there's a problem.

Converting to Btrfs is easy to do, and doesn't require having you to resetup/reconfigure your deck. The linked gitlab project will do the conversion, keep all your existing files and settings, and set all the Btrfs configurations for you. The file conversion will persist through updates, and it will setup automatic deduplication of files on the drive. It also allows the Deck to automatically mount Btrfs converted SD cards, and to format new cards in the same format.

Only potential downside I know of is that Btrfs is case sensitive, where the default ext4 on the Deck uses casefolding. Basically this means that Btrfs will treat File.txt and file.txt as two different files. I've never run into any issues with this, but I've heard it can cause issues with some specific mods that inconsistently capitalize their files. There's also always some risk whenever you make dramatic changes to your filesystem, but I haven't really heard of anyone having problems with this. You do have to make sure you have at least 10-20% of your storage free (and a min of 10-20GB free for smaller drives) to make sure it has room for the conversion.

Overall I've been using Btrfs for over 6+ months on my deck, and it's been great. I highly recommend it. I'm not an expert on it, but I'll do my best to answer any questions on it.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 13 points 1 year ago* (last edited 1 year ago) (1 children)

I noticed this guide recommends compress-force=zstd, which sets the ZSTD compression to level 3. There's a BTRFS benchmark and ZFS benchmark of the ZSTD levels which can give a rough idea of how ZSTD performs for transparent filesystem compression. Note that almost all of ZSTD's compression gains happen starting at level 1, and levels after that have very minor improvements.

Also keep in mind that ZSTD levels only affect how long it takes to write new data to the filesystem. ZSTD is somewhat unique as a compression algorithm in that as you increase compression effort, the decompression effort stays the same. You could compress everything with level 15 and it will decompress just as fast as level 1 (~generally). Setting higher ZSTD levels could arguably make more sense for a gaming drive because the data is usually write-once, read-many. I don't know at what level the Steam Deck CPU will start limiting your I/O though.

BTRFS compression is enabled per-file, so you can change ZSTD levels at any time and old data will still be compressed with your previous algorithm. To recompress using a new level, change your /etc/fstab/ ZSTD level and remount the partition, then run a defrag to poke the data into recompression.

[–] [email protected] 4 points 1 year ago (1 children)

Here's one sharp edge: defrag will unshare file contents so sometimes it's not just feasible to do it.

[–] [email protected] 3 points 1 year ago (1 children)

Run duperemove on the partition after defragging to get those reflinks back. Duperemove is usually a good idea anyway unless you're running on a HDD - reflinks are almost identical to fragmentation in nature so you might prefer to have less fragmentation on a mechanical drive instead of easy de-duping.

[–] [email protected] 1 points 1 year ago (1 children)

If you can do that, you already had enough space for reflinking not to matter in the first place, right? Or you can carefully do defragmenting in parts, running dupremove incrementally? seems like a lot of wasted time :).

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Free storage is free storage, and storage is at a premium on the Steam Deck - I would gladly trade time for storage, considering that time passes regardless. This defrag scenario would only happen if you want to change ZSTD levels, so if you pick your level at the start, copy your data on, then run duperemove you'll save the most space possible without needing to defrag. Deduplication is probably the difference between being able to fit 1-2 more games on your Steam Deck - Wine prefixes are prime targets for deduplication.