Skip to contentSkip to conversation

Unable to mount btrfs subvol with a new kernel

DISCUSSION mailcimbi 2 participants 3 messages Sep 17, 2021 – Sep 18, 2021 1 message not in the archive Btrfs file system

lore
Share & tools
lore

mailcimbi

author
#0 lore raw

Dear List,

I have two btrfs subvol in my fileset. I can mount it with lubuntu 18.04 but unable to mount with a newer version. Also unable to mount it when I upgrade to the latest 18.04. By the way upgrading to 20.04 (using the older kernel after upgrading to the latest 18.04) and starting it with an older kernel it is working.

I can reproduce it. Starting with lubuntu 21.04 live cd: unable to mount. Starting with lubuntu 18.04.2 live cd: I can mount it.

Here are the results:
lubuntu 18.04

root@lubuntu:~# uname -a
Linux lubuntu 4.18.0-15-generic #16~18.04.1-Ubuntu SMP Thu Feb 7 14:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
mounted btrfs with live cd
root@lubuntu:~# mount -t btrfs -o rw,subvol=@ /dev/sda3 /mnt
/dev/sda3        28G   14G   12G  55% /mnt
root@lubuntu:~# mount -t btrfs -o rw,subvol=@home /dev/sda3 /mnt/home
/dev/sda3        28G   14G   12G  55% /mnt/home
root@lubuntu:~# btrfs version
btrfs-progs v4.15.1

lubuntu 20.04

root@lubuntu:~# uname -a
Linux lubuntu 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
root@lubuntu:~# mount -t btrfs -o rw,subvol=@ /dev/sda3 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda3, missing codepage or helper program, or other error.
root@lubuntu:~# btrfs version
btrfs-progs v5.10.1

From the log it seems there is/are corrupt leaf(s)

[ 3231.406914] BTRFS critical (device sda3): corrupt leaf: block=1045233664 slot=17 extent bytenr=20209664 len=8192 invalid generation, have 895434752 expect (0, 3790778]
[ 3231.406922] BTRFS error (device sda3): block=1045233664 read time tree block corruption detected
[ 3231.406971] BTRFS error (device sda3): failed to read block groups: -5
[ 3231.409566] BTRFS error (device sda3): open_ctree failed

Do you have an idea how to solve it. When I try to check the subvols with btrfs check all seems to be fine in 18.04.

Thank you in advance.
Miklos

#1 lore raw
Quoted 35 lines · mailcimbi

Dear List,

I have two btrfs subvol in my fileset. I can mount it with lubuntu 18.04 but unable to mount with a newer version. Also unable to mount it when I upgrade to the latest 18.04. By the way upgrading to 20.04 (using the older kernel after upgrading to the latest 18.04) and starting it with an older kernel it is working.

I can reproduce it. Starting with lubuntu 21.04 live cd: unable to mount. Starting with lubuntu 18.04.2 live cd: I can mount it.

Here are the results:
lubuntu 18.04

root@lubuntu:~# uname -a
Linux lubuntu 4.18.0-15-generic #16~18.04.1-Ubuntu SMP Thu Feb 7
14:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
mounted btrfs with live cd
root@lubuntu:~# mount -t btrfs -o rw,subvol=@ /dev/sda3 /mnt
/dev/sda3        28G   14G   12G  55% /mnt
root@lubuntu:~# mount -t btrfs -o rw,subvol=@home /dev/sda3 /mnt/home
/dev/sda3        28G   14G   12G  55% /mnt/home
root@lubuntu:~# btrfs version
btrfs-progs v4.15.1

lubuntu 20.04

root@lubuntu:~# uname -a
Linux lubuntu 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC
2020 x86_64 x86_64 x86_64 GNU/Linux
root@lubuntu:~# mount -t btrfs -o rw,subvol=@ /dev/sda3 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda3,
missing codepage or helper program, or other error.
root@lubuntu:~# btrfs version
btrfs-progs v5.10.1
Quoted 4 lines

From the log it seems there is/are corrupt leaf(s)

[ 3231.406914] BTRFS critical (device sda3): corrupt leaf:

