

He wrote more than 7k+ posts and helped numerous readers to master IT topics. Vivek Gite is the founder of nixCraft, the oldest running blog about Linux and open source. See the following documentation using the man command or help command: You learned how to check the health status of a USB stick in Linux and further learned how to find out the actual size of a USB pen drive in case you got a faked USB pen drive. Use f3probe’s output to determine the parameters for i3fix: Only use to correct size for the fake drive. Run f3fix command to creates a partition that fits the actual size of the fake drive. Good news: The device `/dev/sdb’ is the real thing How to correct capacity to actual size for my USB stick in Linux The outputs from the above indicate that I do not have fake usb drive. Physical block size: 512.00 Byte (2^9 Bytes) Good news: The device `/dev/sdb' is the real thing WARNING: Probing normally takes from a few seconds to 15 minutes, but This is free software see the source for copying conditions. Sample outputs: password for vivek:Ĭopyright (C) 2010 Digirati Internet LTDA. It operates directly on the (unmounted) block device and needs to be run as a privileged user (be careful with device names again as -destructive option deletes all data): The f3probe command is the fastest drive test and suitable for large disks because it only writes what’s necessary to test the drive. If you believe you have bought a fake flash drive, try the following Linux commands. Quick capacity tests with f3probe on Linux Zero data lost indicate that my USB pen drive working fine.

Next, f3read will check if the flash disk contains exactly the written files: For example, my /dev/sda is mounted at /mnt/: First, f3write will write large files to your mounted USB pen disk. CentOS / RHEL 7: Install GCC (C and C++ Compiler) and Development Toolsįirst, install Homebrew on macOS to use the brew package manager as follows:īrew install f3 Testing performance with f3read/f3write.Debian Linux Install GNU GCC Compiler and Development Environment.Ubuntu Linux Install GNU GCC Compiler and Development Environment.Sudo apt install f3 Source code installationįirst, make sure you have compilers installed and running on Linux. Use the apt command or apt-get command as follows: F3 stands for Fight Flash Fraud, or Fight Fake Flash. -o error.log : Write the list of bad blocks to the error.log file in the current working directory.į3 is a simple tool that tests flash cards capacity and performance to see if they live up to claimed specifications.-w : Use write-mode test to scans for bad blocks by writing some patternson every block of the device, reading every block and comparing the contents.Gif 01: Test usb stick health using badblocks command in Linux Sudo badblocks -w -s -o error.log /dev/sda Once inserted the USB pen/stick, run the following command to search a device for bad blocks: Make sure you choose correct USB device name under Linux. Warning: This will destroy any previously stored data on your USB pen/stick. The output indicated that I am using /dev/sda for USB and /dev/nvme0n1 for NVme pci ssd. Linux command to check the physical health of a USB stickįirst, find out your USB stick or flash drive name under Linux, run: Let us see all commands and examples in details. To error check USB flash drive, you can use the f3write and f3read commands, which is an alternative to h2testw app from Windows operating systems.To test and detect bad sector in USB flash memory or pen drive, run: badblocks -w -s -o error.log /dev/sdX.Insert your USB stick or pen drive into Linux system.The procedure to check the physical health of a USB pen drive in Linux:
