Skip to content

Instantly share code, notes, and snippets.

@chris-piekarski
Created March 5, 2024 19:10
Show Gist options
  • Save chris-piekarski/91987efadbce2d74ba7ec2e02a3bea5f to your computer and use it in GitHub Desktop.
Save chris-piekarski/91987efadbce2d74ba7ec2e02a3bea5f to your computer and use it in GitHub Desktop.
WSL stuck in read only filesystem
# https://learn.microsoft.com/en-us/windows/wsl/disk-space#how-to-repair-a-vhd-mounting-error
(Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | Where-Object { $_.GetValue("DistributionName") -eq 'Ubuntu' }).GetValue("BasePath") + "\ext4.vhdx"
wsl --shutdwon
wsl.exe --mount <path-to-ext4.vhdx> --vhd --bare
wsl -d Ubuntu -e sudo fsck -y /dev/sda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment