You are not logged in.

#1 2014-11-23 17:29:31

maggie
Member
Registered: 2011-02-12
Posts: 255

Looking for info on f2fs.fsck repair mode [solved]

It looks like there isn't a util to repair f2fs filesystems yet. Is there some info out there that I can't find that talks about timelines for a util that can repair?

Last edited by maggie (2014-12-10 19:14:05)

Offline

#2 2014-11-23 22:57:44

davidm
Member
Registered: 2009-04-25
Posts: 371

Re: Looking for info on f2fs.fsck repair mode [solved]

Good news. smile Wikipedia says it was just implemented in September for an offline check and repair utility.

https://en.wikipedia.org/wiki/F2FS#Implemented


This version includes:
- fsck.f2fs fixing corrupted images/partitions
- dump.f2fs retrieving speicific file
- bug fixes on f2fsstat and fibmap.f2fs
- refactor code blocks for android build

https://lkml.org/lkml/2014/9/20/104

Offline

#3 2014-11-24 00:34:06

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: Looking for info on f2fs.fsck repair mode [solved]

Nice, I didn't catch that myself.

@maggie - it would seem as though you have this ability all along with the -f switch:

% fsck.f2fs 
	Error: Device not specified

Usage: fsck.f2fs [options] device
[options]:
  -a check/fix potential corruption, reported by f2fs
  -d debug level [default:0]
  -f check/fix entire partition
  -t show directory tree [-d -1]

Worked on my USB stick although it has never been umounted ungracefully:

% sudo fsck.f2fs -f /dev/sdc3                                                                               :(
Info: Force to fix corruption
Info: sector size = 512
Info: total sectors = 29728735 (in 512bytes)

[FSCK] Unreachable nat entries                        [Ok..] [0x0]
[FSCK] SIT valid block bitmap checking                [Ok..]
[FSCK] Hard link checking for regular file            [Ok..] [0x526]
[FSCK] valid_block_count matching with CP             [Ok..] [0xcd495]
[FSCK] valid_node_count matcing with CP (de lookup)   [Ok..] [0x1b73d]
[FSCK] valid_node_count matcing with CP (nat lookup)  [Ok..] [0x1b73d]
[FSCK] valid_inode_count matched with CP              [Ok..] [0x1b5ee]
[FSCK] free segment_count matched with CP             [Ok..] [0x155a]
[FSCK] next block offset is free                      [Ok..]
[FSCK] other corrupted bugs                           [Ok..]

Done.

Might be interesting to intentionally corrupt a sector and see if the util can actually detect and fix it.

Last edited by graysky (2014-11-24 13:44:34)

Offline

#4 2014-12-10 19:13:27

maggie
Member
Registered: 2011-02-12
Posts: 255

Re: Looking for info on f2fs.fsck repair mode [solved]

Thank you both.

Offline

Board footer

Powered by FluxBB