linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Luke Dashjr <luke@dashjr.org>, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: Corrupt F2FS partition - fsck is useless
Date: Fri, 24 Aug 2018 21:08:30 +0800	[thread overview]
Message-ID: <5751656f-ff8a-0d3e-5737-47cf50e23c83@kernel.org> (raw)
In-Reply-To: <201808240431.07031.luke@dashjr.org>

Hi Luke,

I think the problem here is that we don't even start to traverse and check all
directories and files due to we encounter root inode sanity check failure.

[ASSERT] (sanity_check_nid: 412)  --> nid[0x3] footer.nid[0x30352c30]
footer.ino[0x30333238]

Could you dump root node info with below command:

dump.f2fs -i 3 -d 1 <your_device_path>

Thanks,

On 2018/8/24 12:31, Luke Dashjr wrote:
> One of my phones recently decided to corrupt its /data partition. I managed to 
> copy it to my PC before wiping the phone completely, but efforts to mount or 
> otherwise recover data from it have proven futile.
> 
> Mounting fails with dmesg showing:
> 
> [433918.994391] F2FS-fs (loop0): inconsistent node block, nid:3, 
> node_footer[nid:808791088,ino:808661560,ofs:92677510,cpver:4050480101642482739,blkaddr:757872690]
> [433918.995566] F2FS-fs (loop0): Failed to read root inode
> [433919.002420] F2FS-fs (loop0): inconsistent node block, nid:3, 
> node_footer[nid:808791088,ino:808661560,ofs:92677510,cpver:4050480101642482739,blkaddr:757872690]
> [433919.003598] F2FS-fs (loop0): Failed to read root inode
> 
> f2fs-tools v1.11.0's fsck crashes if I tell it to recover lost+found:
> 
> (NOTE: fsck output at https://luke.dashjr.org/tmp/code/fsck.f2fs-LF.log.xz )
> #0  0x0000555555559911 in memcpy (__len=18446744072369571950, 
> __src=0x5555557d644c, __dest=0x7fffffffd2d0)
>     at /usr/include/bits/string_fortified.h:34
> #1  convert_encrypted_name (    
> name=name@entry=0x5555557d644c "3\036\021\004\035=]\035\322\037\f(\212\202&\004\"\021\226\235Ec4
> [\227\266\221R1\332\331!
> \004\226\315\270\216\030\205\020\330\334\334\344\324sg\226\275-\317\352\352\032i\222]\326Ӌ\027^\030\226\005&\006|
> \333b\223\204I\323P\327\r\211K\220\306\321\064\r\271\263\064u\205\322\006g\034u]\003\002)\005!
> \200P\nc\024R\266\070\247\360>\342\333\330\361h$\022\203\265)\306$\264-di\316\331\346,B)\212^\211\321\032\227gdY\206M\023\256\272\346j\322<_\202\214\b!
> \361\241\213\370\336
> {\266\267w\230M&\370\246\345¹\027\271z\375\070u\323r\354\330\061\352 
> 9s\346\034\373\367\357'(\270\264\263E\226"..., len=-1339979666, 
> new=new@entry=0x7fffffffd2d0 "3\036\021\004\035=]\035", enc_name=<optimized 
> out>)
>     at fsck.c:1132
> #2  0x00005555555639d9 in print_inode_info (sbi=0x5555557817e0 <gfsck>, 
> node=0x5555557d63f0, name=1) at mount.c:183
> #3  0x000055555556424f in print_node_info (sbi=<optimized out>, 
> node_block=<optimized out>, verbose=<optimized out>)
>     at mount.c:277
> #4  0x00005555555620c2 in dump_node (sbi=sbi@entry=0x5555557817e0 <gfsck>, 
> nid=nid@entry=2875, force=force@entry=1)
>     at dump.c:520
> #5  0x000055555555f58f in fsck_verify (sbi=<optimized out>) at fsck.c:2568
> #6  0x000055555555679b in do_fsck (sbi=0x5555557817e0 <gfsck>) at main.c:569
> #7  main (argc=<optimized out>, argv=<optimized out>) at main.c:726
> 
> If I tell it NOT to recover lost+found, it completes, but mounting still 
> fails:
> 
> (NOTE: fsck output https://luke.dashjr.org/tmp/code/fsck.f2fs-NO-LF.log.xz )
> [434361.813196] F2FS-fs (loop0): Found nat_bits in checkpoint
> [434361.825628] F2FS-fs (loop0): Failed to read root inode
> [434361.828461] F2FS-fs (loop0): Found nat_bits in checkpoint
> [434361.840620] F2FS-fs (loop0): Failed to read root inode
> 
> Any ideas on how to get at least some data recovered from this?
> (Particularly the encryption key(s) Android stores at /data/misc/vold/*.key)
> 
> Thanks,
> 
> Luke
> 
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2018-08-24 13:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24  4:31 Corrupt F2FS partition - fsck is useless Luke Dashjr
2018-08-24 13:08 ` Chao Yu [this message]
2018-08-24 14:38   ` Luke Dashjr
2018-08-24 15:59     ` Chao Yu
2018-08-28  9:28       ` Chao Yu
2018-08-28  9:47         ` Luke Dashjr
2018-08-28 10:34           ` Chao Yu
2018-08-28  7:37 ` Jaegeuk Kim
2018-08-28  7:49   ` Luke Dashjr

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=5751656f-ff8a-0d3e-5737-47cf50e23c83@kernel.org \
    --to=chao@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=luke@dashjr.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).