{"id":22052094,"url":"https://github.com/pforret/wslmgt","last_synced_at":"2025-03-23T15:28:29.168Z","repository":{"id":264926204,"uuid":"867648409","full_name":"pforret/wslmgt","owner":"pforret","description":"Check and shrink WSL disk usage","archived":false,"fork":false,"pushed_at":"2024-10-04T14:32:27.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T21:55:12.472Z","etag":null,"topics":["bashew","wsl2"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pforret.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}},"created_at":"2024-10-04T13:07:58.000Z","updated_at":"2024-10-04T14:32:38.000Z","dependencies_parsed_at":"2024-11-27T00:01:15.333Z","dependency_job_id":null,"html_url":"https://github.com/pforret/wslmgt","commit_stats":null,"previous_names":["pforret/wslmgt"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforret%2Fwslmgt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforret%2Fwslmgt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforret%2Fwslmgt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforret%2Fwslmgt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pforret","download_url":"https://codeload.github.com/pforret/wslmgt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122052,"owners_count":20564231,"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","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":["bashew","wsl2"],"created_at":"2024-11-30T15:13:06.472Z","updated_at":"2025-03-23T15:28:29.137Z","avatar_url":"https://github.com/pforret.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wslmgt\nCheck and shrink WSL disk usage\n\n\n## Usage\n\n```\nProgram : wslmgt  by peter@forret.com\nVersion : v0.0.0 (2024-10-04 15:15)\nPurpose : list and manage wsl volumes\nUsage   : wslmgt [-h] [-Q] [-V] [-f] [-L \u003cLOG_DIR\u003e] [-T \u003cTMP_DIR\u003e] \u003caction\u003e \u003cinput?\u003e\nFlags, options and parameters:\n    -h|--help        : [flag] show usage [default: off]\n    -Q|--QUIET       : [flag] no output [default: off]\n    -V|--VERBOSE     : [flag] also show debug messages [default: off]\n    -f|--FORCE       : [flag] do not ask for confirmation (always yes) [default: off]\n    -L|--LOG_DIR \u003c?\u003e : [option] folder for log files   [default: /home/pforret/log/wslmgt]\n    -T|--TMP_DIR \u003c?\u003e : [option] folder for temp files  [default: /tmp/wslmgt]\n    \u003caction\u003e         : [choice] action to perform  [options: list,action2,check,env,update]\n    \u003cinput\u003e          : [parameter] input file/text (optional)\n```\n\n## wslmgt list\n\n```bash\n$ wslmgt list\n⏳  WSL Volumes: actual size on disk\n56G : Ubuntu20.04 : ext4.vhdx : [windows user]\n28G : Ubuntu22.04 : ext4.vhdx : [windows user]\n⏳  WSL Images : used disk space\n41G : Ubuntu-20.04 : /dev/sdf: [wsl user]\n28G : Ubuntu-22.04 : /dev/sde: [wsl user]\n✴️: Ubuntu-24.04 is WSL1: no VHDX disk that can be shrunk\n```\n\n## wslmgt shrink\n\n```bash\n$ wslmgt shrink\n \n# Run the following in a Powershell (Run As Administrator):\n# (don't type the '\u003e' and whatever's in front of it, your Powershell will show this)\nPS C:\\WINDOWS\\system32\u003e wsl.exe --shutdown\n\nPS C:\\WINDOWS\\system32\u003e diskpart\nDISKPART\u003e select vdisk file=c:\\Users\\[user]\\AppData\\Local\\Packages\\[...Ubuntu20.04LTS_...]\\LocalState\\ext4.vhdx\n\nDiskPart successfully selected the virtual disk file.\n\nDISKPART\u003e compact vdisk\n\n  100 percent completed\n  \nDiskPart successfully compacted the virtual disk file.\n\nDISKPART\u003e exit\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpforret%2Fwslmgt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpforret%2Fwslmgt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpforret%2Fwslmgt/lists"}