{"id":13716051,"url":"https://gitlab.com/popsulfr/steamos-btrfs","last_synced_at":"2025-05-07T05:32:06.594Z","repository":{"id":50044185,"uuid":"34501791","full_name":"popsulfr/steamos-btrfs","owner":"popsulfr","description":"Inject a payload into SteamOS 3 to convert the /home partition from ext4 to btrfs.\r\nAlso allows mounting btrfs formatted sd cards and forces new sd card formats to btrfs or a user configured filesystem.","archived":false,"fork":false,"pushed_at":null,"size":null,"stargazers_count":89,"open_issues_count":26,"forks_count":9,"subscribers_count":null,"default_branch":"main","last_synced_at":"2024-11-14T04:34:35.587Z","etag":null,"topics":["Steam Deck","SteamOS","btrfs","valve"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0+","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://gitlab.com/uploads/-/system/project/avatar/34501791/steamos-btrfs-logo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-15T10:31:37.074Z","updated_at":"2024-11-03T18:44:56.620Z","dependencies_parsed_at":"2022-08-20T12:51:06.335Z","dependency_job_id":null,"html_url":"https://gitlab.com/popsulfr/steamos-btrfs","commit_stats":null,"previous_names":[],"tags_count":8,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/popsulfr%2Fsteamos-btrfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/popsulfr%2Fsteamos-btrfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/popsulfr%2Fsteamos-btrfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/popsulfr%2Fsteamos-btrfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners/popsulfr","download_url":"https://gitlab.com/popsulfr/steamos-btrfs/-/archive/main/steamos-btrfs-main.zip","host":{"name":"gitlab.com","url":"https://gitlab.com","kind":"gitlab","repositories_count":4518898,"owners_count":6976,"icon_url":"https://github.com/gitlab.png","version":null,"created_at":"2022-05-30T11:31:42.605Z","updated_at":"2024-07-18T11:24:13.055Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners"}},"keywords":["Steam Deck","SteamOS","btrfs","valve"],"created_at":"2024-08-03T00:01:06.567Z","updated_at":"2025-05-07T05:32:06.574Z","avatar_url":"https://gitlab.com/uploads/-/system/project/avatar/34501791/steamos-btrfs-logo.png","language":null,"funding_links":[],"categories":["Software"],"sub_categories":[],"readme":"# SteamOS 3/Steam Deck Btrfs converter \u003cimg align=\"right\" height=\"32\" src=\"data/steamos-btrfs-logo.svg\"\u003e\n\nThis injector will install the necessary payload to keep a btrfs formatted /home even through system updates. You may also choose to only install the support for formatting and mounting of multiple filesystems for the SD cards.\nIt will allow to mount btrfs, f2fs, ext4, fat, exfat and ntfs formatted SD cards and will also force new SD cards to be formatted as btrfs by default or a user configured filesystem.\n\nBtrfs with its transparent compression and deduplication capabilities can achieve impressive storage gains but also improve loading times because of less data being read. It also supports instant snapshotting which is very useful to roll back to a previous state.\n\n**WARNING!!!! If you decide to so, it will install a service that will attempt on the next boot to convert the ext4 /home partition into btrfs and depending on the already used storage this operation may fail or take a long time!**\n\n**Make sure you have at least 10-20% free space available before attempting the conversion (`df -h /home` 80-90% use with at least 10-20 GiB available space)**\n\n**There's also the option to freshly format the /home partition instead of converting it. An attempt to backup the data will be made if the memory allows for it but expect data loss!**\n\n- https://wiki.archlinux.org/title/Btrfs\n- https://wiki.archlinux.org/title/F2FS\n\n## Features\n\n- Btrfs /home conversion from ext4 (optional)\n- Btrfs /home formatting without conversion with minimal backup if possible (optional)\n- Btrfs, f2fs, ext4, fat, exfat, ntfs formatted SD card support\n- Btrfs, f2fs, ext4, fat, exfat, ntfs formating of SD card\n- Progress dialog and logging during the home conversion!\n- Rollback attempt in case of errors after conversion or mounting\n- Install additional pacman packages into the rootfs automatically and persist through updates\n- **Survives updates and branch changes!**\n- Steam's `downloading` and `temp` folders as subvolumes with COW disabled\n- Update check\n- Non-linux filesystems (fat, exfat, ntfs) can have their `compatdata` folder bind mounted from the internal storage for proton support if `STEAMOS_BTRFS_SDCARD_COMPATDATA_BIND_MOUNT` is set (and don't forget that with fat you are restricted to a maximum of 4GB per file!)\n\n![Btrfs /home conversion progress dialog](data/steamos-btrfs-conversion.webp \"Btrfs /home conversion progress dialog\")\n\n## Install\n\n### Desktop installer\n\n**Switch into Desktop mode**\n\n**You can download the following easy to use .desktop installer:**\n\n[![Download installer](data/download-installer.png \"Download installer\")](https://gitlab.com/popsulfr/steamos-btrfs/-/raw/main/files/usr/share/applications/steamos-btrfs.desktop?inline=false)\n\n**CAUTION**: there's not an easy way back if you proceed! Once the /home partition is converted, you can not go back to ext4 and keep your files.\nThe original files that have been changed are backed up with the `.orig` extension. Keep in mind that they are specifically changed to allow for a btrfs `/home`.\nIt is safe to revert to the original files if the btrfs conversion was not attempted.\nA rollback will be attempted if the conversion fails but in the worst case the `/home` partition may need to be reformatted.\n\n**Please make sure you have enough free space before attempting the conversion. At least 10-20GiB and/or 10-20% free space should usually be fine.**\n\n**If you wish to freshly format your `/home` partition instead, make sure to modify the `STEAMOS_BTRFS_HOME_FORMAT` option in the [Configuration options](#configuration-options) before starting the installer or just before rebooting.**\n\n**Double-click the downloaded file**\n\n![Double-click the downloaded file](data/Screenshot_20221104_064629.png \"Double-click the downloaded file\")\n\n**Execute the .desktop file**\n\n![Execute](data/Screenshot_20221104_064706.png \"Execute\")\n\n**Press Continue to execute and follow the instructions.**\n\n**If no password has been set, you will be prompted for a new one.** \n\n![Continue](data/Screenshot_20221104_064721.png \"Continue\")\n\n### CLI Installer\n\n#### Configuration\n\nBefore the installation you may want to modify the [Configuration options](#configuration-options)\n* If it's a first time installation, edit `./files/etc/default/steamos-btrfs`.\n* Otherwise edit `/etc/default/steamos-btrfs` as it will take precedence over the local one.\n* You can also supply [command line arguments or environment variables](#command-line-arguments) to the installer\n\n#### CLI Install\n\n```sh\nt=\"$(mktemp -d)\"\ncurl -sSL https://gitlab.com/popsulfr/steamos-btrfs/-/archive/main/steamos-btrfs-main.tar.gz | tar -xzf - -C \"$t\" --strip-components=1\n\"$t/install.sh\"\nrm -rf \"$t\"\n```\n\nOnce the payload is installed you can also restart the installer from the rootfs:\n\n```sh\n/usr/share/steamos-btrfs/install.sh\n```\n\n#### Command line arguments\n\n```\nSteamOS Btrfs\nVersion: 1.0.0.20221104\nUsage: '/usr/share/steamos-btrfs/install.sh' [OPTION]... [rootfs dev]...\nExample: '/usr/share/steamos-btrfs/install.sh' --nogui /dev/disk/by-partsets/self/rootfs\n\n  --help                 show help\n  --noninteractive       run in noninteractive mode\n                         apply options from config files, env vars or defaults\n                         (env var: 'NONINTERACTIVE')\n                         (default: 0)\n  --nogui                run without gui prompts, force text prompts\n                         (env var: 'NOGUI')\n                         (default: 0)\n  --noautoupdate         disable automatic fetching of the latest script version when updating the system, changing channels or on version check\n                         (env var: 'NOAUTOUPDATE')\n                         (file flag: '/usr/share/steamos-btrfs/disableautoupdate')\n                         (default: 0)\n  --noconverthome        disable home conversion\n                         (env var: 'NOCONVERTHOME')\n                         (file flag: '/usr/share/steamos-btrfs/disableconverthome')\n                         (default: 0)\n  --customprompt PATH    set path to a custom prompt script or executable\n                         First argument supplied is the title, second argument the message to display, third argument label for yes, fourth argument label for no, fifth argument label for cancel\n                         Env var 'EPROMPT_VALUE_DEFAULT' holds the default value\n                         Should return 0 if OK, 1 if not, 2 if cancelled\n                         (env var: 'CUSTOMPROMPT')\n                         (default: '')\n\nExpert config options:\n  --STEAMOS_BTRFS_HOME_MOUNT_OPTS OPTS             set the /home mount options to use\n                                                   (env var: 'STEAMOS_BTRFS_HOME_MOUNT_OPTS')\n                                                   (default: 'defaults,nofail,x-systemd.growfs,noatime,lazytime,compress-force=zstd,space_cache=v2,autodefrag,nodiscard')\n  --STEAMOS_BTRFS_HOME_MOUNT_SUBVOL SUBVOL         set the /home subvolume name to use\n                                                   (env var: 'STEAMOS_BTRFS_HOME_MOUNT_SUBVOL')\n                                                   (default: '@')\n  --STEAMOS_BTRFS_ROOTFS_PACMAN_EXTRA_PKGS PKGS    set the extra pacman packages to install\n                                                   (env var: 'STEAMOS_BTRFS_ROOTFS_PACMAN_EXTRA_PKGS')\n                                                   (default: '')\n\nYou can specify multiple 'rootfs dev's or none and it will default to '/dev/disk/by-partsets/self/rootfs'.\nOrder of priority from highest to lowest for options is: command line flags, env vars, config files ('/usr/share/steamos-btrfs/files/etc/default/steamos-btrfs', '/usr/share/steamos-btrfs/files/etc/default/steamos-btrfs', '/etc/default/steamos-btrfs'), flag files ('/usr/share/steamos-btrfs/disableconverthome', '/usr/share/steamos-btrfs/disableautoupdate').\n\nA log file will be created at '/var/log/steamos-btrfs.log'.\n```\n\n## Remaining issues and troubleshooting\n\nAt this point the installer should be relatively mature and robust.\nOnce the payload is installed and the conversion was greenlit by the user, on the next boot the Steam Deck will use tmpfs as /home and attempt the btrfs conversion on the real partition.\nOnce it reboots it should all be working fine and the /home partition converted.\nThis configuration has been confirmed by me and others to survive through updates.\n\nA log file is created at `/var/log/steamos-btrfs.log` containing the installation and the home conversion log to review the process or help with bug reports.\n\nIf the conversion of the home partition fails for any reason, the service will do its best to restore the original ext4 mount and hard mask the systemd conversion service to prevent a conversion boot loop.\n\nPlease submit the log file at `/var/log/steamos-btrfs.log` as new issue if that happens to you.\n\nYou'll need to explicitely unmask the service yourself if you want to attempt the conversion again:\n```sh\nsudo systemctl unmask steamos-convert-home-to-btrfs.service\n```\nor\n```sh\nsudo rm /etc/systemd/system/steamos-convert-home-to-btrfs.service\n```\n\n**Disclaimer about mounting fat, exfat, ntfs filesystems if `STEAMOS_BTRFS_SDCARD_COMPATDATA_BIND_MOUNT` is set: the eject functionality in the Steam client will not work because the `compatdata` folder is bind mounted from the internal storage. To unmount the SD card manually execute:**\n\n```sh\nsudo systemctl stop sdcard-mount@mmcblk0p1.service\n```\n\nAlternatively you can disable bind mounting the `compatdata/` folder by setting `STEAMOS_BTRFS_SDCARD_COMPATDATA_BIND_MOUNT` to `0` in the [Configuration options](#configuration-options).\nThis will prevent proton games from working.\n\n## Updating or changing config options\n\nAt any time you can rerun the installer and let it download the latest version and go through the installation again to enable the latest changes or simply apply changed settings (`/usr/share/steamos-btrfs/install.sh`).\nDisabling the home conversion won't have any effect on an already converted home partition.\n\nAt times updates may change the default config options and you may want to merge the changes with your own: [Configuration options](#configuration-options)\n\nIf you don't want to be prompted while running the script you can set the `NONINTERACTIVE=1` environment variable:\n```sh\nsudo NONINTERACTIVE=1 /usr/share/steamos-btrfs/install.sh\n```\nor as command line argument:\n```sh\nsudo /usr/share/steamos-btrfs/install.sh --noninteractive\n```\n\nYou may force off the gui prompts with `NOGUI=1` or `--nogui`, it should otherwise detect if a desktop environment is running and fallback to text prompts\n```sh\nNOGUI=1 /usr/share/steamos-btrfs/install.sh\n/usr/share/steamos-btrfs/install.sh --nogui\n```\n\n## Uninstall\n\n- the underlying rootfs needs to be mounted somewhere else and the readonly mode disabled\n  + `sudo mount /dev/disk/by-partsets/self/rootfs /mnt`\n  + `sudo btrfs property set /mnt ro false`\n- the original files are backed up next to the new files with a `.orig` extension so you can move them back into position\n  + `sudo find /mnt -type f,l -name '*.orig' -exec sh -c 'mv -vf \"$1\" \"${1%.*}\"' _ '{}' \\;`\n- make sure to disable the conversion systemd services or it will attempt to convert `/home` again\n  + `sudo rm /mnt/usr/lib/systemd/system/*.target.wants/steamos-convert-home-to-btrfs*.service`\n- the `/home` partition will need to be force formatted back to ext4 if it has been converted to btrfs (obviously all files on it will be lost!)\n  + you can edit `/etc/fstab` to mount `/home` in tmpfs for the next boot : `tmpfs /home tmpfs defaults,nofail,noatime,lazytime 0 0`\n  + force format the real `/home` to ext4 : `sudo mkfs.ext4 -m 0 -O casefold -F -L home /dev/disk/by-partsets/shared/home`\n  + change the line in `/etc/fstab` back to ext4 : `/dev/disk/by-partsets/shared/home /home   ext4    defaults,nofail,x-systemd.growfs 0       2`\n\n## Mount options\n\n### Btrfs mount options\n\nThe following mount options are used by default:\n\n- `noatime,lazytime`: to keep writes to a minimum\n- `compress-force=zstd`: force zstd compression always on. zstd is smart enough to do the right thing on uncompressible data, works better and achieves better results than the normal heuristics for compression. You can set a specific compression level by appending `:\u003clevel\u003e` to the type e.g.: `compress-force=zstd:6`. The default level is 3 and going over 6 is rarely worth it (compression/decompression complexity grows quickly after that).\n- `space_cache=v2`: make sure the newer implementation is used\n- `autodefrag`: small random writes are queued up for defragmentation, invests more effort during writes to achieve as much contiguous data as possible. Interesting for games where more fragmentation can lead to loading stutter.\n- `subvol=@`: by default it will create a subvolume `@` (can be changed in the config) which is used as real root of the filesystem. SD Cards formatted as btrfs will be searched for the `@` subvolume or fallback to `/`.\n- `ssd_spread`:  attempts to allocate into bigger and aligned chunks of unused space for a potential performance boost on SD cards.\n- `nodiscard`: disables continuous discarding of freed blocks. There's already an fstrim timer that will periodically TRIM the drives.\n- `commit`: (not by default) the commit interval, you may achieve good results by raising it to something like 120 seconds `commit=120` especially on the SD card\n\n### F2FS mount options\n\n- `noatime,lazytime`: to keep writes to a minimum\n- `compress_algorithm=zstd`: use zstd compression. You can set a specific compression level by appending `:\u003clevel\u003e` to the type e.g.: `compress_algorithm=zstd:6`. The default level is 3 and going over 6 is rarely worth it (compression/decompression complexity grows quickly after that).\n- `compress_chksum`: verify compressed blocks with a checksum\n- `atgc,gc_merge`: use better garbage collector, async garbage collection\n\n### ext4 mount options\n\n- `noatime,lazytime`: to keep writes to a minimum\n\n### fat mount options\n\n**Don't forget that fat formatted SD cards are limited to 4GB per file!**\n\n- `noatime,lazytime`: to keep writes to a minimum\n- `uid=1000,gid=1000`: make it usable for the default `deck` user\n- `utf8=1`: force utf8 support\n\n### exfat mount options\n\n- `noatime,lazytime`: to keep writes to a minimum\n- `uid=1000,gid=1000`: make it usable for the default `deck` user\n\n### ntfs mount options\n\n- `noatime,lazytime`: to keep writes to a minimum\n- `uid=1000,gid=1000`: make it usable for the default `deck` user\n- `big_writes`: prevent splitting of write buffers into 4K chunks\n- `umask=0022`: default bitmask of file and directories\n- `ignore_case`: ignore character case when accessing a file (lowntfs-3g)\n- `windows_names`: prevents names not allowed by windows\n\n## Configuration options\n\nA configuration file is available to change various filesystem options at [`/etc/default/steamos-btrfs`](files/etc/default/steamos-btrfs).\n\nIf it's a first time installation, edit `./files/etc/default/steamos-btrfs`.\n\n- `STEAMOS_BTRFS_HOME_FORMAT`               : toggle formatting of the `/home` partition instead of converting it. An attempt will be made to backup `/home` if the memory allows for it but **expect data loss when using this options!**\n- `STEAMOS_BTRFS_HOME_FORMAT_OPTS`          : flags to pass to `mkfs.btrfs` when freshly formatting the `/home` partition instead of converting it.\n- `STEAMOS_BTRFS_HOME_CONVERT_OPTS`         : the options to pass to `btrfs-convert` during the `/home` conversion. You could for instance choose a different checksumming algorithm like `xxhash` instead of `crc32c` with `--checksum xxhash`.\n- `STEAMOS_BTRFS_HOME_MOUNT_OPTS`           : the mount options to use for mounting the `/home` partition. Changing only this variable will not have any effect if the conversion is already done. `/etc/fstab` would need to be edited to reflect the new values and you can do this easily by running the installation script again [`./install.sh`](install.sh) (pick `Convert /home` again during installation).\n- `STEAMOS_BTRFS_HOME_MOUNT_SUBVOL`         : the root subvolume to use when mounting. Changing only this variable will not have any effect if the conversion is already done. A new subvolume with the desired name would need to be created and `/etc/fstab` would need to be edited to reflect the new values.\n- `STEAMOS_BTRFS_SDCARD_FORMAT_FS`          : allows you to specify what new blank SD cards will be formatted as. One of `btrfs`, `f2fs`, `ext4`.\n- `STEAMOS_BTRFS_SDCARD_BTRFS_MOUNT_OPTS`   : the btrfs mount options for btrfs formatted SD cards.\n- `STEAMOS_BTRFS_SDCARD_BTRFS_MOUNT_SUBVOL` : the default subvolume to mount if available. It also specifies the default subvolume to create on newly formatted btrfs SD cards.\n- `STEAMOS_BTRFS_SDCARD_BTRFS_FORMAT_OPTS`  : flags to pass to `mkfs.btrfs` during the format.\n- `STEAMOS_BTRFS_SDCARD_EXT4_MOUNT_OPTS`    : the ext4 mount options for ext4 formatted SD cards.\n- `STEAMOS_BTRFS_SDCARD_EXT4_FORMAT_OPTS`   : flags to pass to `mkfs.ext4` during the format.\n- `STEAMOS_BTRFS_SDCARD_F2FS_MOUNT_OPTS`    : the f2fs mount options for f2fs formatted SD cards.\n- `STEAMOS_BTRFS_SDCARD_F2FS_FORMAT_OPTS`   : flags to pass to `mkfs.f2fs` during the format.\n- `STEAMOS_BTRFS_SDCARD_FAT_MOUNT_OPTS`     : the fat mount options for fat formatted SD cards.\n- `STEAMOS_BTRFS_SDCARD_FAT_FORMAT_OPTS`    : flags to pass to `mkfs.vfat` during the format.\n- `STEAMOS_BTRFS_SDCARD_EXFAT_MOUNT_OPTS`   : the exfat mount options for exfat formatted SD cards.\n- `STEAMOS_BTRFS_SDCARD_EXFAT_FORMAT_OPTS`  : flags to pass to `mkfs.exfat` during the format. (the `mkfs.exfat` from `exfatprogs`)\n- `STEAMOS_BTRFS_SDCARD_NTFS_MOUNT_OPTS`    : the ntfs mount options for ntfs formatted SD cards.\n- `STEAMOS_BTRFS_SDCARD_NTFS_FORMAT_OPTS`   : flags to pass to `mkfs.ntfs` during the format.\n- `STEAMOS_BTRFS_SDCARD_COMPATDATA_BIND_MOUNT`: toggle bind mounting the `compatdata/` folder for proton support on fat, exfat, ntfs filesystems. Setting to 0 makes it possible to eject the SD card from the Steam client.\n- `STEAMOS_BTRFS_ROOTFS_PACMAN_EXTRA_PKGS`  : additional pacman packages to install into the rootfs separated by spaces (e.g.: \"compsize nfs-utils wireguard-tools ...\"). You can install them easily immediately by running the installation script again [`/usr/share/steamos-btrfs/install.sh`](install.sh).\n\nIf you changed the default options and want to reset them or want to benefit from updated default options you can do the following:\n\nDelete the modified file from the upper overlay layer:\n```sh\nsudo rm -f /var/lib/overlays/etc/upper/default/steamos-btrfs\n```\n\nRefresh the overlay for `/etc`:\n```sh\nsudo mount -o remount /etc\necho 3 | sudo tee /proc/sys/vm/drop_caches\n```\n\n## Deduplication\n\n### Using the `btrfs-dedup@` timers\n\nThe script installs a `btrfs-dedup@.timer` and `btrfs-dedup@.service` that runs a background deduplication using `rmlint` and `duperemove` once a week.\n\nIt has a configuration file at `/etc/conf.d/btrfs-dedup` where you can modify the behaviour. By default dedup will only run when the power adapter is connected (pause/resume on AC).\n\nYou can stop and resume the deduplication at any time, `duperemove` in some cases can take forever so the process is limited to 4 hours max by default.\n\nFor `/home`:\n```sh\nsudo systemctl start --no-block btrfs-dedup@home.service\nsudo systemctl stop --no-block btrfs-dedup@home.service\n```\n\nFor `/run/media/mmcblk0p1` (SD card):\n```sh\nsudo systemctl start --no-block btrfs-dedup@run-media-mmcblk0p1.service\nsudo systemctl stop --no-block btrfs-dedup@run-media-mmcblk0p1.service\n```\n\nFor any other path you can do:\n```sh\nsudo systemctl start --no-block btrfs-dedup@\"$(systemd-escape -p \u003cpath/to/dedup\u003e)\".service\nsudo systemctl stop --no-block btrfs-dedup@\"$(systemd-escape -p \u003cpath/to/dedup\u003e)\".service\n```\n\nIf you wish to disable the scheduled deduplication timers:\n```sh\nsudo systemctl stop --no-block btrfs-dedup@home.timer\nsudo systemctl mask --no-block btrfs-dedup@home.timer\nsudo systemctl stop --no-block btrfs-dedup@run-media-mmcblk0p1.timer\nsudo systemctl mask --no-block btrfs-dedup@run-media-mmcblk0p1.timer\n```\n\nTo turn them back on:\n```sh\nsudo systemctl unmask --no-block btrfs-dedup@home.timer\nsudo systemctl start --no-block btrfs-dedup@home.timer\nsudo systemctl unmask --no-block btrfs-dedup@run-media-mmcblk0p1.timer\nsudo systemctl start --no-block btrfs-dedup@run-media-mmcblk0p1.timer\n```\n\n### Manual dedup\n\nUsing first [rmlint](https://rmlint.readthedocs.io/en/latest/) for fast efficient file deduplication and finally [duperemove](https://github.com/markfasheh/duperemove) for block based deduplication is the most effective way to potentially reduce disk space.\n\nCheck with `compsize` the used disk space before deduplication:\n```sh\nsudo compsize /home\n```\n\nFirst use `rmlint` on `/home`:\n```sh\ncd /tmp\nsudo rmlint --hidden --types=\"duplicates\" --config=sh:handler=clone --xattr /home\nsudo ./rmlint.sh -d -r -k\nsudo rm -r rmlint*\n```\n\n**DISCLAIMER: in most cases running `duperemove` will not result in a lot of space improvements and is slow.**\n\nThen use `duperemove` which might take a while:\n```sh\ncd /tmp\n[ -f /home/.duperemove.hash ] \u0026\u0026 sudo cp -a /home/.duperemove.hash duperemove.hash\nsudo duperemove -r -d -h --hashfile=duperemove.hash --skip-zeroes /home\nsudo cp -a duperemove.hash /home/.duperemove.hash\nsudo rm duperemove.hash\n```\n\nCheck the used disk space again:\n```sh\nsudo compsize /home\n```\n\nYou can do the same for the SD card just replace `/home` with `/run/media/mmcblk0p1`.\n\n## Steam preallocation woes\n\nSteamOS' `5.13*` kernel has an issue where games downloaded through the Steam client will not achieve their most optimal compression ratio.\nTo mitigate this, the current version attempts to replace Steam's `downloading` and `temp` folders (located in `Steam/steamapps/`) with btrfs subvolumes and COW disabled.\n\nIf you were already using this project or you think your games' space usage is less than ideal you may want to consider defragmenting and balancing your Steam library manually:\n\nFor the internal storage:\n```sh\nsudo btrfs filesystem defrag -czstd -v -r -f /home/deck/.local/share/Steam/steamapps\nsudo btrfs balance start -m -v /home/deck/.local/share/Steam/steamapps\n```\n\nFor your SD card:\n```sh\nsudo btrfs filesystem defrag -czstd -v -r -f /run/media/mmcblk0p1/steamapps\nsudo btrfs balance start -m -v /run/media/mmcblk0p1/steamapps\n```\n\n## TODO\n\n- [ ] SD card/any drive btrfs conversion\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Fpopsulfr%2Fsteamos-btrfs","html_url":"https://awesome.ecosyste.ms/projects/gitlab.com%2Fpopsulfr%2Fsteamos-btrfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Fpopsulfr%2Fsteamos-btrfs/lists"}