linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* I can't mount image
@ 2020-05-17 19:51 Jiří Lisický
  2020-05-18 23:45 ` Chris Murphy
  0 siblings, 1 reply; 8+ messages in thread
From: Jiří Lisický @ 2020-05-17 19:51 UTC (permalink / raw)
  To: linux-btrfs

Hi, I have Jolla 1 Phone, which use btrfs. With bad battery, phone x times suddenly turned off. Now is bricked. I go into recovery mode
and copy image to my PC with Fedora Live 31 with kernel 5.6.6.

~ # losetup --find --show /home/jirka/tmp/jolla.img
/dev/loop0

~ # btrfs fi show
Label: 'sailfish'  uuid: 86180ca0-d351-4551-b262-22b49e1adf47
 Total devices 1 FS bytes used 4.73GiB
  devid    1 size 13.75GiB used 13.75GiB path /dev/loop0

~ # mount -t btrfs /dev/loop0 ~/mnt
mount: /dev/loop0: can't read superblock

~ # mount -t btrfs -o usebackuproot /dev/loop0 ~/mnt
mount: /dev/loop0: can't read superblock

~ # btrfs rescue super-recover /dev/loop0
All supers are valid, no need to recover

~ # LC_ALL=C btrfs rescue zero-log /dev/loop0
Clearing log on /dev/loop0, previous log_root 0, level 0

~ # LC_ALL=C mount -t btrfs /dev/loop0 ~/mnt
mount: mount /dev/loop0 on /root/mnt failed: No space left on device

~ # mount -t btrfs -o ro /dev/loop0 ~/mnt

~ # btrfs fi df ~/mnt
Data, single: total=13.08GiB, used=4.51GiB
System, DUP: total=8.00MiB, used=4.00KiB
System, single: total=4.00MiB, used=0.00B
Metadata, DUP: total=330.00MiB, used=224.30MiB
Metadata, single: total=8.00MiB, used=0.00B
GlobalReserve, single: total=512.00MiB, used=406.37MiB

~ # truncate --size=2GB ~/tmp/space
~ # losetup --find --show ~/tmp/space
/dev/loop1

~ # btrfs device add /dev/loop1 ~/mnt/
Performing full device TRIM /dev/loop1 (1.86GiB) ...
ERROR: error adding device '/dev/loop1': Read-only file system

When I mount, in syslog appears:
BTRFS info (device loop0): disk space caching is enabled
BTRFS info (device loop0): creating UUID tree
BTRFS warning (device loop0): block group 144703488 has wrong amount of free space
BTRFS warning (device loop0): failed to load free space cache for block group 144703488, rebuilding it now
BTRFS warning (device loop0): failed to create the UUID tree: -28
BTRFS: open_ctree failed

So now I can mount readonly, but is there any way to repair this filesystem?
Thanks Jirka


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

* Re: I can't mount image
  2020-05-17 19:51 I can't mount image Jiří Lisický
@ 2020-05-18 23:45 ` Chris Murphy
  2020-05-20 21:12   ` Jiří Lisický
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Murphy @ 2020-05-18 23:45 UTC (permalink / raw)
  To: Jiří Lisický; +Cc: Btrfs BTRFS

On Sun, May 17, 2020 at 1:54 PM Jiří Lisický <jiri_lisicky@seznam.cz> wrote:
>
> Hi, I have Jolla 1 Phone, which use btrfs. With bad battery, phone x times suddenly turned off. Now is bricked. I go into recovery mode
> and copy image to my PC with Fedora Live 31 with kernel 5.6.6.
>
> ~ # losetup --find --show /home/jirka/tmp/jolla.img
> /dev/loop0
>
> ~ # btrfs fi show
> Label: 'sailfish'  uuid: 86180ca0-d351-4551-b262-22b49e1adf47
>  Total devices 1 FS bytes used 4.73GiB
>   devid    1 size 13.75GiB used 13.75GiB path /dev/loop0
>
> ~ # mount -t btrfs /dev/loop0 ~/mnt
> mount: /dev/loop0: can't read superblock
>
> ~ # mount -t btrfs -o usebackuproot /dev/loop0 ~/mnt
> mount: /dev/loop0: can't read superblock
>
> ~ # btrfs rescue super-recover /dev/loop0
> All supers are valid, no need to recover

Weird. How does it not read the superblock, but all superblocks are
valid? What do you get for

btrfs insp dump-s -fa /dev/loop0


> ~ # LC_ALL=C btrfs rescue zero-log /dev/loop0
> Clearing log on /dev/loop0, previous log_root 0, level 0

This is not advised except in specific cases which the man page gives
examples of.


> ~ # btrfs fi df ~/mnt
> Data, single: total=13.08GiB, used=4.51GiB
> System, DUP: total=8.00MiB, used=4.00KiB
> System, single: total=4.00MiB, used=0.00B
> Metadata, DUP: total=330.00MiB, used=224.30MiB
> Metadata, single: total=8.00MiB, used=0.00B
> GlobalReserve, single: total=512.00MiB, used=406.37MiB
>
> ~ # truncate --size=2GB ~/tmp/space
> ~ # losetup --find --show ~/tmp/space
> /dev/loop1
>
> ~ # btrfs device add /dev/loop1 ~/mnt/
> Performing full device TRIM /dev/loop1 (1.86GiB) ...
> ERROR: error adding device '/dev/loop1': Read-only file system
>
> When I mount, in syslog appears:
> BTRFS info (device loop0): disk space caching is enabled
> BTRFS info (device loop0): creating UUID tree
> BTRFS warning (device loop0): block group 144703488 has wrong amount of free space
> BTRFS warning (device loop0): failed to load free space cache for block group 144703488, rebuilding it now
> BTRFS warning (device loop0): failed to create the UUID tree: -28
> BTRFS: open_ctree failed
>
> So now I can mount readonly, but is there any way to repair this filesystem?

Definitely get things off of it now while you can.

Fedora 31 has btrfs-progs 5.6 current. I suggest posting the output from

# btrfs check --readonly /dev/



-- 
Chris Murphy

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

* Re: I can't mount image
  2020-05-18 23:45 ` Chris Murphy
@ 2020-05-20 21:12   ` Jiří Lisický
  2020-05-20 21:54     ` Chris Murphy
  0 siblings, 1 reply; 8+ messages in thread
From: Jiří Lisický @ 2020-05-20 21:12 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Btrfs BTRFS

Chris Murphy píše v Po 18. 05. 2020 v 17:45 -0600:
> On Sun, May 17, 2020 at 1:54 PM Jiří Lisický <jiri_lisicky@seznam.cz> wrote:
> > 
> > Hi, I have Jolla 1 Phone, which use btrfs. With bad battery, phone x times suddenly turned off. Now is bricked. I go into recovery mode
> > and copy image to my PC with Fedora Live 31 with kernel 5.6.6.
> > 
> > ~ # losetup --find --show /home/jirka/tmp/jolla.img
> > /dev/loop0
> > 
> > ~ # btrfs fi show
> > Label: 'sailfish'  uuid: 86180ca0-d351-4551-b262-22b49e1adf47
> >  Total devices 1 FS bytes used 4.73GiB
> >   devid    1 size 13.75GiB used 13.75GiB path /dev/loop0
> > 
> > ~ # mount -t btrfs /dev/loop0 ~/mnt
> > mount: /dev/loop0: can't read superblock
> > 
> > ~ # mount -t btrfs -o usebackuproot /dev/loop0 ~/mnt
> > mount: /dev/loop0: can't read superblock
> > 
> > ~ # btrfs rescue super-recover /dev/loop0
> > All supers are valid, no need to recover
> 
> Weird. How does it not read the superblock, but all superblocks are
> valid? What do you get for
> 
> btrfs insp dump-s -fa /dev/loop0
OK, I made new copy of original image:
cp jolla-orig.img jolla1.img

