How to recover a corrupted flash memory using F3 tools under Linux

So what is F3?

sudo apt-get install f3

Test the flash

f3write /media/user/mounted_flash
f3read /media/user/mounted_flash

Fix attempt

SECTORS      ok/corrupted/changed/overwritten
Validating file 1.h2w ... 1021326/ 991976/ 0/ 2
Data OK: 498.69 MB (1021326 sectors)
Data LOST: 484.36 MB (991978 sectors)
Corrupted: 484.36 MB (991976 sectors)
Slightly changed: 0.00 Byte (0 sectors)
Overwritten: 1.00 KB (2 sectors)
Average reading speed: 21.21 MB/s
> lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sdc 8:32 1 986M 0 disk
└─sdc1 8:33 1 985M 0 part
...
f3 probe 6.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.
WARNING: Probing normally takes from a few seconds to 15 minutes, but it can take longer. Please be patient.Probe finished, recovering blocks... DoneBad news: The device `/dev/sdc' is a counterfeit of type limboYou can "fix" this device using the following command:
f3fix --last-sec=1015872 /dev/sdc
Device geometry:
*Usable* size: 496.03 MB (1015873 blocks)
Announced size: 986.00 MB (2019328 blocks)
Module: 1.00 GB (2^30 Bytes)
Approximate cache size: 0.00 Byte (0 blocks), need-reset=yes
Physical block size: 512.00 Byte (2^9 Bytes)
Probe time: 16.10s
# sudo ./f3fix --last-sec=1015872 /dev/sdc
F3 fix 6.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.
Drive `/dev/sdc' was successfully fixed

Gparted screenshot of the fixed flash

SECTORS      ok/corrupted/changed/overwritten
Validating file 1.h2w ... 1013280/ 0/ 0/ 0
Data OK: 494.77 MB (1013280 sectors)
Data LOST: 0.00 Byte (0 sectors)
Corrupted: 0.00 Byte (0 sectors)
Slightly changed: 0.00 Byte (0 sectors)
Overwritten: 0.00 Byte (0 sectors)
Average reading speed: 15.32 MB/s

 by the author.

--

--

--

Web developer, Arabic Native, open-source enthusiastic, trying to do things the right way.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

4 Mistakes to Avoid as a RoR Engineer

Invoke BI Report with Multiple Parameters Using Web Service

Best Practices for Writing Chef Cookbooks

7 Pieces of Advice to be a Successful Software Engineer

Abstract Factory Pattern in Swift

tudaBirds introduces birdTris: Retro play #gamefi

10BASE-T1L: Extending Big Data Analytics to the Edge of the Factory Network

Some tips that may help you with Jenkins on Pipeline-as-Code

A funny Jenkins logo

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ahmed Essam

Ahmed Essam

Web developer, Arabic Native, open-source enthusiastic, trying to do things the right way.

More from Medium

Survey: Activity Detection in Sport Climbing

ROracle installation on Linux

Introduction to GIT

CompTIA Linux+ Exam Question Part 3

CompTIA Linux+ Exam Question Part 3