f3 icon indicating copy to clipboard operation
f3 copied to clipboard

f3brew

Open efa opened this issue 7 years ago • 18 comments

I read all the docs, the man, and so, it is not clear what do the f3brew command.

efa avatar Jun 13 '18 22:06 efa

Hi @efa,

f3brew writes and reads directly to a block device. I haven't documented it because the only use I've found for it is to help to figure out what a fake card is doing. One could use it instead of f3write/f3read, but f3write/f3read are safer to use since they don't require root access. So you can safely ignore f3brew for now.

AltraMayor avatar Jun 22 '18 15:06 AltraMayor

OK, clear. Writing to a block device is a more complete test, think to flashUSB with many partitions on, testing using f3write/f3read will require many steps and anyway does not test all the device

efa avatar Jun 22 '18 15:06 efa

Using f3brew on the entire drive instead of a single partition would destroy the partition table.

While I see your point that testing block devices directly is a more complete test, I have not found a case in which f3write/f3read would report a false positive (i.e. f3write/f3read say the device is good while it's a fake) or a false negative (i.e. f3write/f3read say the device is bad while it's good). But I do have listened to a couple of users that have lost data before we had f3fix.

AltraMayor avatar Jun 22 '18 15:06 AltraMayor

if I understood well, f3write/f3read will destroy the data on partitions, so after the test, the user has to re-format the flashUSB. Re-partitioning too, is not much effort.

efa avatar Jun 22 '18 16:06 efa

I've used f3write to trigger the block reassign of mechanical disks, it would be very handy to write to all the blocks of a device. I haven't seen f3brew (or f3probe or f3fix) in any of the distributions I have.

I can see a case where f3write/f3read will return a false negative, because the filesystem has written its critical blocks to the corrupted location, which will never be written to by simply creating files.

silicontrip avatar Jul 10 '18 02:07 silicontrip

Your point is valid, @silicontrip. But it's so rare that I haven't come across this false negative.

I'm not holding back f3brew; it's included in the repository here on GitHub. People are free to use f3brew and a pull request to document it will be welcome.

AltraMayor avatar Jul 10 '18 11:07 AltraMayor

man f3brew says:

-s, --reset-type=TYPE
              Reset method to use during the probe.

What is this option? What are possible values for TYPE?

Will this reset the USB device between write and read phases to expose drives that use volatile memory instead of persistent memory? This could be very useful to detect certain types of problems.

Right now I'm dealing with drives that show errors only after power cycling between f3write and f3read, otherwise they pass the tests without errors. They are not fake, just faulty.

unfa avatar Sep 20 '18 09:09 unfa

After all blocks are written, f3brew resets the device before reading all blocks back to check. The default reset method requires the user to pull the device of the USB port and put it back.

There are only three possible values for the current code in the repository:

  • 0 (RT_MANUAL_USB), the default, manual reset.
  • 1 (RT_USB), it sends a reset request to the USB device, which may ignore the request.
  • 2 (RT_NONE), it doesn't do anything.

AltraMayor avatar Sep 20 '18 12:09 AltraMayor

@AltraMayor i just want to say thanks for the f3brew tool. it is really helpful for what i am planning to do: writing a complete disk and validate if the content changed after long term storage without power applied to them.

I am trying to prove (or disprove) the theory that SSDs lose their data after an extended time without attached to a power source.

Regards!

makefu avatar Aug 04 '20 18:08 makefu

You are welcome, @makefu. After your test, post the result here. It'd be informative for many out there.

AltraMayor avatar Aug 04 '20 18:08 AltraMayor

@AltraMayor the first results are planned in ~1 year, but i will surely check back!

makefu avatar Aug 04 '20 18:08 makefu

it is already proved. Cosmic ray cause upset (status change) in flash memory bits. Sure you will find some changed, if not masked by builtin ECC recover.

Valerio

Il 04/08/20 alle 20:10, Felix Richter ha scritto:

@AltraMayor https://github.com/AltraMayor i just want to say thanks for the f3brew tool. it is really helpful for what i am planning to do: writing a complete disk and validate if the content changed after long term storage without power applied to them.

I am trying to prove (or disprove) the theory that SSDs lose their data after an extended time without attached to a power source.

Regards!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AltraMayor/f3/issues/83#issuecomment-668747083, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMBPZCMBVPKTFN5W3HE32LR7BFKTANCNFSM4FE4BHGQ.

-- Valerio

efa avatar Aug 04 '20 19:08 efa

@efa can you point me towards some papers i can use? also, is the issue similar to HDDs or worse? How long will it take until ECC cannot recover from bit flips?

I've also read about Quantum leakage in NAND-flash however i never found how bad the effect actually is. Please share you insight!

EDIT: the reports about the capability to store SSDs in the shelve without data corruption ranges from "no guarantee for storage over a month" to "you can store data on an SSD an unlimited amount of time without power attached"

makefu avatar Aug 04 '20 19:08 makefu

rad hard electronic components exist to be used in space, because there is no atmospheric shield. Also planes at flight levels (10-15 km of height) suffer from radiations, till at Earth surface some cosmic ray and ionizing radiation arrive, and with a certain probability, cause damage, reversible (soft error) or not (hard error).

The subject is very vast, and you can master it after months of study or work in a company that produces for military or space applications. Start reading here: https://en.wikipedia.org/wiki/Radiation_hardening

efa avatar Aug 04 '20 19:08 efa

I usually want to test the device on a block level -- usually I use badblocks, but f3* seems more targeted to test if devices are fake.

I also stumbled upon f3brew and had to search for third party documentation to find out what it is and to find out that I prefer to use it. (With f3write/ f3read I frist have to create partitions that fill the whole device, preferably one single partition, which is not always the use case. I prefer to test a device before partitioning.) I hereby also request that a help message and a manpage for f3brew to be included.

Maybe the Debian manpage might help as a starting point, or can directly be incorporated?

dreirund avatar May 28 '21 11:05 dreirund

A pull request to add documentation is welcome.

AltraMayor avatar May 28 '21 11:05 AltraMayor

On Fri, 28 May 2021 11:53:52 +0000 (UTC), Michel Machado @.***> wrote about "Re: [AltraMayor/f3] f3brew (#83)":

A pull request to add documentation is welcome.

I don't know how to do that -- but the debian manpage is there and as I know debian unter a free license so that I think it can be copypasted.

-- Wählt man eine der Antworten zu dieser Frage zufällig aus, wie hoch ist die Wahrscheinlichkeit, dass sie korrekt ist?

a) 1/3 b) 1/3 c) sonstige, und zwar: ____

dreirund avatar May 28 '21 12:05 dreirund

@makefu I found a really goog didactic video that explain the cosmic ray effect on digital components: https://www.youtube.com/watch?v=AaZ_RSt0KP8

efa avatar Nov 30 '21 00:11 efa