Again mount (now as loop4)
losetup --find --show /home/jirka/tmp/jolla1.img
/dev/loop4

btrfs insp dump-s -fa /dev/loop4

superblock: bytenr=65536, device=/dev/loop4
---------------------------------------------------------
csum_type		0 (crc32c)
csum_size		4
csum			0xdc2c003a [match]
bytenr			65536
flags			0x1
			( WRITTEN )
magic			_BHRfS_M [match]
fsid			86180ca0-d351-4551-b262-22b49e1adf47
metadata_uuid		86180ca0-d351-4551-b262-22b49e1adf47
label			sailfish
generation		2727499
root			30703616
sys_array_size		226
chunk_root_generation	2342945
root_level		1
chunk_root		20971520
chunk_root_level	0
log_root		94920704
log_root_transid	0
log_root_level		0
total_bytes		14761832448
bytes_used		5075300352
sectorsize		4096
nodesize		4096
leafsize (deprecated)	4096
stripesize		4096
root_dir		6
num_devices		1
compat_flags		0x0
compat_ro_flags		0x0
incompat_flags		0x3
			( MIXED_BACKREF |
			  DEFAULT_SUBVOL )
cache_generation	2727498
uuid_tree_generation	0
dev_item.uuid		bb3ff90e-e471-48d6-af4e-add19a0a532d
dev_item.fsid		86180ca0-d351-4551-b262-22b49e1adf47 [match]
dev_item.type		0
dev_item.total_bytes	14761832448
dev_item.bytes_used	14761787392
dev_item.io_align	4096
dev_item.io_width	4096
dev_item.sector_size	4096
dev_item.devid		1
dev_item.dev_group	0
dev_item.seek_speed	0
dev_item.bandwidth	0
dev_item.generation	0
sys_chunk_array[2048]:
	item 0 key (FIRST_CHUNK_TREE CHUNK_ITEM 0)
		length 4194304 owner 2 stripe_len 65536 type SYSTEM
		io_align 4096 io_width 4096 sector_size 4096
		num_stripes 1 sub_stripes 0
			stripe 0 devid 1 offset 0
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
	item 1 key (FIRST_CHUNK_TREE CHUNK_ITEM 20971520)
		length 8388608 owner 2 stripe_len 65536 type SYSTEM|DUP
		io_align 65536 io_width 65536 sector_size 4096
		num_stripes 2 sub_stripes 0
			stripe 0 devid 1 offset 20971520
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
			stripe 1 devid 1 offset 29360128
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
backup_roots[4]:
	backup 0:
		backup_tree_root:	114339840	gen: 2727497	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	117129216	gen: 2727498	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	116412416	gen: 2727498	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075410944
		backup_num_devices:	1

	backup 1:
		backup_tree_root:	48250880	gen: 2727498	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	89980928	gen: 2727499	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	89243648	gen: 2727499	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075365888
		backup_num_devices:	1

	backup 2:
		backup_tree_root:	90173440	gen: 2727495	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	84922368	gen: 2727495	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	94969856	gen: 2727496	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075275776
		backup_num_devices:	1

	backup 3:
		backup_tree_root:	102043648	gen: 2727496	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	98189312	gen: 2727496	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	97951744	gen: 2727496	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075275776
		backup_num_devices:	1


superblock: bytenr=67108864, device=/dev/loop4
---------------------------------------------------------
csum_type		0 (crc32c)
csum_size		4
csum			0x7c4d28f4 [match]
bytenr			67108864
flags			0x1
			( WRITTEN )
magic			_BHRfS_M [match]
fsid			86180ca0-d351-4551-b262-22b49e1adf47
metadata_uuid		86180ca0-d351-4551-b262-22b49e1adf47
label			sailfish
generation		2727499
root			30703616
sys_array_size		226
chunk_root_generation	2342945
root_level		1
chunk_root		20971520
chunk_root_level	0
log_root		94920704
log_root_transid	0
log_root_level		0
total_bytes		14761832448
bytes_used		5075300352
sectorsize		4096
nodesize		4096
leafsize (deprecated)	4096
stripesize		4096
root_dir		6
num_devices		1
compat_flags		0x0
compat_ro_flags		0x0
incompat_flags		0x3
			( MIXED_BACKREF |
			  DEFAULT_SUBVOL )
cache_generation	2727498
uuid_tree_generation	0
dev_item.uuid		bb3ff90e-e471-48d6-af4e-add19a0a532d
dev_item.fsid		86180ca0-d351-4551-b262-22b49e1adf47 [match]
dev_item.type		0
dev_item.total_bytes	14761832448
dev_item.bytes_used	14761787392
dev_item.io_align	4096
dev_item.io_width	4096
dev_item.sector_size	4096
dev_item.devid		1
dev_item.dev_group	0
dev_item.seek_speed	0
dev_item.bandwidth	0
dev_item.generation	0
sys_chunk_array[2048]:
	item 0 key (FIRST_CHUNK_TREE CHUNK_ITEM 0)
		length 4194304 owner 2 stripe_len 65536 type SYSTEM
		io_align 4096 io_width 4096 sector_size 4096
		num_stripes 1 sub_stripes 0
			stripe 0 devid 1 offset 0
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
	item 1 key (FIRST_CHUNK_TREE CHUNK_ITEM 20971520)
		length 8388608 owner 2 stripe_len 65536 type SYSTEM|DUP
		io_align 65536 io_width 65536 sector_size 4096
		num_stripes 2 sub_stripes 0
			stripe 0 devid 1 offset 20971520
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
			stripe 1 devid 1 offset 29360128
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
backup_roots[4]:
	backup 0:
		backup_tree_root:	114339840	gen: 2727497	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	117129216	gen: 2727498	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	116412416	gen: 2727498	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075410944
		backup_num_devices:	1

	backup 1:
		backup_tree_root:	48250880	gen: 2727498	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	89980928	gen: 2727499	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	89243648	gen: 2727499	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075365888
		backup_num_devices:	1

	backup 2:
		backup_tree_root:	90173440	gen: 2727495	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	84922368	gen: 2727495	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	94969856	gen: 2727496	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075275776
		backup_num_devices:	1

	backup 3:
		backup_tree_root:	102043648	gen: 2727496	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	98189312	gen: 2727496	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	97951744	gen: 2727496	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075275776
		backup_num_devices:	1

> 
> > ~ # LC_ALL=C btrfs rescue zero-log /dev/loop0
> > Clearing log on /dev/loop0, previous log_root 0, level 0
> 
> This is not advised except in specific cases which the man page gives
> examples of.
> 
> 
> > ~ # btrfs fi df ~/mnt
> > Data, single: total=13.08GiB, used=4.51GiB
> > System, DUP: total=8.00MiB, used=4.00KiB
> > System, single: total=4.00MiB, used=0.00B
> > Metadata, DUP: total=330.00MiB, used=224.30MiB
> > Metadata, single: total=8.00MiB, used=0.00B
> > GlobalReserve, single: total=512.00MiB, used=406.37MiB
> > 
> > ~ # truncate --size=2GB ~/tmp/space
> > ~ # losetup --find --show ~/tmp/space
> > /dev/loop1
> > 
> > ~ # btrfs device add /dev/loop1 ~/mnt/
> > Performing full device TRIM /dev/loop1 (1.86GiB) ...
> > ERROR: error adding device '/dev/loop1': Read-only file system
> > 
> > When I mount, in syslog appears:
> > BTRFS info (device loop0): disk space caching is enabled
> > BTRFS info (device loop0): creating UUID tree
> > BTRFS warning (device loop0): block group 144703488 has wrong amount of free space
> > BTRFS warning (device loop0): failed to load free space cache for block group 144703488, rebuilding it now
> > BTRFS warning (device loop0): failed to create the UUID tree: -28
> > BTRFS: open_ctree failed
> > 
> > So now I can mount readonly, but is there any way to repair this filesystem?
> 
> Definitely get things off of it now while you can.
Yes, I already did.


