{"id":20563814,"url":"https://github.com/azohra/unbalance","last_synced_at":"2026-05-26T20:32:17.914Z","repository":{"id":245775787,"uuid":"819202688","full_name":"azohra/unbalance","owner":"azohra","description":"Ensure a path resides on a single disk in a pool","archived":false,"fork":false,"pushed_at":"2024-12-05T06:40:12.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T08:23:39.765Z","etag":null,"topics":["mergerfs","snapraid"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azohra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-06-24T03:32:03.000Z","updated_at":"2024-12-05T06:40:15.000Z","dependencies_parsed_at":"2024-06-24T04:24:29.817Z","dependency_job_id":"eedb5a47-bfcb-4a8e-b698-0fb6162205d8","html_url":"https://github.com/azohra/unbalance","commit_stats":null,"previous_names":["azohra/unbalance"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/azohra/unbalance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azohra%2Funbalance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azohra%2Funbalance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azohra%2Funbalance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azohra%2Funbalance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azohra","download_url":"https://codeload.github.com/azohra/unbalance/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azohra%2Funbalance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33538659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["mergerfs","snapraid"],"created_at":"2024-11-16T04:21:10.718Z","updated_at":"2026-05-26T20:32:17.899Z","avatar_url":"https://github.com/azohra.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Unbalance\n\nUnbalance is a script designed for MergerFS users who also utilize SnapRAID. It ensures that a specified path of data resides on a single disk in the pool. \n\nI wrote unblance to help migrate from an `mfs` create strategy to `epmfs` such that I could start using SnapRAID and never worry about hitting this quirk: \n\n* https://sourceforge.net/p/snapraid/discussion/1677233/thread/8282fcf886/?limit=25#b71e/a288/884a/1d58.\n* https://www.reddit.com/r/Snapraid/comments/1clk039/comment/l2zk8t3/?utm_source=share\u0026utm_medium=web3x\u0026utm_name=web3xcss\u0026utm_term=1\u0026utm_content=share_button\n\n## Features\n- Ensures a specified path is located on only one disk.\n- Automatically scans disks in the pool to find the largest existing data path.\n- Moves data to the largest disk, if needed.\n- Provides clear logging and operation status updates.\n\n## Installation\n0. Make the script executable with `chmod u+x unbalance.sh`\n1. Ensure you have `rsync` installed\n2. Modify the disk list in `unbalance.sh` to match your mount points. \n\n```bash\n# Configurable Parameters\ndisks=(\"/mnt/disk1\" \"/mnt/disk2\" \"/mnt/disk3\" \"/mnt/disk4\")  # Array of disk mounts\n```\n\n## Usage\nRun the script with the partial path you want to un-balance. Do not includ the disk or pool.\n\n**Example:**\n```bash\n./unbalance.sh \"tv/some-show (2024)\"\n```\n\n### For a path that is already un-balanced, you would see\n```bash\nPath: tv/show-a (2024)\n-------------------\nLogs: /home/azohra/unbalance.log (ID: 1MMQ7Y)\n-------------------\nPath Usage:\n/mnt/disk1: Not present\n/mnt/disk2: Not present\n/mnt/disk3: Not present\n/mnt/disk4: 7.2GiB (Largest)\n-------------------\nTotal data to move: 0B\n-------------------\nCurrent operation: Checking data balance\n-------------------\nRecent Logs:\n  [2024-06-23 19:37:24] [1MMQ7Y] 🟢 Unbalancer started for 'tv/show-a (2024)'\n  [2024-06-23 19:37:24] [1MMQ7Y] Starting disk scan for path\n  [2024-06-23 19:37:24] [1MMQ7Y] Path not present on /mnt/disk1\n  [2024-06-23 19:37:24] [1MMQ7Y] Path not present on /mnt/disk2\n  [2024-06-23 19:37:24] [1MMQ7Y] Path not present on /mnt/disk3\n  [2024-06-23 19:37:24] [1MMQ7Y] Path present on /mnt/disk4: 7.2GiB\n  [2024-06-23 19:37:24] [1MMQ7Y] ✔️ Path is already unbalanced (or does not exist on any disk)\n```\n\n### For a path that requires un-balancing, you would see\n```bash\nPath: tv/show-b (2020)\n-------------------\nLogs: /home/azohra/unbalance.log (ID: eR4iA0)\n-------------------\nPath Usage:\n/mnt/disk1: 3.6GiB\n/mnt/disk2: 8.1GiB\n/mnt/disk3: 4.3GiB\n/mnt/disk4: 13GiB (Largest)\n-------------------\nTotal data to move: 16GiB\n-------------------\nCurrent operation: Checking data balance\n-------------------\nRecent Logs:\n  [2024-06-23 19:57:45] [eR4iA0] 🟢 Unbalance started for 'tv/show-b (2020)'\n  [2024-06-23 19:57:45] [eR4iA0] Starting disk scan for path\n  [2024-06-23 19:57:45] [eR4iA0] Path present on /mnt/disk1: 3.6GiB\n  [2024-06-23 19:57:45] [eR4iA0] Path present on /mnt/disk2: 8.1GiB\n  [2024-06-23 19:57:45] [eR4iA0] Path present on /mnt/disk3: 4.3GiB\n  [2024-06-23 19:57:45] [eR4iA0] Path present on /mnt/disk4: 13GiB\n  [2024-06-23 19:57:45] [eR4iA0] Path is largest on /mnt/disk4 with 13GiB\n  [2024-06-23 20:12:55] [eR4iA0] 16GiB of data should move to /mnt/disk4\n  [2024-06-23 20:12:58] [eR4iA0] Starting file transfer from /mnt/disk1 to /mnt/disk4\n  [2024-06-23 20:13:17] [eR4iA0] Completed file transfer from /mnt/disk1 to /mnt/disk4\n  [2024-06-23 20:13:17] [eR4iA0] Removed empty directories from /mnt/disk1:\n  [2024-06-23 20:13:17] [eR4iA0] Starting file transfer from /mnt/disk2 to /mnt/disk4\n  [2024-06-23 20:14:11] [eR4iA0] Completed file transfer from /mnt/disk2 to /mnt/disk4\n  [2024-06-23 20:14:11] [eR4iA0] Removed empty directories from /mnt/disk2:\n  [2024-06-23 20:14:11] [eR4iA0] Starting file transfer from /mnt/disk3 to /mnt/disk4\n  [2024-06-23 20:14:40] [eR4iA0] Completed file transfer from /mnt/disk3 to /mnt/disk4\n  [2024-06-23 20:14:40] [eR4iA0] Removed empty directories from /mnt/disk3:\n  [2024-06-23 20:14:40] [k4ca6H] All files for 'tv/show-b (2020)' have been moved to /mnt/disk4\n  [2024-06-23 20:14:40] [k4ca6H] ✔️ Path unbalanced successfully\n-------------------\n```\n \n## Logging\nAll actions are shown in the CLI and also logged to the directory where the script is executed, with the filename `unbalance.log`. The logs include detailed information about each step and operation performed by the script.\n\n## License\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazohra%2Funbalance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazohra%2Funbalance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazohra%2Funbalance/lists"}