How to check a USB thumb-drive for signs of life?

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

How to check a USB thumb-drive for signs of life?

Post by cobaka »

Hello all:

I want to check if my USB thumb-drive is 'dead' or 'alive'.
Here is a command I know nothing about:
# badblocks -w -s -o error.log /dev/sdX

Is this test destructive, on non-destructive?
If the thumb-drive is dead, it's "no biggie".

(Later) - just booted Toshiba (see below) from another thumb. Fossa-64.

Cobaka

(- extra info -)
I'm in the process of installing Puppy Linux to a Toshiba L750 laptop.
A few weeks ago I installed several Puppies on a single thumb-drive. (Never did that before).
Finished the installation. Booted a Puppy from each kennel in turn - then shut down.
From memory - did not make a single save file on this thumb-drive.
Succesfully booted at least one Puppy on another PC using this thumb-drive.
Now - using this thumb-drive + Toshiba: cannot boot any Puppy fr. this drive.
That's the past. Now I turn to today.

Am in the process of installing one Puppy into a Toshiba L750 laptop. (as I wrote above).
Friend said: "Can I have dual-boot?" Never done that before. I said: Sure! Easy-Peasy.

Have successfully booted this Toshiba into Friendly Puppy and Windows.
Windows from HDD. Puppy from a known bootable thumb-drive.

Swapped Friendly-Puppy thumb-drive with a second thumb-drive - the one mentioned above.
It's colour: silver/chrome. Now - when I boot the Toshiba - any Puppy: get warning. Kernel Panic. Not syncing. kill init! OR root login in TTY1, then FossaPup distro specs. I/O error (and so on)
Oh? I-O error. I read about that. It's worse than covid. ex-President Trump never got an I-O error!

When I put the thumb-drive in my working desk-top (I'm typing on it now) the partitions on the silver drive are mounted, visible and (using ROX) I can 'see' files and file parameters. When I click on a text file it opens.

I don't care if the thumb-drive is 'dead' - I just want to check it before I trash it.
I spent a lot of time installing Puppies onto this thumb-drive.

Other info: Method used to install many puppies on the silver thumb-drive: Manual - drag & drop, using ROX. Described on this forum by MikeSLR. Bootloader: Grub4Dos. Installation Puppy: uPupBB64.
(That's all folks!)

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

User avatar
sucuklu yumurta
Posts: 129
Joined: Thu Mar 09, 2023 3:12 am
Location: France
Has thanked: 320 times
Been thanked: 27 times

Re: Checking USB thumb-drive

Post by sucuklu yumurta »

Hi,

Linux terminal output:

Code: Select all

badblocks -w -s -o error.log /dev/sdh

Testing with pattern 0xaa: done
Reading and comparing: done
Testing with pattern 0x55: done
Reading and comparing: done
Testing with pattern 0xff: done
Reading and comparing: done
Testing with pattern 0x00: done
Reading and comparing: done

Tried 2 gb kingston usb2.0 stick, it needs to be "unmount", took about 30 minutes.
info: sdb or sdf or sdx
-------------------------------------------------------------------------------------
same process as above
I found something like this, For ext2/ext3/ext4 physical health of a USB stick in Linux

Code: Select all

mke2fs -ccv /dev/sdh

info: sdb or sdf or sdx

Linux terminal output:
# mke2fs -ccv /dev/sdh
mke2fs 1.47.0 (5-Feb-2023)
fs_types for mke2fs.conf resolution: 'ext2'
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
124160 inodes, 495872 blocks
24793 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=511705088
16 block groups
32768 blocks per group, 32768 fragments per group
7760 inodes per group
Filesystem UUID: 8bad46c3-20c3-450f-a02d-cc5e4426b3ba
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Running command: badblocks -b 4096 -X -s -w /dev/sdh 495871
Testing with pattern 0xaa: done
Reading and comparing: done
Testing with pattern 0x55: done
Reading and comparing: done
Testing with pattern 0xff: done
Reading and comparing: done
Testing with pattern 0x00: done
Reading and comparing: done
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
-------------------------------------------------------------------------------------
badblocks -w -s -o error.log After badblocks -w -s -o error.log /dev/sdh the usb mke2fs -ccv /dev/sdb that was formatted as "raw" and disappeared came back again after this operation

I don't know if it was destructive or not, but it wiped everything and formatted it as healthy ext2
Like a Linux Low Level Format

Last edited by sucuklu yumurta on Sat Sep 30, 2023 9:35 am, edited 3 times in total.

Acer Aspire One AO751h Netbook Intel Atom CPU Z520 1.33 GHz:1-1 core 2 GB+2 GB Swap SSD. Sony 5200 mAh: BullseyePup 9.1.0 Lite on Kingston SSD Frugal
Acer Aspire 3 A315-58-34HD 8 GB DDR4 4.10 GHz Intel Core i3-1115G4 CPU 2-4 128 GB SSD: BookwormPup64

Geek3579
Posts: 253
Joined: Sat Jul 18, 2020 1:07 pm
Has thanked: 72 times
Been thanked: 64 times

Re: Checking USB thumb-drive

Post by Geek3579 »

I think the -w writes a pattern, as does -n. leaving these out may make it non-destructive.

That's what I got out of the man badblocks anyway at https://linux.die.net/man/8/badblocks

User avatar
sucuklu yumurta
Posts: 129
Joined: Thu Mar 09, 2023 3:12 am
Location: France
Has thanked: 320 times
Been thanked: 27 times

Re: Checking USB thumb-drive

Post by sucuklu yumurta »

Extra info:
https://linux.die.net/man/8/badblocks

wrote:

Never use the -w option on a device containing an existing file system.
This option erases data! If you want to do write-mode testing on an existing file system, use the -n option instead. It is slower, but it will preserve your data.

Acer Aspire One AO751h Netbook Intel Atom CPU Z520 1.33 GHz:1-1 core 2 GB+2 GB Swap SSD. Sony 5200 mAh: BullseyePup 9.1.0 Lite on Kingston SSD Frugal
Acer Aspire 3 A315-58-34HD 8 GB DDR4 4.10 GHz Intel Core i3-1115G4 CPU 2-4 128 GB SSD: BookwormPup64

User avatar
bigpup
Moderator
Posts: 6516
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 790 times
Been thanked: 1352 times

Re: Checking USB thumb-drive

Post by bigpup »

If the computer has Windows on it.

If Windows was shutdown in hibernation.
It will not fully release control of the computer to do a normal boot.
So make sure Windows is shutdown as a normal shutdown.
Do not shutdown in hibernate!!!

If using Grub4dos boot loader.
It is not designed to boot computers with UEFI bios in normal UEFI setup.
You need to go into the UEFI setup and disable secure boot and or set it to legacy boot or CSM.
This will make the computer work like legacy bios, that Grub4dos boot loader was made for.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
cobaka
Posts: 538
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 57 times

Re: How to check a USB thumb-drive? (drive passed check!)

Post by cobaka »

Thanks all:

This is a trivial posting - duplicating what @sucuklu yumurta wrote below, but for a larger capacity (16GiB) thumb drive.
Ran the test on a newly purchased SanDISK 'ultra-fit' thumb USB3 thumb drive. Result: no stuck bits.

The device: SanDISK 'ultra-fit' - short body memory stick.
Thanks to all for help.

cobaka

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

Post Reply

Return to “Users”