> Fedora 31 has btrfs-progs 5.6 current. 
For clarification I would like to add info from jolla phone (recovery
mode):

/ # uname -a
Linux (none) 3.4.108.20190506.1 #1 SMP PREEMPT Sat Nov 30 21:25:45 UTC
2019 armv7l GNU/Linux
/ # btrfs --version
Btrfs v3.16


> I suggest posting the output from
> 
> # btrfs check --readonly /dev/

btrfs check --readonly /dev/loop4

Opening filesystem to check...
parent transid verify failed on 94920704 wanted 2727500 found 2727499
parent transid verify failed on 94920704 wanted 2727500 found 2727499
parent transid verify failed on 94920704 wanted 2727500 found 2727499
Ignoring transid failure
Checking filesystem on /dev/loop4
UUID: 86180ca0-d351-4551-b262-22b49e1adf47
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space cache
cache and super generation don't match, space cache will be invalidated
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups
Rescan hasn't been initialized, a difference in qgroup accounting is
expected
Counts for qgroup id: 0/264 are different
our:		referenced 876449792 referenced compressed 876449792
disk:		referenced 876449792 referenced compressed 876449792
our:		exclusive 872464384 exclusive compressed 872464384
disk:		exclusive 4096 exclusive compressed 4096
diff:		exclusive 872460288 exclusive compressed 872460288
Counts for qgroup id: 0/265 are different
our:		referenced 73646080 referenced compressed 73646080
disk:		referenced 73646080 referenced compressed 73646080
our:		exclusive 15380480 exclusive compressed 15380480
disk:		exclusive 4096 exclusive compressed 4096
diff:		exclusive 15376384 exclusive compressed 15376384
ERROR: transid errors in file system
found 5075300352 bytes used, error(s) found
total csum bytes: 4715584
total tree bytes: 235204608
total fs tree bytes: 214499328
total extent tree bytes: 12795904
btree space waste bytes: 70058462
file data blocks allocated: 4970160128
 referenced 4793737216

I don't know if adding attachments is allowed, so it's embedded.
Thanks Jirka


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

* Re: I can't mount image
  2020-05-20 21:12   ` Jiří Lisický
@ 2020-05-20 21:54     ` Chris Murphy
  2020-05-23 14:38       ` Jiří Lisický
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Murphy @ 2020-05-20 21:54 UTC (permalink / raw)
  To: Jiří Lisický; +Cc: Chris Murphy, Btrfs BTRFS

On Wed, May 20, 2020 at 3:12 PM Jiří Lisický <jiri_lisicky@seznam.cz> wrote:
>
>
> btrfs insp dump-s -fa /dev/loop4
>
> superblock: bytenr=65536, device=/dev/loop4
> ---------------------------------------------------------
> csum_type               0 (crc32c)
> csum_size               4
> csum                    0xdc2c003a [match]
> bytenr                  65536
> flags                   0x1
>                         ( WRITTEN )
> magic                   _BHRfS_M [match]
> fsid                    86180ca0-d351-4551-b262-22b49e1adf47
> metadata_uuid           86180ca0-d351-4551-b262-22b49e1adf47
> label                   sailfish
> generation              2727499
> root                    30703616
> sys_array_size          226
> chunk_root_generation   2342945
> root_level              1
> chunk_root              20971520
> chunk_root_level        0
> log_root                94920704

There's a log tree being referenced, but in an earlier step you zero'd
the log. There might be some data loss for whatever was being written
at the time it was last rw mounted.



> log_root_transid        0
> log_root_level          0
> total_bytes             14761832448
> bytes_used              5075300352
> sectorsize              4096
> nodesize                4096
> leafsize (deprecated)   4096
> stripesize              4096
> root_dir                6
> num_devices             1
> compat_flags            0x0
> compat_ro_flags         0x0
> incompat_flags          0x3
>                         ( MIXED_BACKREF |
>                           DEFAULT_SUBVOL )

Must be a very early btrfs-progs. Default these days is 0x161.


> / # uname -a
> Linux (none) 3.4.108.20190506.1 #1 SMP PREEMPT Sat Nov 30 21:25:45 UTC
> 2019 armv7l GNU/Linux
> / # btrfs --version
> Btrfs v3.16

To attempt a repair, you need something much newer. I suggest 5.6 or
5.6.1 since they're recent. Arch and Fedora Rawhide images will have
one of those. I'm not certain v3.16 can reliably tell us what's wrong
with the file system, in particular since quotas are enabled. Please
update and then repost 'btrfs check' without options.

This is promising though:

>parent transid verify failed on 94920704 wanted 2727500 found 2727499

Weird - why does it want that generation when the super block says the
root tree generation is 2727499? Can you also include output from:

# btrfs rescue super -v /dev/

It might be as simple as 'mount -o ro,recovery' with that older kernel
if it can roll back to the previous transid. If not, then a more
recent btrfs progs might be able to confirm whether the older state
can be repaired. That looks like this:

# btrfs check /dev/
# btrfs check -r 48250880 /dev/
# btrfs check -r 114339840 /dev/
# btrfs check -r 102043648 /dev/
# btrfs check -r 90173440 /dev/


The first two are most likely to succeed. All of these are still read
only, gathering information. There are no repairs yet even though
you're working on a backup image (good idea).

-- 
Chris Murphy

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

* Re: I can't mount image
  2020-05-20 21:54     ` Chris Murphy