block=1045233664 slot=17 extent bytenr=20209664 len=8192 invalid generation, have 895434752 expect (0, 3790778]

Bad extent item generation, sometimes can be caused by older btrfs-check.

Please compile a newer btrfs-progs, and run "btrfs check" to make sure that's the only problem.

If that's the only problem (some problems like missing csum or missing holes can be ignored pretty safely), then you can use btrfs check --repair to repair it.

But please keep in mind, latest btrfs-progs is needed to do the repair.

Thanks,
Qu

Quoted 11 lines
[ 3231.406922] BTRFS error (device sda3): block=1045233664 read time
tree block corruption detected
[ 3231.406971] BTRFS error (device sda3): failed to read block groups: -5
[ 3231.409566] BTRFS error (device sda3): open_ctree failed

Do you have an idea how to solve it. When I try to check the subvols with btrfs check all seems to be fine in 18.04.

Thank you in advance.
Miklos

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 4 lines · mailcimbi

Hi Qu,

Thank you for your answer. Check and repair with a new btrfs solved the problem. I was able to use my subvols with new kernel.

Just a final recommendation, use kernel newer than v5.11 would prevent a lot of possible corruption in the first place, as in that kernel version we introduced write time tree block sanity check, which would reject any corruption (at the cost of transaction abort).

Thanks,
Qu

Quoted 75 lines

Thanks
Miklos

Quoted 69 lines · Qu Wenruo
Quoted 35 lines · mailcimbi

Dear List,

I have two btrfs subvol in my fileset. I can mount it with lubuntu 18.04 but unable to mount with a newer version. Also unable to mount it when I upgrade to the latest 18.04. By the way upgrading to 20.04 (using the older kernel after upgrading to the latest 18.04) and starting it with an older kernel it is working.

I can reproduce it. Starting with lubuntu 21.04 live cd: unable to mount. Starting with lubuntu 18.04.2 live cd: I can mount it.

Here are the results:
lubuntu 18.04

root@lubuntu:~# uname -a
Linux lubuntu 4.18.0-15-generic #16~18.04.1-Ubuntu SMP Thu Feb 7
14:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
mounted btrfs with live cd
root@lubuntu:~# mount -t btrfs -o rw,subvol=@ /dev/sda3 /mnt
/dev/sda3        28G   14G   12G  55% /mnt
root@lubuntu:~# mount -t btrfs -o rw,subvol=@home /dev/sda3 /mnt/home
/dev/sda3        28G   14G   12G  55% /mnt/home
root@lubuntu:~# btrfs version
btrfs-progs v4.15.1

lubuntu 20.04

root@lubuntu:~# uname -a
Linux lubuntu 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC
2020 x86_64 x86_64 x86_64 GNU/Linux
root@lubuntu:~# mount -t btrfs -o rw,subvol=@ /dev/sda3 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda3,
missing codepage or helper program, or other error.
root@lubuntu:~# btrfs version
btrfs-progs v5.10.1
Quoted 4 lines

 From the log it seems there is/are corrupt leaf(s)

[ 3231.406914] BTRFS critical (device sda3): corrupt leaf:

block=1045233664 slot=17 extent bytenr=20209664 len=8192 invalid generation, have 895434752 expect (0, 3790778]

Bad extent item generation, sometimes can be caused by older btrfs-check.

Please compile a newer btrfs-progs, and run "btrfs check" to make sure that's the only problem.

If that's the only problem (some problems like missing csum or missing holes can be ignored pretty safely), then you can use btrfs check --repair to repair it.

But please keep in mind, latest btrfs-progs is needed to do the repair.

Thanks,
Qu

Quoted 12 lines
[ 3231.406922] BTRFS error (device sda3): block=1045233664 read time
tree block corruption detected
[ 3231.406971] BTRFS error (device sda3): failed to read block
groups: -5
[ 3231.409566] BTRFS error (device sda3): open_ctree failed

Do you have an idea how to solve it. When I try to check the subvols with btrfs check all seems to be fine in 18.04.

Thank you in advance.
Miklos