linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jiří Lisický" <jiri_lisicky@seznam.cz>
To: linux-btrfs@vger.kernel.org
Subject: I can't mount image
Date: Sun, 17 May 2020 21:51:43 +0200	[thread overview]
Message-ID: <1e6bc0e299901f90613550570446777fbccdc21e.camel@seznam.cz> (raw)

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


             reply	other threads:[~2020-05-17 19:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 19:51 Jiří Lisický [this message]
2020-05-18 23:45 ` I can't mount image 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e6bc0e299901f90613550570446777fbccdc21e.camel@seznam.cz \
    --to=jiri_lisicky@seznam.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).