@ 2020-05-23 14:38       ` Jiří Lisický
  2020-05-23 23:21         ` Chris Murphy
  2020-05-23 23:27         ` Chris Murphy
  0 siblings, 2 replies; 8+ messages in thread
From: Jiří Lisický @ 2020-05-23 14:38 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Btrfs BTRFS

Chris Murphy píše v St 20. 05. 2020 v 15:54 -0600:
> On Wed, May 20, 2020 at 3:12 PM Jiří Lisický <jiri_lisicky@seznam.cz> wrote:
> > 
> > 
> > btrfs insp dump-s -fa /dev/loop4
> > 
> > superblock: bytenr=65536, device=/dev/loop4
> > ---------------------------------------------------------
> > csum_type               0 (crc32c)
> > csum_size               4
> > csum                    0xdc2c003a [match]
> > bytenr                  65536
> > flags                   0x1
> >                         ( WRITTEN )
> > magic                   _BHRfS_M [match]
> > fsid                    86180ca0-d351-4551-b262-22b49e1adf47
> > metadata_uuid           86180ca0-d351-4551-b262-22b49e1adf47
> > label                   sailfish
> > generation              2727499
> > root                    30703616
> > sys_array_size          226
> > chunk_root_generation   2342945
> > root_level              1
> > chunk_root              20971520
> > chunk_root_level        0
> > log_root                94920704
> 
> There's a log tree being referenced, but in an earlier step you zero'd
> the log. There might be some data loss for whatever was being written
> at the time it was last rw mounted.
Yes, zeroed, but only in first mail. I took a new one copy in this round - without zero-log. Image in /dev/loop4 is without any modification.

> 
> > log_root_transid        0
> > log_root_level          0
> > total_bytes             14761832448
> > bytes_used              5075300352
> > sectorsize              4096
> > nodesize                4096
> > leafsize (deprecated)   4096
> > stripesize              4096
> > root_dir                6
> > num_devices             1
> > compat_flags            0x0
> > compat_ro_flags         0x0
> > incompat_flags          0x3
> >                         ( MIXED_BACKREF |
> >                           DEFAULT_SUBVOL )
> 
> Must be a very early btrfs-progs. Default these days is 0x161.
> 
> 
> > / # uname -a
> > Linux (none) 3.4.108.20190506.1 #1 SMP PREEMPT Sat Nov 30 21:25:45 UTC
> > 2019 armv7l GNU/Linux
> > / # btrfs --version
> > Btrfs v3.16
> 
> To attempt a repair, you need something much newer. I suggest 5.6 or
> 5.6.1 since they're recent. Arch and Fedora Rawhide images will have
> one of those. I'm not certain v3.16 can reliably tell us what's wrong
> with the file system, in particular since quotas are enabled. Please
> update and then repost 'btrfs check' without options.
Yes, versions above are from Jolla phone. I do all the work in Fedora 31 Live. Outputs from suggested commands are bellow.


> This is promising though:
> 
> > parent transid verify failed on 94920704 wanted 2727500 found 2727499
> 
> Weird - why does it want that generation when the super block says the
> root tree generation is 2727499? Can you also include output from:
> 
> # btrfs rescue super -v /dev/
> 
> It might be as simple as 'mount -o ro,recovery' with that older kernel
> if it can roll back to the previous transid. If not, then a more
> recent btrfs progs might be able to confirm whether the older state
> can be repaired. That looks like this:
> 
> # btrfs check /dev/
> # btrfs check -r 48250880 /dev/
> # btrfs check -r 114339840 /dev/
> # btrfs check -r 102043648 /dev/
> # btrfs check -r 90173440 /dev/
> 
> 
> The first two are most likely to succeed. All of these are still read
> only, gathering information. There are no repairs yet even though
> you're working on a backup image (good idea).

[root@localhost-live tmp] # btrfs rescue super -v /dev/loop4
All Devices:
	Device: id = 1, name = /dev/loop4

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

		device name = /dev/loop4
		superblock bytenr = 67108864

	[All bad supers]:

All supers are valid, no need to recover



[root@localhost-live tmp]# mount -o ro,recovery /dev/loop4 ./mnt
mount: /home/jirka/tmp/mnt: can't read superblock on /dev/loop4.


[root@localhost-live tmp]# btrfs check /dev/loop4
Opening filesystem to check...
parent transid verify failed on 94920704 wanted 2727500 found 2727499
parent transid verify failed on 94920704 wanted 2727500 found 2727499
parent transid verify failed on 94920704 wanted 2727500 found 2727499
Ignoring transid failure
Checking filesystem on /dev/loop4
UUID: 86180ca0-d351-4551-b262-22b49e1adf47
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space cache
cache and super generation don't match, space cache will be invalidated
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups
Rescan hasn't been initialized, a difference in qgroup accounting is expected
Counts for qgroup id: 0/264 are different
our:		referenced 876449792 referenced compressed 876449792
disk:		referenced 876449792 referenced compressed 876449792
our:		exclusive 872464384 exclusive compressed 872464384
disk:		exclusive 4096 exclusive compressed 4096
diff:		exclusive 872460288 exclusive compressed 872460288
Counts for qgroup id: 0/265 are different
our:		referenced 73646080 referenced compressed 73646080
disk:		referenced 73646080 referenced compressed 73646080
our:		exclusive 15380480 exclusive compressed 15380480
disk:		exclusive 4096 exclusive compressed 4096
diff:		exclusive 15376384 exclusive compressed 15376384
ERROR: transid errors in file system
found 5075300352 bytes used, error(s) found
total csum bytes: 4715584
total tree bytes: 235204608
total fs tree bytes: 214499328
total extent tree bytes: 12795904
btree space waste bytes: 70058462
file data blocks allocated: 4970160128
 referenced 4793737216


[root@localhost-live tmp]# btrfs check -r 48250880 /dev/loop4
Opening filesystem to check...
parent transid verify failed on 48250880 wanted 2727499 found 2727498
parent transid verify failed on 48250880 wanted 2727499 found 2727498
parent transid verify failed on 48250880 wanted 2727499 found 2727498
Ignoring transid failure
parent transid verify failed on 94920704 wanted 2727500 found 2727499
parent transid verify failed on 94920704 wanted 2727500 found 2727499
parent transid verify failed on 94920704 wanted 2727500 found 2727499
Ignoring transid failure
Checking filesystem on /dev/loop4
UUID: 86180ca0-d351-4551-b262-22b49e1adf47
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space cache
cache and super generation don't match, space cache will be invalidated
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups
Rescan hasn't been initialized, a difference in qgroup accounting is expected
Counts for qgroup id: 0/264 are different
our:		referenced 876449792 referenced compressed 876449792
disk:		referenced 876449792 referenced compressed 876449792
our:		exclusive 872464384 exclusive compressed 872464384
disk:		exclusive 4096 exclusive compressed 4096
diff:		exclusive 872460288 exclusive compressed 872460288
Counts for qgroup id: 0/265 are different
our:		referenced 73646080 referenced compressed 73646080
disk:		referenced 73646080 referenced compressed 73646080
our:		exclusive 15380480 exclusive compressed 15380480
disk:		exclusive 4096 exclusive compressed 4096
diff:		exclusive 15376384 exclusive compressed 15376384
ERROR: transid errors in file system
found 5075300352 bytes used, error(s) found
total csum bytes: 4715584
total tree bytes: 235204608
total fs tree bytes: 214499328
total extent tree bytes: 12795904
btree space waste bytes: 70058462
file data blocks allocated: 4970160128
 referenced 4793737216


[root@localhost-live tmp]# btrfs check -r 114339840 /dev/loop4
Opening filesystem to check...
parent transid verify failed on 114339840 wanted 2727499 found 2727497
parent transid verify failed on 114339840 wanted 2727499 found 2727497
parent transid verify failed on 114339840 wanted 2727499 found 2727497
Ignoring transid failure
parent transid verify failed on 94920704 wanted 2727500 found 2727499
parent transid verify failed on 94920704 wanted 2727500 found 2727499
parent transid verify failed on 94920704 wanted 2727500 found 2727499
Ignoring transid failure
Checking filesystem on /dev/loop4
UUID: 86180ca0-d351-4551-b262-22b49e1adf47
[1/7] checking root items
parent transid verify failed on 50991104 wanted 2727494 found 2727499
parent transid verify failed on 50991104 wanted 2727494 found 2727499
parent transid verify failed on 50991104 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 51003392 wanted 2727494 found 2727499
parent transid verify failed on 51003392 wanted 2727494 found 2727499
parent transid verify failed on 51003392 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 57032704 wanted 2727494 found 2727499
parent transid verify failed on 57032704 wanted 2727494 found 2727499
parent transid verify failed on 57032704 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 57069568 wanted 2727494 found 2727499
parent transid verify failed on 57069568 wanted 2727494 found 2727499
parent transid verify failed on 57069568 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 57253888 wanted 2727494 found 2727499
parent transid verify failed on 57253888 wanted 2727494 found 2727499
parent transid verify failed on 57253888 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 58953728 wanted 2727494 found 2727499
parent transid verify failed on 58953728 wanted 2727494 found 2727499
parent transid verify failed on 58953728 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 45047808 wanted 2727493 found 2727499
parent transid verify failed on 45047808 wanted 2727493 found 2727499
parent transid verify failed on 45047808 wanted 2727493 found 2727499
Ignoring transid failure
parent transid verify failed on 59351040 wanted 2727494 found 2727499
parent transid verify failed on 59351040 wanted 2727494 found 2727499
parent transid verify failed on 59351040 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 44269568 wanted 2727493 found 2727499
parent transid verify failed on 44269568 wanted 2727493 found 2727499
parent transid verify failed on 44269568 wanted 2727493 found 2727499
Ignoring transid failure
parent transid verify failed on 31113216 wanted 2727493 found 2727499
parent transid verify failed on 31113216 wanted 2727493 found 2727499
parent transid verify failed on 31113216 wanted 2727493 found 2727499
Ignoring transid failure
parent transid verify failed on 45645824 wanted 2727493 found 2727499
parent transid verify failed on 45645824 wanted 2727493 found 2727499
parent transid verify failed on 45645824 wanted 2727493 found 2727499
Ignoring transid failure
parent transid verify failed on 50700288 wanted 2727492 found 2727499
parent transid verify failed on 50700288 wanted 2727492 found 2727499
parent transid verify failed on 50700288 wanted 2727492 found 2727499
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=109846528 item=58 parent level=1 child level=1
ERROR: failed to repair root items: Input/output error


[root@localhost-live tmp]# btrfs check -r 102043648 /dev/loop4
Opening filesystem to check...
parent transid verify failed on 102043648 wanted 2727499 found 2727496
parent transid verify failed on 102043648 wanted 2727499 found 2727496
parent transid verify failed on 102043648 wanted 2727499 found 2727496
Ignoring transid failure
parent transid verify failed on 94920704 wanted 2727500 found 2727499
parent transid verify failed on 94920704 wanted 2727500 found 2727499
parent transid verify failed on 94920704 wanted 2727500 found 2727499
Ignoring transid failure
Checking filesystem on /dev/loop4
UUID: 86180ca0-d351-4551-b262-22b49e1adf47
[1/7] checking root items
parent transid verify failed on 50991104 wanted 2727494 found 2727499
parent transid verify failed on 50991104 wanted 2727494 found 2727499
parent transid verify failed on 50991104 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 51003392 wanted 2727494 found 2727499
parent transid verify failed on 51003392 wanted 2727494 found 2727499
parent transid verify failed on 51003392 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 57032704 wanted 2727494 found 2727499
parent transid verify failed on 57032704 wanted 2727494 found 2727499
parent transid verify failed on 57032704 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 57069568 wanted 2727494 found 2727499
parent transid verify failed on 57069568 wanted 2727494 found 2727499
parent transid verify failed on 57069568 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 57212928 wanted 2727494 found 2727499
parent transid verify failed on 57212928 wanted 2727494 found 2727499
parent transid verify failed on 57212928 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 57253888 wanted 2727494 found 2727499
parent transid verify failed on 57253888 wanted 2727494 found 2727499
parent transid verify failed on 57253888 wanted 2727494 found 2727499
Ignoring transid failure
parent transid verify failed on 43192320 wanted 2727493 found 2727498
parent transid verify failed on 43192320 wanted 2727493 found 2727498
parent transid verify failed on 43192320 wanted 2727493 found 2727498
Ignoring transid failure
parent transid verify failed on 58257408 wanted 2727494 found 2727499
parent transid verify failed on 58257408 wanted 2727494 found 2727499
parent transid verify failed on 58257408 wanted 2727494 found 2727499
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=98955264 item=10 parent level=1 child level=1
ERROR: failed to repair root items: Input/output error


[root@localhost-live tmp]# btrfs check -r 90173440 /dev/loop4
Opening filesystem to check...
ERROR: could not setup extent tree
ERROR: cannot open file system


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

* Re: I can't mount image
  2020-05-23 14:38       ` Jiří Lisický
@ 2020-05-23 23:21         ` Chris Murphy
  2020-05-24 19:51           ` Jiří Lisický
  2020-05-23 23:27         ` Chris Murphy
  1 sibling, 1 reply; 8+ messages in thread
From: Chris Murphy @ 2020-05-23 23:21 UTC (permalink / raw)
  To: Jiří Lisický, Btrfs BTRFS

On Sat, May 23, 2020 at 8:38 AM Jiří Lisický <jiri_lisicky@seznam.cz> wrote:
>
> [root@localhost-live tmp] # btrfs rescue super -v /dev/loop4
> All Devices:
>         Device: id = 1, name = /dev/loop4
>
> Before Recovering:
>         [All good supers]:
>                 device name = /dev/loop4
>                 superblock bytenr = 65536
>
>                 device name = /dev/loop4
>                 superblock bytenr = 67108864
>
>         [All bad supers]:
>
> All supers are valid, no need to recover

OK. So they're good.

>
>
>
> [root@localhost-live tmp]# mount -o ro,recovery /dev/loop4 ./mnt
> mount: /home/jirka/tmp/mnt: can't read superblock on /dev/loop4.


But it can't be read? This doesn't make sense. What kernel messages
are reported at the time of the mount attempt? When using a newer
kernel, the recovery command is deprecated but should still work. The
new command is 'usebackuproot'

What do you get for:

# btrfs insp dump-s -fa /dev/

-- 
Chris Murphy

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

* Re: I can't mount image
  2020-05-23 14:38       ` Jiří Lisický
  2020-05-23 23:21         ` Chris Murphy
@ 2020-05-23 23:27         ` Chris Murphy
  1 sibling, 0 replies; 8+ messages in thread
From: Chris Murphy @ 2020-05-23 23:27 UTC (permalink / raw)
  To: Jiří Lisický; +Cc: Chris Murphy, Btrfs BTRFS

By the way, if you want to try repairs, I know that you're using an
image on loop. But it could still save you time to set up an overlay
to avoid modifying the image until you've found a combination that
works - if possible.

https://raid.wiki.kernel.org/index.php/Recovering_a_failed_software_RAID#Making_the_harddisks_read-only_using_an_overlay_file

This strikes me as extent tree corruption so I'd start with
--init-extent-tree, and follow that up without options (implies
--readonly). There is no bigger hammer, so it's worth a shot but only
because you're working on a copy of the fs. There's a chance it makes
things worse.

--
Chris Murphy

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

* Re: I can't mount image
  2020-05-23 23:21         ` Chris Murphy
@ 2020-05-24 19:51           ` Jiří Lisický
  0 siblings, 0 replies; 8+ messages in thread
From: Jiří Lisický @ 2020-05-24 19:51 UTC (permalink / raw)
  To: Chris Murphy, Btrfs BTRFS

Chris Murphy píše v So 23. 05. 2020 v 17:21 -0600:
> On Sat, May 23, 2020 at 8:38 AM Jiří Lisický <jiri_lisicky@seznam.cz> wrote:
> > 
> > [root@localhost-live tmp] # btrfs rescue super -v /dev/loop4
> > All Devices:
> >         Device: id = 1, name = /dev/loop4
> > 
> > Before Recovering:
> >         [All good supers]:
> >                 device name = /dev/loop4
> >                 superblock bytenr = 65536
> > 
> >                 device name = /dev/loop4
> >                 superblock bytenr = 67108864
> > 
> >         [All bad supers]:
> > 
> > All supers are valid, no need to recover
> 
> OK. So they're good.
> 
> > 
> > 
> > 
> > [root@localhost-live tmp]# mount -o ro,recovery /dev/loop4 ./mnt
> > mount: /home/jirka/tmp/mnt: can't read superblock on /dev/loop4.
> 
> 
> But it can't be read? This doesn't make sense. What kernel messages
> are reported at the time of the mount attempt? When using a newer
> kernel, the recovery command is deprecated but should still work. The
> new command is 'usebackuproot'

[root@localhost-live tmp]# mount -o usebackuproot /dev/loop4 ./mnt
mount: /home/jirka/tmp/mnt: can't read superblock on /dev/loop4.

