-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL disk cannot be mounted read-write #5738
Comments
Likely your ext4 filesystem on the VHD is corrupt, causing it to be (forcibly) mounted ro. Kind of cool that Ubuntu launched though. You can confirm with I can't think of a way for you to run Seems like this could be parlayed into feature request " |
@therealkenc Strangely my main disk is Do you mean it can be built into a feature to allow user run I never know WSL2 runs like a virtual machine. Can I suspend it, for example, pausing it when running a time-consuming task to relese the hardware resources for other programs? |
Sorry that was just fingers without actually looking. The root mount is
I assumed, incorrectly, that you wouldn't be able to run
That was the idea. But having a
That sounds about right. Happy you were able to clear the ro flag at least. Closing "corrupt VHD". |
@therealkenc Thank you for your help. |
Hi All, |
Doc requests and PRs here. In principle a feature request could be opened for WSL |
TL;DR Reading this lot give me a headache. Below is what worked on ....
|
I tried to run I try to run
|
in event this would be helpful to others, dumpe2fs was reporting "clean" state, while subsequently running e2fsck reported errors. was trying to use 'native' docker in wsl2 ubuntu 20.04 installation, was having issues that led to discovery of read-only issue sudo mount -o remount,rw / dumpe2fs /dev/sdc (was 'sdc' initially) showed device was in "clean" state, but apparently it was not. Generally following Myron-S initial steps
|
I could not do anything with the rootfs block device if it didn't have a label. Once I assigned a label to the block device I could mount ro and e2fsck it. Never force a e2fsck on a rw mounted block device as doing so could result in e2fsck corrupting beyond recovery the file system it is trying to fix. It's a procedure I performed on a Western Digital NAS that just flat refused to invoke e2fsck on reboot on its rootfs even though the volume was flagged as dirty. linux shutdown does not work on WSL. Thats the job of the wsl --terminate command. |
Following your steps, I had re-mounted ro before e2fsck. Think main difference between what you reported and what I observed is that errors were reported as found and fixed to me, You apparently were able to remount,rw without 'reboot'ing, possibly (?) because there weren't actually any errors found in your case.
noted |
You could have an inconsistency in See #6220 (comment) |
After a BSoD (not caused by WSL), my WSL disk won't be mounted read-write by default, and I can't remount it manually.
Environment
Steps to reproduce
(This issue is unique to my system, maybe unable to reproduce.)
Expected behavior
Disk will be mounted read-write. You will create a folder in your home directory.
Actual behavior
I can't create files or folders anywhere in WSL. When I use
sudo mount -o rw,remount /
to remount the disk, it prompts:I tried
sudo e2label /dev/sdb cloudimg-rootfs
, and remount it again, then:So I tried
sudo hdparm -r0 /dev/sdb
, and remount it again. It doesn't work, still giving the same prompt.The text was updated successfully, but these errors were encountered: