linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mount: can't read superblock on - corrupt leaf - read time tree block corruption detected
@ 2024-10-03  7:32 cwalou
  2024-10-03  8:08 ` Qu Wenruo
  0 siblings, 1 reply; 9+ messages in thread
From: cwalou @ 2024-10-03  7:32 UTC (permalink / raw)
  To: linux-btrfs

Hello.

A 4TB drive taken out of a synology NAS. When I try to mount it, it 
won't. This is what I did :


root@user-NUC10i7FNH:~# fdisk -l /dev/sda
Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: 001-2MA101
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B7B80A4B-0294-44FD-A368-74B0455D6AF2

Device          Start        End    Sectors   Size Type
/dev/sda1        8192   16785407   16777216     8G Linux RAID
/dev/sda2    16785408   20979711    4194304     2G Linux RAID
/dev/sda5    21257952 1965122911 1943864960 926.9G Linux RAID
/dev/sda6  1965139008 7813827135 5848688128   2.7T Linux RAID


root@user-NUC10i7FNH:~# lsblk
NAME            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda               8:0    0   3.6T  0 disk
|-sda1            8:1    0     8G  0 part
|-sda2            8:2    0     2G  0 part
|-sda5            8:5    0 926.9G  0 part
| `-md2           9:2    0 926.9G  0 raid1
|   `-vg1000-lv 252:0    0   3.6T  0 lvm
`-sda6            8:6    0   2.7T  0 part
   `-md3           9:3    0   2.7T  0 raid1
     `-vg1000-lv 252:0    0   3.6T  0 lvm


root@user-NUC10i7FNH:~# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md3 : active (auto-read-only) raid1 sda6[1]
       2924343040 blocks super 1.2 [2/1] [_U]

md2 : active raid1 sda5[3]
       971931456 blocks super 1.2 [2/1] [U_]

unused devices: <none>


root@user-NUC10i7FNH:~# lvm pvscan
   WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify 
the VG to update.
   WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify 
the VG to update.
   PV /dev/md2   VG vg1000          lvm2 [926.90 GiB / 0    free]
   PV /dev/md3   VG vg1000          lvm2 [2.72 TiB / 0    free]
   Total: 2 [<3.63 TiB] / in use: 2 [<3.63 TiB] / in no VG: 0 [0   ]

root@user-NUC10i7FNH:~# lvm vgscan
   WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify 
the VG to update.
   WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify 
the VG to update.
   Found volume group "vg1000" using metadata type lvm2

root@user-NUC10i7FNH:~# lvm lvscan
   WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify 
the VG to update.
   WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify 
the VG to update.
   ACTIVE            '/dev/vg1000/lv' [<3.63 TiB] inherit


root@user-NUC10i7FNH:~# mount -t btrfs -o rescue=all,ro /dev/vg1000/lv 
/mnt/test/
mount: /mnt/test: can't read superblock on /dev/mapper/vg1000-lv.


root@user-NUC10i7FNH:~# ll /dev/vg1000/lv /dev/mapper/vg1000-lv
lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/mapper/vg1000-lv -> ../dm-0
lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/vg1000/lv -> ../dm-0


root@user-NUC10i7FNH:~# tail log/kern.log
Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.255079] BTRFS: device 
label 2017.12.01-16:57:32 v15217 devid 1 transid 15800483 
/dev/mapper/vg1000-lv scanned by mount (2939)
Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257012] BTRFS info 
(device dm-0): first mount of filesystem 
320f5288-777d-43eb-84e3-4ac70573ec6b
Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257061] BTRFS info 
(device dm-0): using crc32c (crc32c-intel) checksum algorithm
Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257079] BTRFS info 
(device dm-0): disk space caching is enabled
Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650935] BTRFS critical 
(device dm-0: state C): corrupt leaf: root=257 block=2691220668416 
slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650969] BTRFS error 
(device dm-0: state C): read time tree block corruption detected on 
logical 2691220668416 mirror 1
Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654160] BTRFS critical 
(device dm-0: state C): corrupt leaf: root=257 block=2691220668416 
slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654189] BTRFS error 
(device dm-0: state C): read time tree block corruption detected on 
logical 2691220668416 mirror 2
Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654337] BTRFS info 
(device dm-0: state C): last unmount of filesystem 
320f5288-777d-43eb-84e3-4ac70573ec6b


root@user-NUC10i7FNH:~# btrfs rescue super-recover -v /dev/vg1000/lv
All Devices:
         Device: id = 1, name = /dev/vg1000/lv

Before Recovering:
         [All good supers]:
                 device name = /dev/vg1000/lv
                 superblock bytenr = 65536

                 device name = /dev/vg1000/lv
                 superblock bytenr = 67108864

                 device name = /dev/vg1000/lv
                 superblock bytenr = 274877906944

         [All bad supers]:

All supers are valid, no need to recover


root@user-NUC10i7FNH:~# btrfs rescue zero-log /dev/vg1000/lv
Clearing log on /dev/vg1000/lv, previous log_root 0, level 0


root@user-NUC10i7FNH:~# btrfs check /dev/vg1000/lv
Opening filesystem to check...
Checking filesystem on /dev/vg1000/lv
UUID: 320f5288-777d-43eb-84e3-4ac70573ec6b
[1/7] checking root items
[2/7] checking extents
Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
ignoring invalid key
Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
[...line repeated many times
Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
ignoring invalid key
Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
ignoring invalid key
[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 2726275964928 bytes used, no error found
total csum bytes: 839025944
total tree bytes: 3015049216
total fs tree bytes: 1991966720
total extent tree bytes: 95895552
btree space waste bytes: 555710555
file data blocks allocated: 3567579688960
  referenced 2977409900544


root@user-NUC10i7FNH:~# btrfs property get /dev/mapper/vg1000-lv
label=2017.12.01-16:57:32 v15217


root@user-NUC10i7FNH:~# btrfs version
btrfs-progs v5.16.2


The most surprising is that on a Windows 10, "DiskInternals Linux 
Reader" (a paid software) shows me the content of this disk (and asks me 
to pay for copying the data).


Any idea ?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mount: can't read superblock on - corrupt leaf - read time tree block corruption detected
  2024-10-03  7:32 mount: can't read superblock on - corrupt leaf - read time tree block corruption detected cwalou
@ 2024-10-03  8:08 ` Qu Wenruo
  2024-10-03  9:20   ` cwalou
  2024-10-08 19:32   ` Johannes Hirte
  0 siblings, 2 replies; 9+ messages in thread
From: Qu Wenruo @ 2024-10-03  8:08 UTC (permalink / raw)
  To: cwalou@gmail.com, linux-btrfs



在 2024/10/3 17:02, cwalou@gmail.com 写道:
> Hello.
>
> A 4TB drive taken out of a synology NAS. When I try to mount it, it
> won't. This is what I did :

Synology has out-of-tree features that upstream kernel doesn't support.

Please ask the vendor for their support.

Thanks,
Qu
>
>
> root@user-NUC10i7FNH:~# fdisk -l /dev/sda
> Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
> Disk model: 001-2MA101
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: gpt
> Disk identifier: B7B80A4B-0294-44FD-A368-74B0455D6AF2
>
> Device          Start        End    Sectors   Size Type
> /dev/sda1        8192   16785407   16777216     8G Linux RAID
> /dev/sda2    16785408   20979711    4194304     2G Linux RAID
> /dev/sda5    21257952 1965122911 1943864960 926.9G Linux RAID
> /dev/sda6  1965139008 7813827135 5848688128   2.7T Linux RAID
>
>
> root@user-NUC10i7FNH:~# lsblk
> NAME            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
> sda               8:0    0   3.6T  0 disk
> |-sda1            8:1    0     8G  0 part
> |-sda2            8:2    0     2G  0 part
> |-sda5            8:5    0 926.9G  0 part
> | `-md2           9:2    0 926.9G  0 raid1
> |   `-vg1000-lv 252:0    0   3.6T  0 lvm
> `-sda6            8:6    0   2.7T  0 part
>    `-md3           9:3    0   2.7T  0 raid1
>      `-vg1000-lv 252:0    0   3.6T  0 lvm
>
>
> root@user-NUC10i7FNH:~# cat /proc/mdstat
> Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
> md3 : active (auto-read-only) raid1 sda6[1]
>        2924343040 blocks super 1.2 [2/1] [_U]
>
> md2 : active raid1 sda5[3]
>        971931456 blocks super 1.2 [2/1] [U_]
>
> unused devices: <none>
>
>
> root@user-NUC10i7FNH:~# lvm pvscan
>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
> the VG to update.
>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
> the VG to update.
>    PV /dev/md2   VG vg1000          lvm2 [926.90 GiB / 0    free]
>    PV /dev/md3   VG vg1000          lvm2 [2.72 TiB / 0    free]
>    Total: 2 [<3.63 TiB] / in use: 2 [<3.63 TiB] / in no VG: 0 [0   ]
>
> root@user-NUC10i7FNH:~# lvm vgscan
>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
> the VG to update.
>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
> the VG to update.
>    Found volume group "vg1000" using metadata type lvm2
>
> root@user-NUC10i7FNH:~# lvm lvscan
>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
> the VG to update.
>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
> the VG to update.
>    ACTIVE            '/dev/vg1000/lv' [<3.63 TiB] inherit
>
>
> root@user-NUC10i7FNH:~# mount -t btrfs -o rescue=all,ro /dev/vg1000/lv /
> mnt/test/
> mount: /mnt/test: can't read superblock on /dev/mapper/vg1000-lv.
>
>
> root@user-NUC10i7FNH:~# ll /dev/vg1000/lv /dev/mapper/vg1000-lv
> lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/mapper/vg1000-lv -> ../dm-0
> lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/vg1000/lv -> ../dm-0
>
>
> root@user-NUC10i7FNH:~# tail log/kern.log
> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.255079] BTRFS: device
> label 2017.12.01-16:57:32 v15217 devid 1 transid 15800483 /dev/mapper/
> vg1000-lv scanned by mount (2939)
> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257012] BTRFS info
> (device dm-0): first mount of filesystem
> 320f5288-777d-43eb-84e3-4ac70573ec6b
> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257061] BTRFS info
> (device dm-0): using crc32c (crc32c-intel) checksum algorithm
> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257079] BTRFS info
> (device dm-0): disk space caching is enabled
> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650935] BTRFS critical
> (device dm-0: state C): corrupt leaf: root=257 block=2691220668416
> slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650969] BTRFS error
> (device dm-0: state C): read time tree block corruption detected on
> logical 2691220668416 mirror 1
> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654160] BTRFS critical
> (device dm-0: state C): corrupt leaf: root=257 block=2691220668416
> slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654189] BTRFS error
> (device dm-0: state C): read time tree block corruption detected on
> logical 2691220668416 mirror 2
> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654337] BTRFS info
> (device dm-0: state C): last unmount of filesystem
> 320f5288-777d-43eb-84e3-4ac70573ec6b
>
>
> root@user-NUC10i7FNH:~# btrfs rescue super-recover -v /dev/vg1000/lv
> All Devices:
>          Device: id = 1, name = /dev/vg1000/lv
>
> Before Recovering:
>          [All good supers]:
>                  device name = /dev/vg1000/lv
>                  superblock bytenr = 65536
>
>                  device name = /dev/vg1000/lv
>                  superblock bytenr = 67108864
>
>                  device name = /dev/vg1000/lv
>                  superblock bytenr = 274877906944
>
>          [All bad supers]:
>
> All supers are valid, no need to recover
>
>
> root@user-NUC10i7FNH:~# btrfs rescue zero-log /dev/vg1000/lv
> Clearing log on /dev/vg1000/lv, previous log_root 0, level 0
>
>
> root@user-NUC10i7FNH:~# btrfs check /dev/vg1000/lv
> Opening filesystem to check...
> Checking filesystem on /dev/vg1000/lv
> UUID: 320f5288-777d-43eb-84e3-4ac70573ec6b
> [1/7] checking root items
> [2/7] checking extents
> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
> ignoring invalid key
> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
> [...line repeated many times
> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
> ignoring invalid key
> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
> ignoring invalid key
> [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 2726275964928 bytes used, no error found
> total csum bytes: 839025944
> total tree bytes: 3015049216
> total fs tree bytes: 1991966720
> total extent tree bytes: 95895552
> btree space waste bytes: 555710555
> file data blocks allocated: 3567579688960
>   referenced 2977409900544
>
>
> root@user-NUC10i7FNH:~# btrfs property get /dev/mapper/vg1000-lv
> label=2017.12.01-16:57:32 v15217
>
>
> root@user-NUC10i7FNH:~# btrfs version
> btrfs-progs v5.16.2
>
>
> The most surprising is that on a Windows 10, "DiskInternals Linux
> Reader" (a paid software) shows me the content of this disk (and asks me
> to pay for copying the data).
>
>
> Any idea ?
>
>
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mount: can't read superblock on - corrupt leaf - read time tree block corruption detected
  2024-10-03  8:08 ` Qu Wenruo
@ 2024-10-03  9:20   ` cwalou
  2024-10-03 10:12     ` Qu Wenruo
  2024-10-08 19:32   ` Johannes Hirte
  1 sibling, 1 reply; 9+ messages in thread
From: cwalou @ 2024-10-03  9:20 UTC (permalink / raw)
  To: Qu Wenruo, linux-btrfs

Le 03/10/2024 à 10:08, Qu Wenruo a écrit :
> 
> 
> 在 2024/10/3 17:02, cwalou@gmail.com 写道:
>> Hello.
>>
>> A 4TB drive taken out of a synology NAS. When I try to mount it, it
>> won't. This is what I did :
> 
> Synology has out-of-tree features that upstream kernel doesn't support.
> 
> Please ask the vendor for their support.
> 
> Thanks,
> Qu

Thank you for your answer.

Just for my general knowledge, can you explain me what "out-of-tree 
features" means ?

I'll ask synology what's happening. Once I'll find a solution (if one 
day I find one) I'll let know here.

Kind regards,

Walou.


>>
>>
>> root@user-NUC10i7FNH:~# fdisk -l /dev/sda
>> Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
>> Disk model: 001-2MA101
>> Units: sectors of 1 * 512 = 512 bytes
>> Sector size (logical/physical): 512 bytes / 512 bytes
>> I/O size (minimum/optimal): 512 bytes / 512 bytes
>> Disklabel type: gpt
>> Disk identifier: B7B80A4B-0294-44FD-A368-74B0455D6AF2
>>
>> Device          Start        End    Sectors   Size Type
>> /dev/sda1        8192   16785407   16777216     8G Linux RAID
>> /dev/sda2    16785408   20979711    4194304     2G Linux RAID
>> /dev/sda5    21257952 1965122911 1943864960 926.9G Linux RAID
>> /dev/sda6  1965139008 7813827135 5848688128   2.7T Linux RAID
>>
>>
>> root@user-NUC10i7FNH:~# lsblk
>> NAME            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
>> sda               8:0    0   3.6T  0 disk
>> |-sda1            8:1    0     8G  0 part
>> |-sda2            8:2    0     2G  0 part
>> |-sda5            8:5    0 926.9G  0 part
>> | `-md2           9:2    0 926.9G  0 raid1
>> |   `-vg1000-lv 252:0    0   3.6T  0 lvm
>> `-sda6            8:6    0   2.7T  0 part
>>    `-md3           9:3    0   2.7T  0 raid1
>>      `-vg1000-lv 252:0    0   3.6T  0 lvm
>>
>>
>> root@user-NUC10i7FNH:~# cat /proc/mdstat
>> Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
>> md3 : active (auto-read-only) raid1 sda6[1]
>>        2924343040 blocks super 1.2 [2/1] [_U]
>>
>> md2 : active raid1 sda5[3]
>>        971931456 blocks super 1.2 [2/1] [U_]
>>
>> unused devices: <none>
>>
>>
>> root@user-NUC10i7FNH:~# lvm pvscan
>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>> the VG to update.
>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>> the VG to update.
>>    PV /dev/md2   VG vg1000          lvm2 [926.90 GiB / 0    free]
>>    PV /dev/md3   VG vg1000          lvm2 [2.72 TiB / 0    free]
>>    Total: 2 [<3.63 TiB] / in use: 2 [<3.63 TiB] / in no VG: 0 [0   ]
>>
>> root@user-NUC10i7FNH:~# lvm vgscan
>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>> the VG to update.
>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>> the VG to update.
>>    Found volume group "vg1000" using metadata type lvm2
>>
>> root@user-NUC10i7FNH:~# lvm lvscan
>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>> the VG to update.
>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>> the VG to update.
>>    ACTIVE            '/dev/vg1000/lv' [<3.63 TiB] inherit
>>
>>
>> root@user-NUC10i7FNH:~# mount -t btrfs -o rescue=all,ro /dev/vg1000/lv /
>> mnt/test/
>> mount: /mnt/test: can't read superblock on /dev/mapper/vg1000-lv.
>>
>>
>> root@user-NUC10i7FNH:~# ll /dev/vg1000/lv /dev/mapper/vg1000-lv
>> lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/mapper/vg1000-lv -> ../dm-0
>> lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/vg1000/lv -> ../dm-0
>>
>>
>> root@user-NUC10i7FNH:~# tail log/kern.log
>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.255079] BTRFS: device
>> label 2017.12.01-16:57:32 v15217 devid 1 transid 15800483 /dev/mapper/
>> vg1000-lv scanned by mount (2939)
>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257012] BTRFS info
>> (device dm-0): first mount of filesystem
>> 320f5288-777d-43eb-84e3-4ac70573ec6b
>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257061] BTRFS info
>> (device dm-0): using crc32c (crc32c-intel) checksum algorithm
>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257079] BTRFS info
>> (device dm-0): disk space caching is enabled
>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650935] BTRFS critical
>> (device dm-0: state C): corrupt leaf: root=257 block=2691220668416
>> slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650969] BTRFS error
>> (device dm-0: state C): read time tree block corruption detected on
>> logical 2691220668416 mirror 1
>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654160] BTRFS critical
>> (device dm-0: state C): corrupt leaf: root=257 block=2691220668416
>> slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654189] BTRFS error
>> (device dm-0: state C): read time tree block corruption detected on
>> logical 2691220668416 mirror 2
>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654337] BTRFS info
>> (device dm-0: state C): last unmount of filesystem
>> 320f5288-777d-43eb-84e3-4ac70573ec6b
>>
>>
>> root@user-NUC10i7FNH:~# btrfs rescue super-recover -v /dev/vg1000/lv
>> All Devices:
>>          Device: id = 1, name = /dev/vg1000/lv
>>
>> Before Recovering:
>>          [All good supers]:
>>                  device name = /dev/vg1000/lv
>>                  superblock bytenr = 65536
>>
>>                  device name = /dev/vg1000/lv
>>                  superblock bytenr = 67108864
>>
>>                  device name = /dev/vg1000/lv
>>                  superblock bytenr = 274877906944
>>
>>          [All bad supers]:
>>
>> All supers are valid, no need to recover
>>
>>
>> root@user-NUC10i7FNH:~# btrfs rescue zero-log /dev/vg1000/lv
>> Clearing log on /dev/vg1000/lv, previous log_root 0, level 0
>>
>>
>> root@user-NUC10i7FNH:~# btrfs check /dev/vg1000/lv
>> Opening filesystem to check...
>> Checking filesystem on /dev/vg1000/lv
>> UUID: 320f5288-777d-43eb-84e3-4ac70573ec6b
>> [1/7] checking root items
>> [2/7] checking extents
>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>> ignoring invalid key
>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>> [...line repeated many times
>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>> ignoring invalid key
>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>> ignoring invalid key
>> [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 2726275964928 bytes used, no error found
>> total csum bytes: 839025944
>> total tree bytes: 3015049216
>> total fs tree bytes: 1991966720
>> total extent tree bytes: 95895552
>> btree space waste bytes: 555710555
>> file data blocks allocated: 3567579688960
>>   referenced 2977409900544
>>
>>
>> root@user-NUC10i7FNH:~# btrfs property get /dev/mapper/vg1000-lv
>> label=2017.12.01-16:57:32 v15217
>>
>>
>> root@user-NUC10i7FNH:~# btrfs version
>> btrfs-progs v5.16.2
>>
>>
>> The most surprising is that on a Windows 10, "DiskInternals Linux
>> Reader" (a paid software) shows me the content of this disk (and asks me
>> to pay for copying the data).
>>
>>
>> Any idea ?
>>
>>
>>
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mount: can't read superblock on - corrupt leaf - read time tree block corruption detected
  2024-10-03  9:20   ` cwalou
@ 2024-10-03 10:12     ` Qu Wenruo
  2024-10-03 10:32       ` cwalou
  0 siblings, 1 reply; 9+ messages in thread
From: Qu Wenruo @ 2024-10-03 10:12 UTC (permalink / raw)
  To: cwalou@gmail.com, Qu Wenruo, linux-btrfs



在 2024/10/3 18:50, cwalou@gmail.com 写道:
> Le 03/10/2024 à 10:08, Qu Wenruo a écrit :
>>
>>
>> 在 2024/10/3 17:02, cwalou@gmail.com 写道:
>>> Hello.
>>>
>>> A 4TB drive taken out of a synology NAS. When I try to mount it, it
>>> won't. This is what I did :
>>
>> Synology has out-of-tree features that upstream kernel doesn't support.
>>
>> Please ask the vendor for their support.
>>
>> Thanks,
>> Qu
> 
> Thank you for your answer.
> 
> Just for my general knowledge, can you explain me what "out-of-tree 
> features" means ?

Out-of-tree means it's not merged into the upstream Linux kernel.

Furthermore, they do not even bother to put a special 
compat-ro/incompact flags into the super block.

So upstream kernel will not even know the fs has unsupported features, 
until the tree-checker checks the inode flags.

Thanks,
Qu

> 
> I'll ask synology what's happening. Once I'll find a solution (if one 
> day I find one) I'll let know here.
> 
> Kind regards,
> 
> Walou.
> 
> 
>>>
>>>
>>> root@user-NUC10i7FNH:~# fdisk -l /dev/sda
>>> Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
>>> Disk model: 001-2MA101
>>> Units: sectors of 1 * 512 = 512 bytes
>>> Sector size (logical/physical): 512 bytes / 512 bytes
>>> I/O size (minimum/optimal): 512 bytes / 512 bytes
>>> Disklabel type: gpt
>>> Disk identifier: B7B80A4B-0294-44FD-A368-74B0455D6AF2
>>>
>>> Device          Start        End    Sectors   Size Type
>>> /dev/sda1        8192   16785407   16777216     8G Linux RAID
>>> /dev/sda2    16785408   20979711    4194304     2G Linux RAID
>>> /dev/sda5    21257952 1965122911 1943864960 926.9G Linux RAID
>>> /dev/sda6  1965139008 7813827135 5848688128   2.7T Linux RAID
>>>
>>>
>>> root@user-NUC10i7FNH:~# lsblk
>>> NAME            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
>>> sda               8:0    0   3.6T  0 disk
>>> |-sda1            8:1    0     8G  0 part
>>> |-sda2            8:2    0     2G  0 part
>>> |-sda5            8:5    0 926.9G  0 part
>>> | `-md2           9:2    0 926.9G  0 raid1
>>> |   `-vg1000-lv 252:0    0   3.6T  0 lvm
>>> `-sda6            8:6    0   2.7T  0 part
>>>    `-md3           9:3    0   2.7T  0 raid1
>>>      `-vg1000-lv 252:0    0   3.6T  0 lvm
>>>
>>>
>>> root@user-NUC10i7FNH:~# cat /proc/mdstat
>>> Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
>>> md3 : active (auto-read-only) raid1 sda6[1]
>>>        2924343040 blocks super 1.2 [2/1] [_U]
>>>
>>> md2 : active raid1 sda5[3]
>>>        971931456 blocks super 1.2 [2/1] [U_]
>>>
>>> unused devices: <none>
>>>
>>>
>>> root@user-NUC10i7FNH:~# lvm pvscan
>>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>>> the VG to update.
>>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>>> the VG to update.
>>>    PV /dev/md2   VG vg1000          lvm2 [926.90 GiB / 0    free]
>>>    PV /dev/md3   VG vg1000          lvm2 [2.72 TiB / 0    free]
>>>    Total: 2 [<3.63 TiB] / in use: 2 [<3.63 TiB] / in no VG: 0 [0   ]
>>>
>>> root@user-NUC10i7FNH:~# lvm vgscan
>>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>>> the VG to update.
>>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>>> the VG to update.
>>>    Found volume group "vg1000" using metadata type lvm2
>>>
>>> root@user-NUC10i7FNH:~# lvm lvscan
>>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>>> the VG to update.
>>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>>> the VG to update.
>>>    ACTIVE            '/dev/vg1000/lv' [<3.63 TiB] inherit
>>>
>>>
>>> root@user-NUC10i7FNH:~# mount -t btrfs -o rescue=all,ro /dev/vg1000/lv /
>>> mnt/test/
>>> mount: /mnt/test: can't read superblock on /dev/mapper/vg1000-lv.
>>>
>>>
>>> root@user-NUC10i7FNH:~# ll /dev/vg1000/lv /dev/mapper/vg1000-lv
>>> lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/mapper/vg1000-lv -> ../dm-0
>>> lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/vg1000/lv -> ../dm-0
>>>
>>>
>>> root@user-NUC10i7FNH:~# tail log/kern.log
>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.255079] BTRFS: device
>>> label 2017.12.01-16:57:32 v15217 devid 1 transid 15800483 /dev/mapper/
>>> vg1000-lv scanned by mount (2939)
>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257012] BTRFS info
>>> (device dm-0): first mount of filesystem
>>> 320f5288-777d-43eb-84e3-4ac70573ec6b
>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257061] BTRFS info
>>> (device dm-0): using crc32c (crc32c-intel) checksum algorithm
>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257079] BTRFS info
>>> (device dm-0): disk space caching is enabled
>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650935] BTRFS critical
>>> (device dm-0: state C): corrupt leaf: root=257 block=2691220668416
>>> slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650969] BTRFS error
>>> (device dm-0: state C): read time tree block corruption detected on
>>> logical 2691220668416 mirror 1
>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654160] BTRFS critical
>>> (device dm-0: state C): corrupt leaf: root=257 block=2691220668416
>>> slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654189] BTRFS error
>>> (device dm-0: state C): read time tree block corruption detected on
>>> logical 2691220668416 mirror 2
>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654337] BTRFS info
>>> (device dm-0: state C): last unmount of filesystem
>>> 320f5288-777d-43eb-84e3-4ac70573ec6b
>>>
>>>
>>> root@user-NUC10i7FNH:~# btrfs rescue super-recover -v /dev/vg1000/lv
>>> All Devices:
>>>          Device: id = 1, name = /dev/vg1000/lv
>>>
>>> Before Recovering:
>>>          [All good supers]:
>>>                  device name = /dev/vg1000/lv
>>>                  superblock bytenr = 65536
>>>
>>>                  device name = /dev/vg1000/lv
>>>                  superblock bytenr = 67108864
>>>
>>>                  device name = /dev/vg1000/lv
>>>                  superblock bytenr = 274877906944
>>>
>>>          [All bad supers]:
>>>
>>> All supers are valid, no need to recover
>>>
>>>
>>> root@user-NUC10i7FNH:~# btrfs rescue zero-log /dev/vg1000/lv
>>> Clearing log on /dev/vg1000/lv, previous log_root 0, level 0
>>>
>>>
>>> root@user-NUC10i7FNH:~# btrfs check /dev/vg1000/lv
>>> Opening filesystem to check...
>>> Checking filesystem on /dev/vg1000/lv
>>> UUID: 320f5288-777d-43eb-84e3-4ac70573ec6b
>>> [1/7] checking root items
>>> [2/7] checking extents
>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>> ignoring invalid key
>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>> [...line repeated many times
>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>> ignoring invalid key
>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>> ignoring invalid key
>>> [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 2726275964928 bytes used, no error found
>>> total csum bytes: 839025944
>>> total tree bytes: 3015049216
>>> total fs tree bytes: 1991966720
>>> total extent tree bytes: 95895552
>>> btree space waste bytes: 555710555
>>> file data blocks allocated: 3567579688960
>>>   referenced 2977409900544
>>>
>>>
>>> root@user-NUC10i7FNH:~# btrfs property get /dev/mapper/vg1000-lv
>>> label=2017.12.01-16:57:32 v15217
>>>
>>>
>>> root@user-NUC10i7FNH:~# btrfs version
>>> btrfs-progs v5.16.2
>>>
>>>
>>> The most surprising is that on a Windows 10, "DiskInternals Linux
>>> Reader" (a paid software) shows me the content of this disk (and asks me
>>> to pay for copying the data).
>>>
>>>
>>> Any idea ?
>>>
>>>
>>>
>>
> 
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mount: can't read superblock on - corrupt leaf - read time tree block corruption detected
  2024-10-03 10:12     ` Qu Wenruo
@ 2024-10-03 10:32       ` cwalou
  2024-10-03 21:05         ` Qu Wenruo
  0 siblings, 1 reply; 9+ messages in thread
From: cwalou @ 2024-10-03 10:32 UTC (permalink / raw)
  To: Qu Wenruo, Qu Wenruo, linux-btrfs

Le 03/10/2024 à 12:12, Qu Wenruo a écrit :
> 
> 
> 在 2024/10/3 18:50, cwalou@gmail.com 写道:
>> Le 03/10/2024 à 10:08, Qu Wenruo a écrit :
>>>
>>>
>>> 在 2024/10/3 17:02, cwalou@gmail.com 写道:
>>>> Hello.
>>>>
>>>> A 4TB drive taken out of a synology NAS. When I try to mount it, it
>>>> won't. This is what I did :
>>>
>>> Synology has out-of-tree features that upstream kernel doesn't support.
>>>
>>> Please ask the vendor for their support.
>>>
>>> Thanks,
>>> Qu
>>
>> Thank you for your answer.
>>
>> Just for my general knowledge, can you explain me what "out-of-tree 
>> features" means ?
> 
> Out-of-tree means it's not merged into the upstream Linux kernel.
> 
> Furthermore, they do not even bother to put a special 
> compat-ro/incompact flags into the super block.
> 
> So upstream kernel will not even know the fs has unsupported features, 
> until the tree-checker checks the inode flags.
> 
> Thanks,
> Qu
> 

Before I start a quest at Synology.
Is there any way to get around the "can't read superblock on 
/dev/mapper/vg1000-lv." problem?

I mean, is there an option I can pass to 'mount' to skip superblock 
check? Or is there a way to tell him a superblock is available at 
"65536" ("67108864" or "274877906944" which "btrfs rescue super-recover 
-v" tells me are good, see below) ?

My apologies if my questions seem naive. But file systems and storage 
media are not really my specialty. I'm just trying to help an 
acquaintance who has been diligently backing up his data but is now 
stuck restoring his data.

I think if we solve this problem on this public list, it may help more 
people. That's why even I need to ask synology for help, I'll give 
feedback here.

Nevertheless, thank you for the answers you already gave me, for taking 
the time to answer me.

>>
>> I'll ask synology what's happening. Once I'll find a solution (if one 
>> day I find one) I'll let know here.
>>
>> Kind regards,
>>
>> Walou.
>>
>>
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# fdisk -l /dev/sda
>>>> Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
>>>> Disk model: 001-2MA101
>>>> Units: sectors of 1 * 512 = 512 bytes
>>>> Sector size (logical/physical): 512 bytes / 512 bytes
>>>> I/O size (minimum/optimal): 512 bytes / 512 bytes
>>>> Disklabel type: gpt
>>>> Disk identifier: B7B80A4B-0294-44FD-A368-74B0455D6AF2
>>>>
>>>> Device          Start        End    Sectors   Size Type
>>>> /dev/sda1        8192   16785407   16777216     8G Linux RAID
>>>> /dev/sda2    16785408   20979711    4194304     2G Linux RAID
>>>> /dev/sda5    21257952 1965122911 1943864960 926.9G Linux RAID
>>>> /dev/sda6  1965139008 7813827135 5848688128   2.7T Linux RAID
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# lsblk
>>>> NAME            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
>>>> sda               8:0    0   3.6T  0 disk
>>>> |-sda1            8:1    0     8G  0 part
>>>> |-sda2            8:2    0     2G  0 part
>>>> |-sda5            8:5    0 926.9G  0 part
>>>> | `-md2           9:2    0 926.9G  0 raid1
>>>> |   `-vg1000-lv 252:0    0   3.6T  0 lvm
>>>> `-sda6            8:6    0   2.7T  0 part
>>>>    `-md3           9:3    0   2.7T  0 raid1
>>>>      `-vg1000-lv 252:0    0   3.6T  0 lvm
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# cat /proc/mdstat
>>>> Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
>>>> md3 : active (auto-read-only) raid1 sda6[1]
>>>>        2924343040 blocks super 1.2 [2/1] [_U]
>>>>
>>>> md2 : active raid1 sda5[3]
>>>>        971931456 blocks super 1.2 [2/1] [U_]
>>>>
>>>> unused devices: <none>
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# lvm pvscan
>>>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>>>> the VG to update.
>>>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>>>> the VG to update.
>>>>    PV /dev/md2   VG vg1000          lvm2 [926.90 GiB / 0    free]
>>>>    PV /dev/md3   VG vg1000          lvm2 [2.72 TiB / 0    free]
>>>>    Total: 2 [<3.63 TiB] / in use: 2 [<3.63 TiB] / in no VG: 0 [0   ]
>>>>
>>>> root@user-NUC10i7FNH:~# lvm vgscan
>>>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>>>> the VG to update.
>>>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>>>> the VG to update.
>>>>    Found volume group "vg1000" using metadata type lvm2
>>>>
>>>> root@user-NUC10i7FNH:~# lvm lvscan
>>>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>>>> the VG to update.
>>>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>>>> the VG to update.
>>>>    ACTIVE            '/dev/vg1000/lv' [<3.63 TiB] inherit
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# mount -t btrfs -o rescue=all,ro 
>>>> /dev/vg1000/lv /
>>>> mnt/test/
>>>> mount: /mnt/test: can't read superblock on /dev/mapper/vg1000-lv.
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# ll /dev/vg1000/lv /dev/mapper/vg1000-lv
>>>> lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/mapper/vg1000-lv -> 
>>>> ../dm-0
>>>> lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/vg1000/lv -> ../dm-0
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# tail log/kern.log
>>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.255079] BTRFS: device
>>>> label 2017.12.01-16:57:32 v15217 devid 1 transid 15800483 /dev/mapper/
>>>> vg1000-lv scanned by mount (2939)
>>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257012] BTRFS info
>>>> (device dm-0): first mount of filesystem
>>>> 320f5288-777d-43eb-84e3-4ac70573ec6b
>>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257061] BTRFS info
>>>> (device dm-0): using crc32c (crc32c-intel) checksum algorithm
>>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257079] BTRFS info
>>>> (device dm-0): disk space caching is enabled
>>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650935] BTRFS critical
>>>> (device dm-0: state C): corrupt leaf: root=257 block=2691220668416
>>>> slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
>>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650969] BTRFS error
>>>> (device dm-0: state C): read time tree block corruption detected on
>>>> logical 2691220668416 mirror 1
>>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654160] BTRFS critical
>>>> (device dm-0: state C): corrupt leaf: root=257 block=2691220668416
>>>> slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
>>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654189] BTRFS error
>>>> (device dm-0: state C): read time tree block corruption detected on
>>>> logical 2691220668416 mirror 2
>>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654337] BTRFS info
>>>> (device dm-0: state C): last unmount of filesystem
>>>> 320f5288-777d-43eb-84e3-4ac70573ec6b
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# btrfs rescue super-recover -v /dev/vg1000/lv
>>>> All Devices:
>>>>          Device: id = 1, name = /dev/vg1000/lv
>>>>
>>>> Before Recovering:
>>>>          [All good supers]:
>>>>                  device name = /dev/vg1000/lv
>>>>                  superblock bytenr = 65536
>>>>
>>>>                  device name = /dev/vg1000/lv
>>>>                  superblock bytenr = 67108864
>>>>
>>>>                  device name = /dev/vg1000/lv
>>>>                  superblock bytenr = 274877906944
>>>>
>>>>          [All bad supers]:
>>>>
>>>> All supers are valid, no need to recover
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# btrfs rescue zero-log /dev/vg1000/lv
>>>> Clearing log on /dev/vg1000/lv, previous log_root 0, level 0
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# btrfs check /dev/vg1000/lv
>>>> Opening filesystem to check...
>>>> Checking filesystem on /dev/vg1000/lv
>>>> UUID: 320f5288-777d-43eb-84e3-4ac70573ec6b
>>>> [1/7] checking root items
>>>> [2/7] checking extents
>>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>>> ignoring invalid key
>>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>>> [...line repeated many times
>>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>>> ignoring invalid key
>>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>>> ignoring invalid key
>>>> [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 2726275964928 bytes used, no error found
>>>> total csum bytes: 839025944
>>>> total tree bytes: 3015049216
>>>> total fs tree bytes: 1991966720
>>>> total extent tree bytes: 95895552
>>>> btree space waste bytes: 555710555
>>>> file data blocks allocated: 3567579688960
>>>>   referenced 2977409900544
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# btrfs property get /dev/mapper/vg1000-lv
>>>> label=2017.12.01-16:57:32 v15217
>>>>
>>>>
>>>> root@user-NUC10i7FNH:~# btrfs version
>>>> btrfs-progs v5.16.2
>>>>
>>>>
>>>> The most surprising is that on a Windows 10, "DiskInternals Linux
>>>> Reader" (a paid software) shows me the content of this disk (and 
>>>> asks me
>>>> to pay for copying the data).
>>>>
>>>>
>>>> Any idea ?
>>>>
>>>>
>>>>
>>>
>>
>>
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mount: can't read superblock on - corrupt leaf - read time tree block corruption detected
  2024-10-03 10:32       ` cwalou
