{"id":24589353,"url":"https://github.com/szwendacz99/fedora-immutable-cheatsheet","last_synced_at":"2025-10-13T03:12:47.061Z","repository":{"id":200264963,"uuid":"705146759","full_name":"Szwendacz99/fedora-immutable-cheatsheet","owner":"Szwendacz99","description":"A cheatsheet for immutable fedora variants, usually about ostree and rpm-ostree","archived":false,"fork":false,"pushed_at":"2023-12-27T07:51:19.000Z","size":26,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-11T14:14:49.566Z","etag":null,"topics":["fedora","fedora-kinoite","fedora-silverblue","linux","ostree","rpm-ostree"],"latest_commit_sha":null,"homepage":"","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://github.com/Szwendacz99.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-15T06:54:09.000Z","updated_at":"2025-10-01T02:42:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0da8217-c62d-46cc-a19a-700ee3e22ceb","html_url":"https://github.com/Szwendacz99/fedora-immutable-cheatsheet","commit_stats":null,"previous_names":["szwendacz99/fedora-immutable-cheatsheet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Szwendacz99/fedora-immutable-cheatsheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Szwendacz99%2Ffedora-immutable-cheatsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Szwendacz99%2Ffedora-immutable-cheatsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Szwendacz99%2Ffedora-immutable-cheatsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Szwendacz99%2Ffedora-immutable-cheatsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Szwendacz99","download_url":"https://codeload.github.com/Szwendacz99/fedora-immutable-cheatsheet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Szwendacz99%2Ffedora-immutable-cheatsheet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014168,"owners_count":26085369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fedora","fedora-kinoite","fedora-silverblue","linux","ostree","rpm-ostree"],"created_at":"2025-01-24T08:15:14.140Z","updated_at":"2025-10-13T03:12:47.047Z","avatar_url":"https://github.com/Szwendacz99.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# fedora-immutable-cheatsheet\n\nA cheatsheet for immutable fedora variants, usually about ostree and rpm-ostree\n\n## System files health checking\n\nFinding all damaged objects. `--delete` flag will delete corrupted files and mark commits with damaged files as \"partial\", which then allow to redownload it.\n```bash\nostree fsck -a\n```\n\nCurrent deployment status\n```bash\nrpm-ostree status\n```\n\n## Emergency fallback\n\n### booting previous deployment\n\n1. Boot into the last booted deployment before the currently booted deployment, and make it your default deployment\n\n```bash\nrpm-ostree rollback\n```\n2. Make a specific deployment your default deployment, 0 is the deployment index\n\n```bash\nostree admin set-default 0\n```\n\n### falling back to any previous commit of the system branch\n\n1. Download last 5 commits (parameter `--commit-metadata-only` is optional but makes things faster)\n   \n```bash\nostree pull --commit-metadata-only --depth 5 fedora fedora/38/x86_64/kinoite\n```\n\n2. (Optionally) pin current deployment if there is chance of need to return to it. 0 is index of current deployment. to list deploymends run `rpm-ostree status` or `ostree admin status`\n\n```bash\nostree admin pin 0\n```\n\n3. List downloaded commits to choose the best one, basing on the timestamp or anything elese\n\n```bash\nostree log fedora:fedora/38/x86_64/kinoite\n```\n\n4. Deploy selected commit using its hash (or version, like `38.20231008.0`)\n\n```bash\nrpm-ostree deploy 520e744c643b85fd14817a3eb948f200e7dec902cad4157e411dfeda2c6d7aab\n```\n\n5. Reboot into the new deoloyment (to see it before reboot, run `rpm-ostree status`)\n\n6. (Optionally) unpin previously pinned deployment (id will be 1 if it is listed as the one before currently booted one)\n\n```bash\nostree admin pin -u 1\n```\n\n### Rebase into different tree (also for switching flavors of the distro)\n\n1. List trees of the ostree repository (fedora example)\n\n```bash\nostree remote summary fedora\n```\n\n2. Rebase the system into the selected tree\n\n```bash\nrpm-ostree rebase fedora:fedora/39/x86_64/kinoite\n```\n\n3. reboot into the new deployment\n\n## cleaning\n\nMain tool for cleanup is `rpm-ostree cleanup` command. To see all options run:\n\n```bash\nrpm-ostree cleanup --help\n```\n\nFull cleanup (including all deployments other than currently deployed)\n```bash\nrpm-ostree cleanup -p -b -r -m\n```\n\nostree also have cleaning tool\n\n```bash\nostree prune\n```\n\n## Managing packages deployed with system\n\nAdding package fzf to the (new) deployment\n\n```bash\nrpm-ostree install fzf\n```\n\nRemoving packgage that was additionally installed\n\n```bash\nrpm-ostree remove fzf\n```\n\nRemoving package that is in the system by default\n\n```bash\nrpm-ostree override remove firefox\n```\n\nRestore default package that was removed with override\n\n```bash\nrpm-ostree override reset firefox\n```\n\n## Other\n\n### Allow system modification\n\nTemporarily\n\n```bash\nrpm-ostree usroverlay --transient\n````\n\nMake the changes to `/usr` persist reboots\n\n```bash\nrpm-ostree usroverlay --hotfix\n```\n\n## encrypted BTRFS on ssd-like disk maintenance/health\n\nIt is **very** important for performance to have trimming working. To test it\nrun the below to trim all mounted filesystems (can take long time, like over\n10,20 minutes) (if root disk is not trimmed, it have discard not enabled at\nsome level):\n\n```bash\nfstrim -av\n```\n\nIf trimming is not working, check the below:\n\n- `/etc/crypttab` if it have discard set for root\n- `discard=async`, `discard=sync`, or `discard` flags set in `/etc/fstab`\n- `lsblk -o +DISC-GRAN,DISC-MAX` - the additional columns should have non-zero values\n- `cryptsetup luksDump /dev/nvme0n1p3` - if flag `allow-discards` is set\n(optional but best way to make cryptsetup allow discards by default)\n\nSetting performance improving flags on luks volume:\n\n```bash\ncryptsetup refresh \\\n    --allow-discards \\\n    --perf-no_read_workqueue \\\n    --perf-no_write_workqueue \\\n        --persistent \\\n            /dev/mapper/\u003cdisk\u003e\n```\n\nArch wiki about workqueues: https://wiki.archlinux.org/title/Dm-crypt/Specialties#Disable_workqueue_for_increased_solid_state_drive_(SSD)_performance\n\nRecommended flags for btrfs volume mounting (compression flag optional, I guess):\n\n```\nnoatime,space_cache=v2,discard=async,compress-force=zstd:1\n```\n\nIf for some reason `space_cache` is not set properly on volume mount, do this\n, (fs need to be unmounted):\n\n- clear any v1 and v2 space_cache\n- mount with space_cache=v2 flag\n- check if flag is set correctly (maybe also create some file there?)\n\n```bash\nbtrfs check --clear-space-cache v1 /dev/mapper/\u003cdevice\u003e\nbtrfs check --clear-space-cache v2 /dev/mapper/\u003cdevice\u003e\n\nmount -o space_cache=v2 /dev/mapper/\u003cdevice\u003e /mnt\nmount | grep space_cache\necho \"hello\" \u003e /mnt/some/path/file.txt\numount /mnt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszwendacz99%2Ffedora-immutable-cheatsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszwendacz99%2Ffedora-immutable-cheatsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszwendacz99%2Ffedora-immutable-cheatsheet/lists"}