F3: a utility for testing USB sticks

Miscellaneous tools
Post Reply
Message
Author
User avatar
neerajkolte
Posts: 516
Joined: Mon 10 Feb 2014, 07:05
Location: Pune, India.

F3: a utility for testing USB sticks

#1 Post by neerajkolte »

Hi,

A friend of mine bought a cheap unbranded USB stick, and wanted me to check if it has all 8Gbs it promised.

I know I can check it by using h2testw on windows. But I wanted to do it in linux.

I searched and found f3


In my Fatdog64-631, I just unzipped it, opened the unzipped f3-master directory, pressed ` on keyboard to open terminal there, typed

Code: Select all

make linux
Done.

Now whenever I want to check a USB stick, I go into the unzipped directory, open terminal there, type

Code: Select all

# ./f3write /mnt/sdb1
to start write test.
And after it completes

Code: Select all

# ./f3read /mnt/sdb1
to start the read test.

My friend's USB stick was OK.
Gave 7.5mb/sec write speed and 20mb/sec read speed.

I also tested it in windows by h2testw, same result.


I am new to linux. I hope somebody makes PET of it and hopefully a GUI. :D
Attachments
f3-master.zip
(22.9 KiB) Downloaded 402 times
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.â€￾
- Amara’s Law.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

This is wish-granting day! :)

Enjoy!

musher0
Attachments
f3-3.0.pet
At the console prompt, simply type f3read | f3write /mnt/<media>.
The docs are in /usr/share/doc/f3.
(29.92 KiB) Downloaded 551 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
neerajkolte
Posts: 516
Joined: Mon 10 Feb 2014, 07:05
Location: Pune, India.

#3 Post by neerajkolte »

Thanks musher0,

I will test it when I get back home from work.
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.â€￾
- Amara’s Law.

User avatar
neerajkolte
Posts: 516
Joined: Mon 10 Feb 2014, 07:05
Location: Pune, India.

#4 Post by neerajkolte »

can this be done

Code: Select all

f3write /mnt/sdb1 && f3read /mnt/sdb1
I heard the double ampersand lets the first command to complete before second command while the pipe | executes both commands at the same time.
I may be wrong.


Might be useful to make simple no fuss point and click gui.
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.â€￾
- Amara’s Law.

Jasper

#5 Post by Jasper »

Hi the first contributors (et al),

Thanks guys.

I made the pet into an sfs and tried it on the ext4 formatted partition of the Flash Stick I use most of the time.

From the screen shot, it can be seen that I used "&&" in the command and that the average write speed was computed as 7.92 MB/s and read speed as 29.1 MB/s. The whole test took about 10 minutes and thus it seemed to be thorough and comprehensive.

However,

(1) The stick manufacturer only claimed speeds of 6.3 MB/s and 22.0 MB/s respectively. I believe the results vary widely with particular respect to the sizes and types of files used.

(2) The four files made during the test were not automatically deleted at any time after the test completed . I will delete them manually.
Attachments
Shot.png
(95.04 KiB) Downloaded 1059 times

Pelo

bravo Musher0

#6 Post by Pelo »

will add the information in your topic 'vérifier la santé de mes clés USBs' in the french community forum.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#7 Post by rcrsn51 »

Here is a GUI version. Look for it in the System menu or in a submenu.

F3 could also be used as a non-destructive "bleaching" tool for flash drives because it writes dummy data over all the empty parts of the drive.

[Edit] PET moved to here.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#8 Post by greengeek »

Thanks for the pet rcrsn51. I used it against one of my suspect sticks and it confirmed that it was bogus:

Code: Select all

Free space: 15.61 GB
Creating file 1.h2w ... OK!                             
Creating file 2.h2w ... OK!                           
Creating file 3.h2w ... OK!                           
Creating file 4.h2w ... OK!                           
Creating file 5.h2w ... OK!                         
Creating file 6.h2w ... OK!                         
Creating file 7.h2w ... OK!                         
Creating file 8.h2w ... OK!                         
Creating file 9.h2w ... OK!                         
Creating file 10.h2w ... OK!                         
Creating file 11.h2w ... OK!                         
Creating file 12.h2w ... OK!                         
Creating file 13.h2w ... OK!                         
Creating file 14.h2w ... OK!                         
Creating file 15.h2w ... OK!                       
Creating file 16.h2w ... OK!                       
Free space: 0.00 Byte
Average writing speed: 3.21 MB/s


                  SECTORS      ok/corrupted/changed/overwritten
Validating file 1.h2w ... 2097152/        0/      0/      0
Validating file 2.h2w ... 1841704/   205806/      0/  49642
Validating file 3.h2w ...       0/  1721652/      0/ 375500
Validating file 4.h2w ...       0/  1749034/      0/ 348118
Validating file 5.h2w ...       0/  1760931/      0/ 336221
Validating file 6.h2w ...       0/  1768064/      0/ 329088
Validating file 7.h2w ...       0/  1769973/      0/ 327179
Validating file 8.h2w ...       0/  1771809/      0/ 325343
Validating file 9.h2w ...       0/  1773838/      0/ 323314
Validating file 10.h2w ...       0/  1773785/      0/ 323367
Validating file 11.h2w ...       0/  1775044/      0/ 322108
Validating file 12.h2w ...       0/  1773289/      0/ 323863
Validating file 13.h2w ...       0/  1773519/      0/ 323633
Validating file 14.h2w ...       0/  1773479/      0/ 323673
Validating file 15.h2w ...       0/  1775418/      0/ 321734
Validating file 16.h2w ...       0/  1080306/      0/ 196350

  Data OK: 1.88 GB (3938856 sectors)
Data LOST: 13.73 GB (28795080 sectors)
          Corrupted: 11.56 GB (24245947 sectors)
   Slightly changed: 0.00 Byte (0 sectors)
        Overwritten: 2.17 GB (4549133 sectors)
Average reading speed: 5.88 MB/s 

After reading the f3 website info and the readme I thought maybe f3probe and f3fix might be worth a go but I was not able to get them to compile:

Code: Select all

# make experimental
cc -std=c99 -Wall -Wextra -pedantic -MMD -ggdb   -c -o libutils.o libutils.c
cc -std=c99 -Wall -Wextra -pedantic -MMD -ggdb   -c -o libdevs.o libdevs.c
libdevs.c: In function ‘wait_for_add_action’:
libdevs.c:456:2: error: invalid use of void expression
libdevs.c: In function ‘bdev_manual_usb_reset’:
libdevs.c:495:2: error: invalid use of void expression
libdevs.c: In function ‘usb_fd_from_block_dev’:
libdevs.c:530:2: error: invalid use of void expression
libdevs.c: In function ‘create_block_device’:
libdevs.c:648:2: error: invalid use of void expression
libdevs.c:681:2: error: invalid use of void expression
make: *** [libdevs.o] Error 1
# 
Probably the wrong lib on my Slacko 5.6 derivative. If you plan to make the experimental f3 utilities available I am keen to give them a try.
cheers!

User avatar
drunkjedi
Posts: 882
Joined: Mon 25 May 2015, 02:50

#9 Post by drunkjedi »

Hi Greengeek,

See the thread by rcrsn51,

He has compiled experimental f3.

Here, http://murga-linux.com/puppy/viewtopic. ... 476#876476

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#10 Post by greengeek »

drunkjedi wrote:..... experimental f3.
Here, http://murga-linux.com/puppy/viewtopic. ... 476#876476
Thanks dj - turns out f3probe won't run on my Slacko 5.6 derivative so I will have to give it a miss for now. Apparently Tahrpup 604 is where the f3 pet was compiled so at some point I will have to give that a try.
cheers!

Post Reply