@ 2024-10-03 21:05         ` Qu Wenruo
  0 siblings, 0 replies; 9+ messages in thread
From: Qu Wenruo @ 2024-10-03 21:05 UTC (permalink / raw)
  To: cwalou@gmail.com, Qu Wenruo, linux-btrfs



在 2024/10/3 20:02, cwalou@gmail.com 写道:
> Le 03/10/2024 à 12:12, Qu Wenruo a écrit :
>>
>>
>> 在 2024/10/3 18:50, cwalou@gmail.com 写道:
>>> Le 03/10/2024 à 10:08, Qu Wenruo a écrit :
>>>>
>>>>
>>>> 在 2024/10/3 17:02, cwalou@gmail.com 写道:
>>>>> Hello.
>>>>>
>>>>> A 4TB drive taken out of a synology NAS. When I try to mount it, it
>>>>> won't. This is what I did :
>>>>
>>>> Synology has out-of-tree features that upstream kernel doesn't support.
>>>>
>>>> Please ask the vendor for their support.
>>>>
>>>> Thanks,
>>>> Qu
>>>
>>> Thank you for your answer.
>>>
>>> Just for my general knowledge, can you explain me what "out-of-tree
>>> features" means ?
>>
>> Out-of-tree means it's not merged into the upstream Linux kernel.
>>
>> Furthermore, they do not even bother to put a special compat-ro/
>> incompact flags into the super block.
>>
>> So upstream kernel will not even know the fs has unsupported features,
>> until the tree-checker checks the inode flags.
>>
>> Thanks,
>> Qu
>>
>
> Before I start a quest at Synology.
> Is there any way to get around the "can't read superblock on /dev/
> mapper/vg1000-lv." problem?
>
> I mean, is there an option I can pass to 'mount' to skip superblock
> check? Or is there a way to tell him a superblock is available at
> "65536" ("67108864" or "274877906944" which "btrfs rescue super-recover
> -v" tells me are good, see below) ?

The problem is not superblock, but the extra inode flags introduced:

Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650935] BTRFS critical
(device dm-0: state C): corrupt leaf: root=257 block=2691220668416
slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650969] BTRFS error
(device dm-0: state C): read time tree block corruption detected on
logical 2691220668416 mirror 1

So far there is no way to disable tree-checker (the sanity checks), as
it brings so many benefits that we can not ignore.

>
> My apologies if my questions seem naive. But file systems and storage
> media are not really my specialty. I'm just trying to help an
> acquaintance who has been diligently backing up his data but is now
> stuck restoring his data.
>
> I think if we solve this problem on this public list, it may help more
> people. That's why even I need to ask synology for help, I'll give
> feedback here.

Unfortunately, to the fs those unknown flags can also be an indicator of
bitflip, thus tree-checker rejects anything that it can not understand.

Considering how frequently those hardware memory bitflips are reported,
we do not provide a way to disable such comprehensive checks.

So this means any new feature introduced by non-upstream contributor
will be rejected, even if most of the fs can still be understood by
upstream kernel.

Thanks,
Qu
>
> Nevertheless, thank you for the answers you already gave me, for taking
> the time to answer me.
>
>>>
>>> I'll ask synology what's happening. Once I'll find a solution (if one
>>> day I find one) I'll let know here.
>>>
>>> Kind regards,
>>>
>>> Walou.
>>>
>>>
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# fdisk -l /dev/sda
>>>>> Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
>>>>> Disk model: 001-2MA101
>>>>> Units: sectors of 1 * 512 = 512 bytes
>>>>> Sector size (logical/physical): 512 bytes / 512 bytes
>>>>> I/O size (minimum/optimal): 512 bytes / 512 bytes
>>>>> Disklabel type: gpt
>>>>> Disk identifier: B7B80A4B-0294-44FD-A368-74B0455D6AF2
>>>>>
>>>>> Device          Start        End    Sectors   Size Type
>>>>> /dev/sda1        8192   16785407   16777216     8G Linux RAID
>>>>> /dev/sda2    16785408   20979711    4194304     2G Linux RAID
>>>>> /dev/sda5    21257952 1965122911 1943864960 926.9G Linux RAID
>>>>> /dev/sda6  1965139008 7813827135 5848688128   2.7T Linux RAID
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# lsblk
>>>>> NAME            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
>>>>> sda               8:0    0   3.6T  0 disk
>>>>> |-sda1            8:1    0     8G  0 part
>>>>> |-sda2            8:2    0     2G  0 part
>>>>> |-sda5            8:5    0 926.9G  0 part
>>>>> | `-md2           9:2    0 926.9G  0 raid1
>>>>> |   `-vg1000-lv 252:0    0   3.6T  0 lvm
>>>>> `-sda6            8:6    0   2.7T  0 part
>>>>>    `-md3           9:3    0   2.7T  0 raid1
>>>>>      `-vg1000-lv 252:0    0   3.6T  0 lvm
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# cat /proc/mdstat
>>>>> Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
>>>>> md3 : active (auto-read-only) raid1 sda6[1]
>>>>>        2924343040 blocks super 1.2 [2/1] [_U]
>>>>>
>>>>> md2 : active raid1 sda5[3]
>>>>>        971931456 blocks super 1.2 [2/1] [U_]
>>>>>
>>>>> unused devices: <none>
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# lvm pvscan
>>>>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>>>>> the VG to update.
>>>>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>>>>> the VG to update.
>>>>>    PV /dev/md2   VG vg1000          lvm2 [926.90 GiB / 0    free]
>>>>>    PV /dev/md3   VG vg1000          lvm2 [2.72 TiB / 0    free]
>>>>>    Total: 2 [<3.63 TiB] / in use: 2 [<3.63 TiB] / in no VG: 0 [0   ]
>>>>>
>>>>> root@user-NUC10i7FNH:~# lvm vgscan
>>>>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>>>>> the VG to update.
>>>>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>>>>> the VG to update.
>>>>>    Found volume group "vg1000" using metadata type lvm2
>>>>>
>>>>> root@user-NUC10i7FNH:~# lvm lvscan
>>>>>    WARNING: PV /dev/md2 in VG vg1000 is using an old PV header, modify
>>>>> the VG to update.
>>>>>    WARNING: PV /dev/md3 in VG vg1000 is using an old PV header, modify
>>>>> the VG to update.
>>>>>    ACTIVE            '/dev/vg1000/lv' [<3.63 TiB] inherit
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# mount -t btrfs -o rescue=all,ro /dev/
>>>>> vg1000/lv /
>>>>> mnt/test/
>>>>> mount: /mnt/test: can't read superblock on /dev/mapper/vg1000-lv.
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# ll /dev/vg1000/lv /dev/mapper/vg1000-lv
>>>>> lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/mapper/vg1000-lv -
>>>>> > ../dm-0
>>>>> lrwxrwxrwx 1 root root 7 oct.   2 17:34 /dev/vg1000/lv -> ../dm-0
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# tail log/kern.log
>>>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.255079] BTRFS: device
>>>>> label 2017.12.01-16:57:32 v15217 devid 1 transid 15800483 /dev/mapper/
>>>>> vg1000-lv scanned by mount (2939)
>>>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257012] BTRFS info
>>>>> (device dm-0): first mount of filesystem
>>>>> 320f5288-777d-43eb-84e3-4ac70573ec6b
>>>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257061] BTRFS info
>>>>> (device dm-0): using crc32c (crc32c-intel) checksum algorithm
>>>>> Oct  2 17:30:57 user-NUC10i7FNH kernel: [ 1697.257079] BTRFS info
>>>>> (device dm-0): disk space caching is enabled
>>>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650935] BTRFS critical
>>>>> (device dm-0: state C): corrupt leaf: root=257 block=2691220668416
>>>>> slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
>>>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.650969] BTRFS error
>>>>> (device dm-0: state C): read time tree block corruption detected on
>>>>> logical 2691220668416 mirror 1
>>>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654160] BTRFS critical
>>>>> (device dm-0: state C): corrupt leaf: root=257 block=2691220668416
>>>>> slot=0 ino=6039235, unknown incompat flags detected: 0x40000000
>>>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654189] BTRFS error
>>>>> (device dm-0: state C): read time tree block corruption detected on
>>>>> logical 2691220668416 mirror 2
>>>>> Oct  2 17:31:01 user-NUC10i7FNH kernel: [ 1701.654337] BTRFS info
>>>>> (device dm-0: state C): last unmount of filesystem
>>>>> 320f5288-777d-43eb-84e3-4ac70573ec6b
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# btrfs rescue super-recover -v /dev/vg1000/lv
>>>>> All Devices:
>>>>>          Device: id = 1, name = /dev/vg1000/lv
>>>>>
>>>>> Before Recovering:
>>>>>          [All good supers]:
>>>>>                  device name = /dev/vg1000/lv
>>>>>                  superblock bytenr = 65536
>>>>>
>>>>>                  device name = /dev/vg1000/lv
>>>>>                  superblock bytenr = 67108864
>>>>>
>>>>>                  device name = /dev/vg1000/lv
>>>>>                  superblock bytenr = 274877906944
>>>>>
>>>>>          [All bad supers]:
>>>>>
>>>>> All supers are valid, no need to recover
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# btrfs rescue zero-log /dev/vg1000/lv
>>>>> Clearing log on /dev/vg1000/lv, previous log_root 0, level 0
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# btrfs check /dev/vg1000/lv
>>>>> Opening filesystem to check...
>>>>> Checking filesystem on /dev/vg1000/lv
>>>>> UUID: 320f5288-777d-43eb-84e3-4ac70573ec6b
>>>>> [1/7] checking root items
>>>>> [2/7] checking extents
>>>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>>>> ignoring invalid key
>>>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>>>> [...line repeated many times
>>>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>>>> ignoring invalid key
>>>>> Invalid key type(BLOCK_GROUP_ITEM) found in root(202)
>>>>> ignoring invalid key
>>>>> [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 2726275964928 bytes used, no error found
>>>>> total csum bytes: 839025944
>>>>> total tree bytes: 3015049216
>>>>> total fs tree bytes: 1991966720
>>>>> total extent tree bytes: 95895552
>>>>> btree space waste bytes: 555710555
>>>>> file data blocks allocated: 3567579688960
>>>>>   referenced 2977409900544
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# btrfs property get /dev/mapper/vg1000-lv
>>>>> label=2017.12.01-16:57:32 v15217
>>>>>
>>>>>
>>>>> root@user-NUC10i7FNH:~# btrfs version
>>>>> btrfs-progs v5.16.2
>>>>>
>>>>>
>>>>> The most surprising is that on a Windows 10, "DiskInternals Linux
>>>>> Reader" (a paid software) shows me the content of this disk (and
>>>>> asks me
>>>>> to pay for copying the data).
>>>>>
>>>>>
>>>>> Any idea ?
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mount: can't read superblock on - corrupt leaf - read time tree block corruption detected
  2024-10-03  8:08 ` Qu Wenruo
  2024-10-03  9:20   ` cwalou
@ 2024-10-08 19:32   ` Johannes Hirte
  2024-10-08 21:01     ` Qu Wenruo
  1 sibling, 1 reply; 9+ messages in thread
From: Johannes Hirte @ 2024-10-08 19:32 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: cwalou@gmail.com, linux-btrfs

On 2024 Okt 03, Qu Wenruo wrote:
>  
> 在 2024/10/3 17:02, cwalou@gmail.com 写道:
> > Hello.
> > 
> > A 4TB drive taken out of a synology NAS. When I try to mount it, it
> > won't. This is what I did :
> 
> Synology has out-of-tree features that upstream kernel doesn't support.
>

Hello,

I've noticed similar errors on my server too. It's a gentoo box with
vanilla kernel. It happend first with linux-6.10.9 and happens with 6.11
too:

[   67.310316] BTRFS: device label bigraid1 devid 1 transid 98985 /dev/sdd1 (8:49) scanned by mount (4069)
[   67.313109] BTRFS info (device sdd1): first mount of filesystem 83a02224-c807-4e70-a2cd-8b7156bfbbd2
[   67.313137] BTRFS info (device sdd1): using crc32c (crc32c-generic) checksum algorithm
[   67.313156] BTRFS info (device sdd1): using free-space-tree
[   67.527088] page: refcount:4 mapcount:0 mapping:000000004bf8c7c2 index:0x2ffb1be8 pfn:0x11b55c
[   67.527114] memcg:ffff8881174ab800
[   67.527120] aops:0xffffffff8206c960 ino:1
[   67.527129] flags: 0x2000000000004000(private|node=0|zone=2)
[   67.527144] raw: 2000000000004000 0000000000000000 dead000000000122 ffff8881022c9678
[   67.527152] raw: 000000002ffb1be8 ffff88811b5304b0 00000004ffffffff ffff8881174ab800
[   67.527157] page dumped because: eb page dump
[   67.527162] BTRFS critical (device sdd1): corrupt leaf: block=3297221967872 slot=47 extent bytenr=2176663552 len=36864 invalid data ref objectid value 259
[   67.527179] BTRFS error (device sdd1): read time tree block corruption detected on logical 3297221967872 mirror 1
[   67.535814] page: refcount:4 mapcount:0 mapping:000000004bf8c7c2 index:0x2ffb1be8 pfn:0x11b55c
[   67.535872] memcg:ffff8881174ab800
[   67.535877] aops:0xffffffff8206c960 ino:1
[   67.535886] flags: 0x2000000000004000(private|node=0|zone=2)
[   67.535900] raw: 2000000000004000 0000000000000000 dead000000000122 ffff8881022c9678
[   67.535907] raw: 000000002ffb1be8 ffff88811b5304b0 00000004ffffffff ffff8881174ab800
[   67.535912] page dumped because: eb page dump
[   67.535917] BTRFS critical (device sdd1): corrupt leaf: block=3297221967872 slot=47 extent bytenr=2176663552 len=36864 invalid data ref objectid value 259
[   67.535931] BTRFS error (device sdd1): read time tree block corruption detected on logical 3297221967872 mirror 2
[   67.535996] BTRFS error (device sdd1): failed to read block groups: -5
[   67.539666] BTRFS error (device sdd1): open_ctree failed
[   70.026232] BTRFS info (device sdb1): first mount of filesystem cae06473-5f45-4cd4-a822-733c036e36d9
[   70.026270] BTRFS info (device sdb1): using crc32c (crc32c-generic) checksum algorithm
[   70.026300] BTRFS info (device sdb1): disk space caching is enabled
[   70.026306] BTRFS warning (device sdb1): space cache v1 is being deprecated and will be removed in a future release, please use -o space_cache=v2
[   70.130069] page: refcount:3 mapcount:0 mapping:00000000a884d48d index:0x5abd618 pfn:0x11b665
[   70.130094] memcg:ffff8881174ab800
[   70.130100] aops:0xffffffff8206c960 ino:1
[   70.130110] flags: 0x2400000000004020(lru|private|node=0|zone=2)
[   70.130126] raw: 2400000000004020 ffffea00046d9908 ffffea00046d9988 ffff888102262618
[   70.130134] raw: 0000000005abd618 ffff88811b63a4b0 00000003ffffffff ffff8881174ab800
[   70.130139] page dumped because: eb page dump
[   70.130144] BTRFS critical (device sdb1): corrupt leaf: block=389724340224 slot=7 extent bytenr=12652544 len=36864 invalid data ref objectid value 258
[   70.130160] BTRFS error (device sdb1): read time tree block corruption detected on logical 389724340224 mirror 2
[   70.136382] page: refcount:3 mapcount:0 mapping:00000000a884d48d index:0x5abd618 pfn:0x11b665
[   70.136404] memcg:ffff8881174ab800
[   70.136409] aops:0xffffffff8206c960 ino:1
[   70.136418] flags: 0x2400000000004020(lru|private|node=0|zone=2)
[   70.136431] raw: 2400000000004020 ffffea00046d9908 ffffea00046d9988 ffff888102262618
[   70.136439] raw: 0000000005abd618 ffff88811b63a4b0 00000003ffffffff ffff8881174ab800
[   70.136443] page dumped because: eb page dump
[   70.136448] BTRFS critical (device sdb1): corrupt leaf: block=389724340224 slot=7 extent bytenr=12652544 len=36864 invalid data ref objectid value 258
[   70.136462] BTRFS error (device sdb1): read time tree block corruption detected on logical 389724340224 mirror 1
[   70.136555] BTRFS error (device sdb1): failed to read block groups: -5
[   70.138216] BTRFS error (device sdb1): open_ctree failed
[   71.825004] BTRFS: device label BIGBIGRAID devid 1 transid 4121 /dev/sde1 (8:65) scanned by mount (4102)
[   71.826496] BTRFS info (device sde1): first mount of filesystem c9fa0269-733e-4e76-88c9-68c8247c81e5
[   71.826532] BTRFS info (device sde1): using crc32c (crc32c-generic) checksum algorithm
[   71.826561] BTRFS info (device sde1): using free-space-tree
[  140.718646] BTRFS info (device sdb1): first mount of filesystem cae06473-5f45-4cd4-a822-733c036e36d9
[  140.718683] BTRFS info (device sdb1): using crc32c (crc32c-generic) checksum algorithm
[  140.718711] BTRFS info (device sdb1): disk space caching is enabled
[  140.718717] BTRFS warning (device sdb1): space cache v1 is being deprecated and will be removed in a future release, please use -o space_cache=v2
[  140.845547] page: refcount:4 mapcount:0 mapping:0000000049bde2be index:0x5abd618 pfn:0x11d9a3
[  140.845571] memcg:ffff8881174ab800
[  140.845578] aops:0xffffffff8206c960 ino:1
[  140.845587] flags: 0x2000000000004000(private|node=0|zone=2)
[  140.845602] raw: 2000000000004000 0000000000000000 dead000000000122 ffff888102262de8
[  140.845611] raw: 0000000005abd618 ffff88811d96f5a0 00000004ffffffff ffff8881174ab800
[  140.845615] page dumped because: eb page dump
[  140.845621] BTRFS critical (device sdb1): corrupt leaf: block=389724340224 slot=7 extent bytenr=12652544 len=36864 invalid data ref objectid value 258
[  140.845636] BTRFS error (device sdb1): read time tree block corruption detected on logical 389724340224 mirror 1
[  140.846180] page: refcount:4 mapcount:0 mapping:0000000049bde2be index:0x5abd618 pfn:0x11d9a3
[  140.846202] memcg:ffff8881174ab800
[  140.846208] aops:0xffffffff8206c960 ino:1
[  140.846216] flags: 0x2000000000004000(private|node=0|zone=2)
[  140.846229] raw: 2000000000004000 0000000000000000 dead000000000122 ffff888102262de8
[  140.846236] raw: 0000000005abd618 ffff88811d96f5a0 00000004ffffffff ffff8881174ab800
[  140.846240] page dumped because: eb page dump
[  140.846245] BTRFS critical (device sdb1): corrupt leaf: block=389724340224 slot=7 extent bytenr=12652544 len=36864 invalid data ref objectid value 258
[  140.846259] BTRFS error (device sdb1): read time tree block corruption detected on logical 389724340224 mirror 2
[  140.846329] BTRFS error (device sdb1): failed to read block groups: -5
[  140.848015] BTRFS error (device sdb1): open_ctree failed


It seems following commit is responsible:

commit f333a3c7e8323499aa65038e77fe8f3199d4e283
Author: Qu Wenruo <wqu@suse.com>
Date:   Mon Jul 15 16:07:07 2024 +0930

    btrfs: tree-checker: validate dref root and objectid


After reverting this, I'm able to mount the filesystems again. There are
three filesystems on this server that are affected, two single disk and
one with two disk in RAID1/0. I was able to copy all data from all
filesytems via rsync without noticing any error when running without
this commit. Also btrfscheck doesn't notice any error. It's just this
commit that prevents these three filesystem from mounting. As I was able
to get all data this is not critical to me. But I think this should be
addressed in some way.

regards,
  Johannes

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mount: can't read superblock on - corrupt leaf - read time tree block corruption detected
  2024-10-08 19:32   ` Johannes Hirte
@ 2024-10-08 21:01     ` Qu Wenruo
  2024-10-09 15:00       ` Johannes Hirte
  0 siblings, 1 reply; 9+ messages in thread
From: Qu Wenruo @ 2024-10-08 21:01 UTC (permalink / raw)
  To: Johannes Hirte; +Cc: cwalou@gmail.com, linux-btrfs



在 2024/10/9 06:02, Johannes Hirte 写道:
> On 2024 Okt 03, Qu Wenruo wrote:
>>
>> 在 2024/10/3 17:02, cwalou@gmail.com 写道:
>>> Hello.
>>>
>>> A 4TB drive taken out of a synology NAS. When I try to mount it, it
>>> won't. This is what I did :
>>
>> Synology has out-of-tree features that upstream kernel doesn't support.
>>
>
> Hello,
>
> I've noticed similar errors on my server too. It's a gentoo box with
> vanilla kernel. It happend first with linux-6.10.9 and happens with 6.11
> too:

This is a different one from the original report.

>
> [   67.310316] BTRFS: device label bigraid1 devid 1 transid 98985 /dev/sdd1 (8:49) scanned by mount (4069)
> [   67.313109] BTRFS info (device sdd1): first mount of filesystem 83a02224-c807-4e70-a2cd-8b7156bfbbd2
> [   67.313137] BTRFS info (device sdd1): using crc32c (crc32c-generic) checksum algorithm
> [   67.313156] BTRFS info (device sdd1): using free-space-tree
> [   67.527088] page: refcount:4 mapcount:0 mapping:000000004bf8c7c2 index:0x2ffb1be8 pfn:0x11b55c
> [   67.527114] memcg:ffff8881174ab800
> [   67.527120] aops:0xffffffff8206c960 ino:1
> [   67.527129] flags: 0x2000000000004000(private|node=0|zone=2)
> [   67.527144] raw: 2000000000004000 0000000000000000 dead000000000122 ffff8881022c9678
> [   67.527152] raw: 000000002ffb1be8 ffff88811b5304b0 00000004ffffffff ffff8881174ab800
> [   67.527157] page dumped because: eb page dump
> [   67.527162] BTRFS critical (device sdd1): corrupt leaf: block=3297221967872 slot=47 extent bytenr=2176663552 len=36864 invalid data ref objectid value 259

This is caused by the long deprecated inode_cache feature.

Newer btrfs-check can report it as an error.

You can fix it by "btrfs rescue clear-ino-cache <device>" on the
unmounted fs, using btrfs-progs v6.11 (the command is there for a long
time, but has some small bugs).

Thanks,
Qu
> [   67.527179] BTRFS error (device sdd1): read time tree block corruption detected on logical 3297221967872 mirror 1
> [   67.535814] page: refcount:4 mapcount:0 mapping:000000004bf8c7c2 index:0x2ffb1be8 pfn:0x11b55c
> [   67.535872] memcg:ffff8881174ab800
> [   67.535877] aops:0xffffffff8206c960 ino:1
> [   67.535886] flags: 0x2000000000004000(private|node=0|zone=2)
> [   67.535900] raw: 2000000000004000 0000000000000000 dead000000000122 ffff8881022c9678
> [   67.535907] raw: 000000002ffb1be8 ffff88811b5304b0 00000004ffffffff ffff8881174ab800
> [   67.535912] page dumped because: eb page dump
> [   67.535917] BTRFS critical (device sdd1): corrupt leaf: block=3297221967872 slot=47 extent bytenr=2176663552 len=36864 invalid data ref objectid value 259
> [   67.535931] BTRFS error (device sdd1): read time tree block corruption detected on logical 3297221967872 mirror 2
> [   67.535996] BTRFS error (device sdd1): failed to read block groups: -5
> [   67.539666] BTRFS error (device sdd1): open_ctree failed
> [   70.026232] BTRFS info (device sdb1): first mount of filesystem cae06473-5f45-4cd4-a822-733c036e36d9
> [   70.026270] BTRFS info (device sdb1): using crc32c (crc32c-generic) checksum algorithm
> [   70.026300] BTRFS info (device sdb1): disk space caching is enabled
> [   70.026306] BTRFS warning (device sdb1): space cache v1 is being deprecated and will be removed in a future release, please use -o space_cache=v2
> [   70.130069] page: refcount:3 mapcount:0 mapping:00000000a884d48d index:0x5abd618 pfn:0x11b665
> [   70.130094] memcg:ffff8881174ab800
> [   70.130100] aops:0xffffffff8206c960 ino:1
> [   70.130110] flags: 0x2400000000004020(lru|private|node=0|zone=2)
> [   70.130126] raw: 2400000000004020 ffffea00046d9908 ffffea00046d9988 ffff888102262618
> [   70.130134] raw: 0000000005abd618 ffff88811b63a4b0 00000003ffffffff ffff8881174ab800
> [   70.130139] page dumped because: eb page dump
> [   70.130144] BTRFS critical (device sdb1): corrupt leaf: block=389724340224 slot=7 extent bytenr=12652544 len=36864 invalid data ref objectid value 258
> [   70.130160] BTRFS error (device sdb1): read time tree block corruption detected on logical 389724340224 mirror 2
> [   70.136382] page: refcount:3 mapcount:0 mapping:00000000a884d48d index:0x5abd618 pfn:0x11b665
> [   70.136404] memcg:ffff8881174ab800
> [   70.136409] aops:0xffffffff8206c960 ino:1
> [   70.136418] flags: 0x2400000000004020(lru|private|node=0|zone=2)
> [   70.136431] raw: 2400000000004020 ffffea00046d9908 ffffea00046d9988 ffff888102262618
> [   70.136439] raw: 0000000005abd618 ffff88811b63a4b0 00000003ffffffff ffff8881174ab800
> [   70.136443] page dumped because: eb page dump
> [   70.136448] BTRFS critical (device sdb1): corrupt leaf: block=389724340224 slot=7 extent bytenr=12652544 len=36864 invalid data ref objectid value 258
> [   70.136462] BTRFS error (device sdb1): read time tree block corruption detected on logical 389724340224 mirror 1
> [   70.136555] BTRFS error (device sdb1): failed to read block groups: -5
> [   70.138216] BTRFS error (device sdb1): open_ctree failed
> [   71.825004] BTRFS: device label BIGBIGRAID devid 1 transid 4121 /dev/sde1 (8:65) scanned by mount (4102)
> [   71.826496] BTRFS info (device sde1): first mount of filesystem c9fa0269-733e-4e76-88c9-68c8247c81e5
> [   71.826532] BTRFS info (device sde1): using crc32c (crc32c-generic) checksum algorithm
> [   71.826561] BTRFS info (device sde1): using free-space-tree
> [  140.718646] BTRFS info (device sdb1): first mount of filesystem cae06473-5f45-4cd4-a822-733c036e36d9
> [  140.718683] BTRFS info (device sdb1): using crc32c (crc32c-generic) checksum algorithm
> [  140.718711] BTRFS info (device sdb1): disk space caching is enabled
> [  140.718717] BTRFS warning (device sdb1): space cache v1 is being deprecated and will be removed in a future release, please use -o space_cache=v2
> [  140.845547] page: refcount:4 mapcount:0 mapping:0000000049bde2be index:0x5abd618 pfn:0x11d9a3
> [  140.845571] memcg:ffff8881174ab800
> [  140.845578] aops:0xffffffff8206c960 ino:1
> [  140.845587] flags: 0x2000000000004000(private|node=0|zone=2)
> [  140.845602] raw: 2000000000004000 0000000000000000 dead000000000122 ffff888102262de8
> [  140.845611] raw: 0000000005abd618 ffff88811d96f5a0 00000004ffffffff ffff8881174ab800
> [  140.845615] page dumped because: eb page dump
> [  140.845621] BTRFS critical (device sdb1): corrupt leaf: block=389724340224 slot=7 extent bytenr=12652544 len=36864 invalid data ref objectid value 258
> [  140.845636] BTRFS error (device sdb1): read time tree block corruption detected on logical 389724340224 mirror 1
> [  140.846180] page: refcount:4 mapcount:0 mapping:0000000049bde2be index:0x5abd618 pfn:0x11d9a3
> [  140.846202] memcg:ffff8881174ab800
> [  140.846208] aops:0xffffffff8206c960 ino:1
> [  140.846216] flags: 0x2000000000004000(private|node=0|zone=2)
> [  140.846229] raw: 2000000000004000 0000000000000000 dead000000000122 ffff888102262de8
> [  140.846236] raw: 0000000005abd618 ffff88811d96f5a0 00000004ffffffff ffff8881174ab800
> [  140.846240] page dumped because: eb page dump
> [  140.846245] BTRFS critical (device sdb1): corrupt leaf: block=389724340224 slot=7 extent bytenr=12652544 len=36864 invalid data ref objectid value 258
> [  140.846259] BTRFS error (device sdb1): read time tree block corruption detected on logical 389724340224 mirror 2
> [  140.846329] BTRFS error (device sdb1): failed to read block groups: -5
> [  140.848015] BTRFS error (device sdb1): open_ctree failed
>
>
> It seems following commit is responsible:
>
> commit f333a3c7e8323499aa65038e77fe8f3199d4e283
> Author: Qu Wenruo <wqu@suse.com>
> Date:   Mon Jul 15 16:07:07 2024 +0930
>
>      btrfs: tree-checker: validate dref root and objectid
>
>
> After reverting this, I'm able to mount the filesystems again. There are
> three filesystems on this server that are affected, two single disk and
> one with two disk in RAID1/0. I was able to copy all data from all
> filesytems via rsync without noticing any error when running without
> this commit. Also btrfscheck doesn't notice any error. It's just this
> commit that prevents these three filesystem from mounting. As I was able
> to get all data this is not critical to me. But I think this should be
> addressed in some way.
>
> regards,
>    Johannes


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mount: can't read superblock on - corrupt leaf - read time tree block corruption detected
  2024-10-08 21:01     ` Qu Wenruo
@ 2024-10-09 15:00       ` Johannes Hirte
  0 siblings, 0 replies; 9+ messages in thread
From: Johannes Hirte @ 2024-10-09 15:00 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: cwalou@gmail.com, linux-btrfs

On 2024 Okt 09, Qu Wenruo wrote:
> 
> 
> 在 2024/10/9 06:02, Johannes Hirte 写道:
> > On 2024 Okt 03, Qu Wenruo wrote:
> > > 
> > > 在 2024/10/3 17:02, cwalou@gmail.com 写道:
> > > > Hello.
> > > > 
> > > > A 4TB drive taken out of a synology NAS. When I try to mount it, it
> > > > won't. This is what I did :
> > > 
> > > Synology has out-of-tree features that upstream kernel doesn't support.
> > > 
> > 
> > Hello,
> > 
> > I've noticed similar errors on my server too. It's a gentoo box with
> > vanilla kernel. It happend first with linux-6.10.9 and happens with 6.11
> > too:
> 
> This is a different one from the original report.
> 
> > 
> > [   67.310316] BTRFS: device label bigraid1 devid 1 transid 98985 /dev/sdd1 (8:49) scanned by mount (4069)
> > [   67.313109] BTRFS info (device sdd1): first mount of filesystem 83a02224-c807-4e70-a2cd-8b7156bfbbd2
> > [   67.313137] BTRFS info (device sdd1): using crc32c (crc32c-generic) checksum algorithm
> > [   67.313156] BTRFS info (device sdd1): using free-space-tree
> > [   67.527088] page: refcount:4 mapcount:0 mapping:000000004bf8c7c2 index:0x2ffb1be8 pfn:0x11b55c
> > [   67.527114] memcg:ffff8881174ab800
> > [   67.527120] aops:0xffffffff8206c960 ino:1
> > [   67.527129] flags: 0x2000000000004000(private|node=0|zone=2)
> > [   67.527144] raw: 2000000000004000 0000000000000000 dead000000000122 ffff8881022c9678
> > [   67.527152] raw: 000000002ffb1be8 ffff88811b5304b0 00000004ffffffff ffff8881174ab800
> > [   67.527157] page dumped because: eb page dump
> > [   67.527162] BTRFS critical (device sdd1): corrupt leaf: block=3297221967872 slot=47 extent bytenr=2176663552 len=36864 invalid data ref objectid value 259
> 
> This is caused by the long deprecated inode_cache feature.
> 
> Newer btrfs-check can report it as an error.
> 
> You can fix it by "btrfs rescue clear-ino-cache <device>" on the
> unmounted fs, using btrfs-progs v6.11 (the command is there for a long
> time, but has some small bugs).
> 
> Thanks,
> Qu

Thank you, this fixed it. Just one question, can't this be done automatically
at mount-time? Would be much more convenient than a system that doesn't come
back after kernel update.

regards,
  Johannes

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-10-09 15:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03  7:32 mount: can't read superblock on - corrupt leaf - read time tree block corruption detected cwalou
2024-10-03  8:08 ` Qu Wenruo
2024-10-03  9:20   ` cwalou
2024-10-03 10:12     ` Qu Wenruo
2024-10-03 10:32       ` cwalou
2024-10-03 21:05         ` Qu Wenruo
2024-10-08 19:32   ` Johannes Hirte
2024-10-08 21:01     ` Qu Wenruo
2024-10-09 15:00       ` Johannes Hirte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).