log:
May 24 15:33:56 localhost-live kernel: BTRFS info (device loop4): trying to use backup root at mount time
May 24 15:33:56 localhost-live kernel: BTRFS info (device loop4): disk space caching is enabled
May 24 15:33:56 localhost-live kernel: BTRFS critical (device loop4): corrupt leaf: root=1 block=48295936 slot=2, invalid root item size, have 239 expect 439
May 24 15:33:56 localhost-live kernel: BTRFS critical (device loop4): corrupt leaf: root=1 block=48295936 slot=5, invalid root item size, have 239 expect 439
May 24 15:33:56 localhost-live kernel: BTRFS critical (device loop4): corrupt leaf: root=1 block=48295936 slot=7, invalid root item size, have 239 expect 439
May 24 15:33:56 localhost-live kernel: BTRFS warning (device loop4): mismatching generation and generation_v2 found in root item. This root was probably mounted with an older kernel. Resetting all new fields.
May 24 15:33:56 localhost-live kernel: BTRFS warning (device loop4): mismatching generation and generation_v2 found in root item. This root was probably mounted with an older kernel. Resetting all new fields.
May 24 15:33:56 localhost-live kernel: BTRFS error (device loop4): qgroup generation mismatch, marked as inconsistent
May 24 15:33:56 localhost-live kernel: BTRFS info (device loop4): start tree-log replay
May 24 15:33:56 localhost-live kernel: BTRFS critical (device loop4): corrupt leaf: root=18446744073709551610 block=94920704 slot=0, invalid root item size, have 239 expect 439
May 24 15:33:56 localhost-live kernel: ------------[ cut here ]------------
May 24 15:33:56 localhost-live kernel: btrfs bad mapping eb start 94920704 len 4096, wanted 3857 439
May 24 15:33:56 localhost-live kernel: WARNING: CPU: 1 PID: 174 at fs/btrfs/extent_io.c:5549 read_extent_buffer+0x10f/0x140 [btrfs]
May 24 15:33:56 localhost-live kernel: Modules linked in: nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_tables_set nft_chain_nat ip6table_nat ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_raw iptable_security ip_set nf_tables nfnetlink ip6table_filter ip6_tables iptable_filter snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal snd_hda_intel intel_powerclamp snd_intel_dspcfg snd_hda_codec coretemp i915 snd_hda_core kvm_intel snd_hwdep snd_seq kvm snd_seq_device joydev snd_pcm irqbypass intel_cstate intel_uncore snd_timer intel_rapl_perf snd cec ppdev iTCO_wdt hp_wmi mei_hdcp iTCO_vendor_support mei_wdt parport_pc sparse_keymap soundcore parport rfkill i2c_algo_bit wmi_bmof drm_kms_helper mei_me tpm_infineon mei i2c_i801 lpc_ich pcspkr drm ip_tables nls_utf8 isofs squashfs dm_multipath
May 24 15:33:56 localhost-live kernel:  8021q garp mrp stp llc crct10dif_pclmul crc32_pclmul e1000e ghash_clmulni_intel serio_raw wmi video btrfs blake2b_generic xor zstd_compress raid6_pq libcrc32c crc32c_intel zstd_decompress sunrpc be2iscsi bnx2i cnic uio cxgb4i cxgb4 cxgb3i cxgb3 mdio libcxgbi libcxgb qla4xxx iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi loop fuse scsi_transport_iscsi
May 24 15:33:56 localhost-live kernel: CPU: 1 PID: 174 Comm: kworker/u8:3 Not tainted 5.6.6-300.fc32.x86_64 #1
May 24 15:33:56 localhost-live kernel: Hardware name: Hewlett-Packard HP Compaq Elite 8300 SFF/3397, BIOS K01 v02.05 05/07/2012
May 24 15:33:56 localhost-live kernel: Workqueue: btrfs-endio-meta btrfs_work_helper [btrfs]
May 24 15:33:56 localhost-live kernel: RIP: 0010:read_extent_buffer+0x10f/0x140 [btrfs]
May 24 15:33:56 localhost-live kernel: Code: c3 8b 0e 89 4d 00 89 c1 8b 74 0e fc 89 74 0d fc e9 72 ff ff ff 48 89 d1 4d 89 e0 4c 89 ca 48 c7 c7 e0 91 4d c0 e8 38 a4 c8 f9 <0f> 0b 31 f6 4c 89 e2 48 89 ef 5d 41 5c e9 bf 31 5d fa 89 c1 0f b7
May 24 15:33:56 localhost-live kernel: RSP: 0018:ffffb49dc026ba40 EFLAGS: 00010286
May 24 15:33:56 localhost-live kernel: RAX: 000000000000003d RBX: ffff9a37048b0000 RCX: 0000000000000007
May 24 15:33:56 localhost-live kernel: RDX: 00000000fffffff8 RSI: 0000000000000082 RDI: ffff9a37d6a99cc0
May 24 15:33:56 localhost-live kernel: RBP: ffffb49dc026ba59 R08: 0000000000000422 R09: ffffb49dc026b8d0
May 24 15:33:56 localhost-live kernel: R10: 0000000000000005 R11: 0000000000000000 R12: 00000000000001b7
May 24 15:33:56 localhost-live kernel: R13: 0000000000000065 R14: ffff9a370570f5a8 R15: 0000000000000f9b
May 24 15:33:56 localhost-live kernel: FS:  0000000000000000(0000) GS:ffff9a37d6a80000(0000) knlGS:0000000000000000
May 24 15:33:56 localhost-live kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
May 24 15:33:56 localhost-live kernel: CR2: 00007ffb02c1f2b8 CR3: 00000000a960a005 CR4: 00000000000606e0
May 24 15:33:56 localhost-live kernel: Call Trace:
May 24 15:33:56 localhost-live kernel:  check_root_item+0x8b/0x180 [btrfs]
May 24 15:33:56 localhost-live kernel:  ? crc_42+0x1e/0x1e [crc32c_intel]
May 24 15:33:56 localhost-live kernel:  ? crc32c_pcl_intel_update+0xa4/0xb0 [crc32c_intel]
May 24 15:33:56 localhost-live kernel:  ? crc32c_intel_init+0x20/0x20 [crc32c_intel]
May 24 15:33:56 localhost-live kernel:  ? csum_tree_block+0x11f/0x130 [btrfs]
May 24 15:33:56 localhost-live kernel:  ? intel_cpufreq_target+0x140/0x140
May 24 15:33:56 localhost-live kernel:  ? update_load_avg+0x7a/0x640
May 24 15:33:56 localhost-live kernel:  ? intel_cpufreq_target+0x140/0x140
May 24 15:33:56 localhost-live kernel:  ? enqueue_entity+0x177/0x770
May 24 15:33:56 localhost-live kernel:  ? btrfs_get_32+0x38/0x80 [btrfs]
May 24 15:33:56 localhost-live kernel:  check_leaf+0x489/0x1530 [btrfs]
May 24 15:33:56 localhost-live kernel:  ? clear_state_bit+0x140/0x1a0 [btrfs]
May 24 15:33:56 localhost-live kernel:  ? map_private_extent_buffer+0xd0/0xd0 [btrfs]
May 24 15:33:56 localhost-live kernel:  btree_readpage_end_io_hook+0x2de/0x320 [btrfs]
May 24 15:33:56 localhost-live kernel:  end_bio_extent_readpage+0x1c0/0x710 [btrfs]
May 24 15:33:56 localhost-live kernel:  ? __rq_qos_done_bio+0x24/0x30
May 24 15:33:56 localhost-live kernel:  end_workqueue_fn+0x29/0x40 [btrfs]
May 24 15:33:56 localhost-live kernel:  btrfs_work_helper+0xd6/0x3a0 [btrfs]
May 24 15:33:56 localhost-live kernel:  process_one_work+0x1b4/0x380
May 24 15:33:56 localhost-live kernel:  worker_thread+0x53/0x3e0
May 24 15:33:56 localhost-live kernel:  ? process_one_work+0x380/0x380
May 24 15:33:56 localhost-live kernel:  kthread+0x115/0x140
May 24 15:33:56 localhost-live kernel:  ? __kthread_bind_mask+0x60/0x60
May 24 15:33:56 localhost-live kernel:  ret_from_fork+0x35/0x40
May 24 15:33:56 localhost-live kernel: ---[ end trace 013462e0cfd87fc0 ]---
May 24 15:33:56 localhost-live kernel: BTRFS critical (device loop4): corrupt leaf: root=18446744073709551610 block=94920704 slot=1, invalid root item size, have 239 expect 439
May 24 15:33:56 localhost-live kernel: BTRFS error (device loop4): parent transid verify failed on 94920704 wanted 2727500 found 2727499
May 24 15:33:56 localhost-live kernel: BTRFS critical (device loop4): corrupt leaf: root=18446744073709551610 block=94920704 slot=0, invalid root item size, have 239 expect 439
May 24 15:33:56 localhost-live kernel: ------------[ cut here ]------------
May 24 15:33:56 localhost-live kernel: btrfs bad mapping eb start 94920704 len 4096, wanted 3857 439
May 24 15:33:56 localhost-live kernel: WARNING: CPU: 1 PID: 174 at fs/btrfs/extent_io.c:5549 read_extent_buffer+0x10f/0x140 [btrfs]
May 24 15:33:56 localhost-live kernel: Modules linked in: nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_tables_set nft_chain_nat ip6table_nat ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_raw iptable_security ip_set nf_tables nfnetlink ip6table_filter ip6_tables iptable_filter snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal snd_hda_intel intel_powerclamp snd_intel_dspcfg snd_hda_codec coretemp i915 snd_hda_core kvm_intel snd_hwdep snd_seq kvm snd_seq_device joydev snd_pcm irqbypass intel_cstate intel_uncore snd_timer intel_rapl_perf snd cec ppdev iTCO_wdt hp_wmi mei_hdcp iTCO_vendor_support mei_wdt parport_pc sparse_keymap soundcore parport rfkill i2c_algo_bit wmi_bmof drm_kms_helper mei_me tpm_infineon mei i2c_i801 lpc_ich pcspkr drm ip_tables nls_utf8 isofs squashfs dm_multipath
May 24 15:33:56 localhost-live kernel:  8021q garp mrp stp llc crct10dif_pclmul crc32_pclmul e1000e ghash_clmulni_intel serio_raw wmi video btrfs blake2b_generic xor zstd_compress raid6_pq libcrc32c crc32c_intel zstd_decompress sunrpc be2iscsi bnx2i cnic uio cxgb4i cxgb4 cxgb3i cxgb3 mdio libcxgbi libcxgb qla4xxx iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi loop fuse scsi_transport_iscsi
May 24 15:33:56 localhost-live kernel: CPU: 1 PID: 174 Comm: kworker/u8:3 Tainted: G        W         5.6.6-300.fc32.x86_64 #1
May 24 15:33:56 localhost-live kernel: Hardware name: Hewlett-Packard HP Compaq Elite 8300 SFF/3397, BIOS K01 v02.05 05/07/2012
May 24 15:33:56 localhost-live kernel: Workqueue: btrfs-endio-meta btrfs_work_helper [btrfs]
May 24 15:33:56 localhost-live kernel: RIP: 0010:read_extent_buffer+0x10f/0x140 [btrfs]
May 24 15:33:56 localhost-live kernel: Code: c3 8b 0e 89 4d 00 89 c1 8b 74 0e fc 89 74 0d fc e9 72 ff ff ff 48 89 d1 4d 89 e0 4c 89 ca 48 c7 c7 e0 91 4d c0 e8 38 a4 c8 f9 <0f> 0b 31 f6 4c 89 e2 48 89 ef 5d 41 5c e9 bf 31 5d fa 89 c1 0f b7
May 24 15:33:56 localhost-live kernel: RSP: 0018:ffffb49dc026ba40 EFLAGS: 00010286
May 24 15:33:56 localhost-live kernel: RAX: 000000000000003d RBX: ffff9a37048b0000 RCX: 0000000000000007
May 24 15:33:56 localhost-live kernel: RDX: 00000000fffffff8 RSI: 0000000000000082 RDI: ffff9a37d6a99cc0
May 24 15:33:56 localhost-live kernel: RBP: ffffb49dc026ba59 R08: 0000000000000452 R09: ffffb49dc026b8d0
May 24 15:33:56 localhost-live kernel: R10: 0000000000000005 R11: 0000000000000000 R12: 00000000000001b7
May 24 15:33:56 localhost-live kernel: R13: 0000000000000065 R14: ffff9a370570f5a8 R15: 0000000000000f9b
May 24 15:33:56 localhost-live kernel: FS:  0000000000000000(0000) GS:ffff9a37d6a80000(0000) knlGS:0000000000000000
May 24 15:33:56 localhost-live kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
May 24 15:33:56 localhost-live kernel: CR2: 00007ffb02c13700 CR3: 00000000a960a005 CR4: 00000000000606e0
May 24 15:33:56 localhost-live kernel: Call Trace:
May 24 15:33:56 localhost-live kernel:  check_root_item+0x8b/0x180 [btrfs]
May 24 15:33:56 localhost-live kernel:  ? __find_get_block+0xb6/0x2f0
May 24 15:33:56 localhost-live kernel:  ? crc_42+0x1e/0x1e [crc32c_intel]
May 24 15:33:56 localhost-live kernel:  ? crc32c_pcl_intel_update+0xa4/0xb0 [crc32c_intel]
May 24 15:33:56 localhost-live kernel:  ? crc32c_intel_init+0x20/0x20 [crc32c_intel]
May 24 15:33:56 localhost-live kernel:  ? csum_tree_block+0x11f/0x130 [btrfs]
May 24 15:33:56 localhost-live kernel:  ? ext4_mark_iloc_dirty+0x61f/0x830
May 24 15:33:56 localhost-live kernel:  ? intel_cpufreq_target+0x140/0x140
May 24 15:33:56 localhost-live kernel:  ? btrfs_get_32+0x38/0x80 [btrfs]
May 24 15:33:56 localhost-live kernel:  check_leaf+0x489/0x1530 [btrfs]
May 24 15:33:56 localhost-live kernel:  ? check_preempt_curr+0x7e/0x90
May 24 15:33:56 localhost-live kernel:  ? ttwu_do_wakeup+0x19/0x140
May 24 15:33:56 localhost-live kernel:  ? map_private_extent_buffer+0xd0/0xd0 [btrfs]
May 24 15:33:56 localhost-live kernel:  btree_readpage_end_io_hook+0x2de/0x320 [btrfs]
May 24 15:33:56 localhost-live kernel:  end_bio_extent_readpage+0x1c0/0x710 [btrfs]
May 24 15:33:56 localhost-live kernel:  ? __rq_qos_done_bio+0x24/0x30
May 24 15:33:56 localhost-live kernel:  end_workqueue_fn+0x29/0x40 [btrfs]
May 24 15:33:56 localhost-live kernel:  btrfs_work_helper+0xd6/0x3a0 [btrfs]
May 24 15:33:56 localhost-live kernel:  process_one_work+0x1b4/0x380
May 24 15:33:56 localhost-live kernel:  worker_thread+0x53/0x3e0
May 24 15:33:56 localhost-live kernel:  ? process_one_work+0x380/0x380
May 24 15:33:56 localhost-live kernel:  kthread+0x115/0x140
May 24 15:33:56 localhost-live kernel:  ? __kthread_bind_ma33:56 localhost-live kernel:  ret_from_fork+0x35/0x40
May 24 15:33:56 localhost-live kernel: ---[ end trace 013462e0cfd87fc1 ]---
May 24 15:33:56 localhost-live kernel: BTRFS critical (device loop4): corrupt leaf: root=18446744073709551610 block=94920704 slot=1, invalid root item size, have 239 expect 439
May 24 15:33:56 localhost-live kernel: BTRFS error (device loop4): parent transid verify failed on 94920704 wanted 2727500 found 2727499
May 24 15:33:56 localhost-live kernel: BTRFS warning (device loop4): failed to read log tree
May 24 15:33:57 localhost-live kernel: BTRFS error (device loop4): open_ctree failed

