btrfs icon indicating copy to clipboard operation
btrfs copied to clipboard

BTRFS filesystem getting set to READONLY but only by WinBtrfs.

Open priyamkalra0 opened this issue 10 months ago • 6 comments

Hey. I am using Windows 11 24H2 build 26100.4061, and my btrfs filesystem goes read-only as soon as I attempt to write anything on it, but on the linux side everything seems to be working fine, I can read/write anything with no issues and btrfs check or scrub also finds no errors.

I tried to get some logs using debug view but maybe I am missing something because nothing comes up in that window. I've tried deleting the btrfs registry key, uninstalling and reinstalling the winbtrfs driver but nothing seems to work.

I think a complete clean reinstallation of WinBtrfs might help but I don't know how to do it (winbtrfs always seems to remember drive letters and other old configuration after reinstalling).

Any pointers would be appreciated. I can provide additional information.

priyamkalra0 avatar May 26 '25 01:05 priyamkalra0

Can you paste the output of btrfs check please on Linux?

maharmstone avatar May 26 '25 20:05 maharmstone

Hey, thanks for the quick response. Here's the output of btrfs check on linux:

Opening filesystem to check...
Checking filesystem on /dev/nvme0n1p1
UUID: e6631ab2-30c9-440e-a721-37a6ef43765c
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space cache
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 1078838030336 bytes used, no error found
total csum bytes: 1050253140
total tree bytes: 2912239616
total fs tree bytes: 1614905344
total extent tree bytes: 136839168
btree space waste bytes: 392599805
file data blocks allocated: 2594927599616
 referenced 1223415787520

I have run btrfs check in repair mode in the past, but only when I have issues in the "extent tree" (idek what that means), but it generally is able to resolve those issues without corrupting anything, and WinBtrfs never had an issue like this earlier.

I am also attaching the output I got the last time I ran btrfs check --repair, I think this might help:

Starting repair.

Opening filesystem to check... 
Checking filesystem on /dev/nvme0n1p1 
UUID: e6631ab2-30c9-440e-a721-37a6ef43765c

[1/7] checking root items
Fixed 9 roots.

[2/7] checking extents
ref mismatch on [225542144 16384] extent item 1, found 0
tree extent [225542144, 16384] root 725 has no tree block found
incorrect global backref count on 225542144 found 1 wanted 0
backpointer mismatch on [225542144 16384]
owner ref check failed [225542144 16384]
repair deleting extent record: key [225542144,169,0]
Repaired extent references for 225542144
No device size related problem found

[3/7] checking free space cache
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)

found 1167220236288 bytes used, no error found
total csum bytes: 1136633964
total tree bytes: 2923757568
total fs tree bytes: 1495203840
total extent tree bytes: 161415168
btree space waste bytes: 398131360
file data blocks allocated: 2654233178112
referenced 1285491900416

btrfs check --repair /dev/nvme0n1p1

I know its unsafe to run btrfs check --repair, but usually if I do something stupid and mess up the filesystem, it affects both windows and linux, so that's why I find this situation odd. (I just did atleast 50GB of RW on linux and everything worked as expected, but windows still goes read-only)

priyamkalra0 avatar May 27 '25 03:05 priyamkalra0

You figure anything out on this?

I had an issue where WinBTRFS seemed to cause some file corruption, so I reformatted the partition. That fixed everything on the linux side but now everything on it is read-only on windows. I've tried entirely reinstalling winBTRFS and it still does that, even though everything is fine on linux side (btrfs-check finds no errors)

OboTheHobo avatar Jun 19 '25 06:06 OboTheHobo

I have to chmod 777 everything from Linux in order to write, read and execute from Windows. Don't know if this is correct or helps

shishimaru90 avatar Oct 02 '25 07:10 shishimaru90

I have to chmod 777 everything from Linux in order to write, read and execute from Windows. Don't know if this is correct or helps

The Windows driver ignores the Linux permissions, so this does nothing

maharmstone avatar Oct 02 '25 09:10 maharmstone

I have to chmod 777 everything from Linux in order to write, read and execute from Windows. Don't know if this is correct or helps

The Windows driver ignores the Linux permissions, so this does nothing

Resolved for me after formatting from Linux, so I'm good anyways.

Eventually someone will figure out the real fix

shishimaru90 avatar Oct 02 '25 09:10 shishimaru90