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

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