> What do you get for:
> 
> # btrfs insp dump-s -fa /dev/
> 
[root@localhost-live tmp]# btrfs insp dump-s -fa /dev/loop4
superblock: bytenr=65536, device=/dev/loop4
---------------------------------------------------------
csum_type		0 (crc32c)
csum_size		4
csum			0xdc2c003a [match]
bytenr			65536
flags			0x1
			( WRITTEN )
magic			_BHRfS_M [match]
fsid			86180ca0-d351-4551-b262-22b49e1adf47
metadata_uuid		86180ca0-d351-4551-b262-22b49e1adf47
label			sailfish
generation		2727499
root			30703616
sys_array_size		226
chunk_root_generation	2342945
root_level		1
chunk_root		20971520
chunk_root_level	0
log_root		94920704
log_root_transid	0
log_root_level		0
total_bytes		14761832448
bytes_used		5075300352
sectorsize		4096
nodesize		4096
leafsize (deprecated)	4096
stripesize		4096
root_dir		6
num_devices		1
compat_flags		0x0
compat_ro_flags		0x0
incompat_flags		0x3
			( MIXED_BACKREF |
			  DEFAULT_SUBVOL )
cache_generation	2727498
uuid_tree_generation	0
dev_item.uuid		bb3ff90e-e471-48d6-af4e-add19a0a532d
dev_item.fsid		86180ca0-d351-4551-b262-22b49e1adf47 [match]
dev_item.type		0
dev_item.total_bytes	14761832448
dev_item.bytes_used	14761787392
dev_item.io_align	4096
dev_item.io_width	4096
dev_item.sector_size	4096
dev_item.devid		1
dev_item.dev_group	0
dev_item.seek_speed	0
dev_item.bandwidth	0
dev_item.generation	0
sys_chunk_array[2048]:
	item 0 key (FIRST_CHUNK_TREE CHUNK_ITEM 0)
		length 4194304 owner 2 stripe_len 65536 type SYSTEM
		io_align 4096 io_width 4096 sector_size 4096
		num_stripes 1 sub_stripes 0
			stripe 0 devid 1 offset 0
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
	item 1 key (FIRST_CHUNK_TREE CHUNK_ITEM 20971520)
		length 8388608 owner 2 stripe_len 65536 type SYSTEM|DUP
		io_align 65536 io_width 65536 sector_size 4096
		num_stripes 2 sub_stripes 0
			stripe 0 devid 1 offset 20971520
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
			stripe 1 devid 1 offset 29360128
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
backup_roots[4]:
	backup 0:
		backup_tree_root:	114339840	gen: 2727497	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	117129216	gen: 2727498	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	116412416	gen: 2727498	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075410944
		backup_num_devices:	1

	backup 1:
		backup_tree_root:	48250880	gen: 2727498	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	89980928	gen: 2727499	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	89243648	gen: 2727499	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075365888
		backup_num_devices:	1

	backup 2:
		backup_tree_root:	90173440	gen: 2727495	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	84922368	gen: 2727495	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	94969856	gen: 2727496	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075275776
		backup_num_devices:	1

	backup 3:
		backup_tree_root:	102043648	gen: 2727496	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	98189312	gen: 2727496	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	97951744	gen: 2727496	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075275776
		backup_num_devices:	1


