diff --git a/.vitepress/config.mts b/.vitepress/config.mts index e058e2d..43584d8 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -218,6 +218,14 @@ export default defineConfig({ items: [ { text: 'String Literal Types', link: '/typescript/string-literal-types' }, ] + }, + { + text: 'WSL', + link: '/wsl/', + collapsed: true, + items: [ + { text: 'Clear Unused Disk Space', link: '/wsl/clear-unused-disk-space' }, + ] } ], diff --git a/docs/index.md b/docs/index.md index 7c865a7..f5a620e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -94,6 +94,10 @@ hero: text: Typescript link: /typescript/ + - theme: alt + text: WSL + link: /wsl/ + # features: # - title: Feature A # details: Lorem ipsum dolor sit amet, consectetur adipiscing elit diff --git a/docs/wsl/clear-unused-disk-space.md b/docs/wsl/clear-unused-disk-space.md new file mode 100644 index 0000000..4eeecd9 --- /dev/null +++ b/docs/wsl/clear-unused-disk-space.md @@ -0,0 +1,12 @@ +# Clear Unused Disk Space + +WSL will grow but never shrink the size of the virtual disk. This can be a problem if you have a lot of unused space in your WSL virtual disk. You can reclaim this space by running the following command in PowerShell admin: + +```powershell +wsl --shutdown + +# Navigate to the location of the ext4.vhdx file. This is usually in C:\Users\\AppData\Local\Packages\\LocalState\ext4.vhdx + +# Run the following command to compact the virtual disk +Optimize-VHD -Path .\ext4.vhdx -Mode Full +``` \ No newline at end of file diff --git a/docs/wsl/index.md b/docs/wsl/index.md new file mode 100644 index 0000000..b39f388 --- /dev/null +++ b/docs/wsl/index.md @@ -0,0 +1,3 @@ +# WSL Snippets and Musings + +#### [Clear Unused Disk Space](./clear-unused-disk-space.md) \ No newline at end of file