superblock: bytenr=67108864, device=/dev/loop4
---------------------------------------------------------
csum_type		0 (crc32c)
csum_size		4
csum			0x7c4d28f4 [match]
bytenr			67108864
flags			0x1
			( WRITTEN )
magic			_BHRfS_M [match]
fsid			86180ca0-d351-4551-b262-22b49e1adf47
metadata_uuid		86180ca0-d351-4551-b262-22b49e1adf47
label			sailfish
generation		2727499
root			30703616
sys_array_size		226
chunk_root_generation	2342945
root_level		1
chunk_root		20971520
chunk_root_level	0
log_root		94920704
log_root_transid	0
log_root_level		0
total_bytes		14761832448
bytes_used		5075300352
sectorsize		4096
nodesize		4096
leafsize (deprecated)	4096
stripesize		4096
root_dir		6
num_devices		1
compat_flags		0x0
compat_ro_flags		0x0
incompat_flags		0x3
			( MIXED_BACKREF |
			  DEFAULT_SUBVOL )
cache_generation	2727498
uuid_tree_generation	0
dev_item.uuid		bb3ff90e-e471-48d6-af4e-add19a0a532d
dev_item.fsid		86180ca0-d351-4551-b262-22b49e1adf47 [match]
dev_item.type		0
dev_item.total_bytes	14761832448
dev_item.bytes_used	14761787392
dev_item.io_align	4096
dev_item.io_width	4096
dev_item.sector_size	4096
dev_item.devid		1
dev_item.dev_group	0
dev_item.seek_speed	0
dev_item.bandwidth	0
dev_item.generation	0
sys_chunk_array[2048]:
	item 0 key (FIRST_CHUNK_TREE CHUNK_ITEM 0)
		length 4194304 owner 2 stripe_len 65536 type SYSTEM
		io_align 4096 io_width 4096 sector_size 4096
		num_stripes 1 sub_stripes 0
			stripe 0 devid 1 offset 0
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
	item 1 key (FIRST_CHUNK_TREE CHUNK_ITEM 20971520)
		length 8388608 owner 2 stripe_len 65536 type SYSTEM|DUP
		io_align 65536 io_width 65536 sector_size 4096
		num_stripes 2 sub_stripes 0
			stripe 0 devid 1 offset 20971520
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
			stripe 1 devid 1 offset 29360128
			dev_uuid bb3ff90e-e471-48d6-af4e-add19a0a532d
backup_roots[4]:
	backup 0:
		backup_tree_root:	114339840	gen: 2727497	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	117129216	gen: 2727498	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	116412416	gen: 2727498	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075410944
		backup_num_devices:	1

	backup 1:
		backup_tree_root:	48250880	gen: 2727498	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	89980928	gen: 2727499	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	89243648	gen: 2727499	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075365888
		backup_num_devices:	1

	backup 2:
		backup_tree_root:	90173440	gen: 2727495	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	84922368	gen: 2727495	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	94969856	gen: 2727496	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075275776
		backup_num_devices:	1

	backup 3:
		backup_tree_root:	102043648	gen: 2727496	level: 1
		backup_chunk_root:	20971520	gen: 2342945	level: 0
		backup_extent_root:	98189312	gen: 2727496	level: 2
		backup_fs_root:		88788992	gen: 1765467	level: 0
		backup_dev_root:	49008640	gen: 2727493	level: 0
		backup_csum_root:	97951744	gen: 2727496	level: 2
		backup_total_bytes:	14761832448
		backup_bytes_used:	5075275776
		backup_num_devices:	1



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

end of thread, other threads:[~2020-05-24 19:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-17 19:51 I can't mount image Jiří Lisický
2020-05-18 23:45 ` Chris Murphy
2020-05-20 21:12   ` Jiří Lisický
2020-05-20 21:54     ` Chris Murphy
2020-05-23 14:38       ` Jiří Lisický
2020-05-23 23:21         ` Chris Murphy
2020-05-24 19:51           ` Jiří Lisický
2020-05-23 23:27         ` Chris Murphy

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).