LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-11-2016, 04:12 AM   #1
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,969
Blog Entries: 32

Rep: Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464
USB flash drive problem


I have a 8GB Corsair Voyager USB flash drive which is misbehaving.

I have just used this command:

Code:
sudo dd if=/dev/zero of=/dev/sdc bs=512 count=1
After using the above command, the output is:

Code:
1+0 records in
1+0 records out
512 bytes copied, 112.072 s, 0.0 kB/s
I believe that this should read 7.5GB copied, not 512 bytes.

Any further suggestions to ascertain whether this is a dying/dead flash drive or is there some hope?

Earlier, when trying to format the drive as FAT32, I received this:

Code:
dd: error writing '/dev/sdc': Input/output error
1+0 records in
0+0 records out
0 bytes copied, 112.568 s, 0.0 kB/s
There was another message on another occasion which said something about block size being 512, but kernel using/reading 1024.

I am using Linux Mint 18 MATE.
 
Old 07-11-2016, 05:13 AM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
bs=512 count=1

512 bytes to copy
 
Old 07-11-2016, 05:59 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893
in addition,
Code:
sudo dd if=/dev/zero of=/dev/sdc bs=512 count=1
This command zeroes out the MBR/partition table, not the entire drive which completes successfully.

Not enough information posted to know why your other dd command failed. Formatting is not usually done using dd except maybe if you are writing an image file.
 
Old 07-11-2016, 06:25 AM   #4
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,969

Original Poster
Blog Entries: 32

Rep: Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464
Thanks for the replies.

How do I find out whether my drive is corrupted and salvageable?

What commands do you suggest for further investigation/cleaning/wiping/formatting?

Ideally I would like to format this as FAT32, if it is still functioning correctly.

Last edited by beachboy2; 07-11-2016 at 06:33 AM.
 
Old 07-11-2016, 07:06 AM   #5
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,986

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Install gparted if it's not already installed:
Code:
sudo apt-get install gparted
and check out the flash drive in gparted. It will tell you if there is something wonky with your flash drive.
 
Old 07-11-2016, 07:08 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893
See what happens when you create a partition table and partition using using your utility of choice i.e. fdisk, gparted etc.

Then format using:

mkfs.vfat -F 32 /dev/sdc1

Make sure you use the correct device ID otherwise you could loose the OS and your data. Formatting creates the file allocation tables but does not actually erase data from the partition. Check the output of the dmesg command for errors.

If that works you could try filling the drive with random data like below. Use the actual mount point. The command should quit with a no more room on device error.

dd if=/dev/random > /mnt/sdc1/dummy.file

Flash drives have a limited number of writes and do fail.
 
Old 07-11-2016, 07:16 AM   #7
plasmonics
Member
 
Registered: Jan 2009
Distribution: Fedora, Gentoo, LFS
Posts: 224

Rep: Reputation: 69
I have two corsair voyager usb 2.0. One of them runs hot, but they are otherwise reliable.

Your command executed as it is supposed to. It zeroed the MBR. You could try TestDisk to see if it can recover the remaining data. If you don't care about the data and just want to reformat, you first have to put a new msdos label on it.
Code:
fdisk /dev/sdb
Then create a new partition of type code "c". After you quit fdisk, you are ready to format the usb.
Code:
mkfs.vfat -n "CORSAIR" -F32 /dev/sdb1
Gparted can do the same thing.

Before you reformat, you could try mounting /dev/sdb1 to see if the old data are still there.
 
Old 07-11-2016, 09:00 AM   #8
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,969

Original Poster
Blog Entries: 32

Rep: Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464
Thanks to all of you for your replies.

Using gparted (Device > Create Partition table) and trying to create new partition table (msdos) gives this output:

Code:
/dev/sdc: unrecognised disk label
Input/output error during write on /dev/sdc
gpartedbin: Fatal IO error 0 (Success) on X server :0.
Error fsyncing/closing /dev/sdc: Input/output error

(gpartedbin:3833): glibmm-ERROR **: 
unhandled exception (type std::exception) in signal handler:
what: std::bad_alloc

Trace/breakpoint trap
I think this flash drive is heading for the wastebin unless there are other suggestions.

Last edited by beachboy2; 07-11-2016 at 09:03 AM.
 
Old 07-11-2016, 09:02 AM   #9
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You can try and create filesystem on it without partitioning, mkfs.ext4 /dev/sdc, but it certainly looks like your stick is expired.
 
Old 07-11-2016, 09:14 AM   #10
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,969

Original Poster
Blog Entries: 32

Rep: Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464
Emerson,

Thanks for that.

Output is:

Code:
 mkfs.ext4 /dev/sdc

mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 1966080 4k blocks and 491520 inodes
Filesystem UUID: 99156073-cfcc-41ad-841f-04036ce48423
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:      
Warning, had trouble writing out superblocks.
It does not look good.

Last edited by beachboy2; 07-11-2016 at 09:44 AM.
 
Old 07-11-2016, 11:14 AM   #11
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,969

Original Poster
Blog Entries: 32

Rep: Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464
I have discovered an interesting post by Shadow 7 (post #6):

http://www.linuxquestions.org/questi...ue-4175583153/

Quote:
ZEROING the flash drive:
Normally when I repurpose a stick I will zero it out, then verify that it got zeroed. If it didn't then the stick isn't in a usable state anymore.
NB Need to first install dcfldd:
http://dcfldd.sourceforge.net/

Code:
sudo apt-get install dcfldd
Code:
# dcfldd if=/dev/zero of=/dev/sdc bs=1M
Then remove and reinsert USB drive.

Code:
# cmp /dev/zero /dev/sdc

My output was:

Code:
# dcfldd if=/dev/zero of=/dev/sdc bs=1M

7680 blocks (7680Mb) written.dcfldd:: No space left on device.
Remove and reinsert USB drive.

The cmp will fail at the point that it has reached the end of the drive hopefully. If it fails before then, the drive isn't usable anymore.

Code:
# cmp /dev/zero /dev/sdc
/dev/zero /dev/sdc differ: byte 1011713, line 1
I guess that this is "goodnight Vienna".

My thanks to all who replied.

Last edited by beachboy2; 07-11-2016 at 11:38 AM.
 
Old 08-02-2016, 04:23 PM   #12
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,969

Original Poster
Blog Entries: 32

Rep: Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464Reputation: 1464
The good news is that Corsair replaced my 8 year old Voyager USB 2.0 with a 32GB USB 3.0 Flash Survivor Stealth 200m Water Proof Flash Drive:

https://www.amazon.co.uk/Corsair-CMF.../dp/B008HK5136

Thank you Corsair.
 
1 members found this post helpful.
  


Reply

Tags
dead, drive, flash



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Flash Drive Problem - Light glows, but drive is not detected MihirSahasrabudhe Linux - Hardware 5 07-07-2010 08:51 AM
usb flash drive problem soumalya Linux - Desktop 3 06-01-2008 05:23 AM
USB flash drive problem Executor21 SUSE / openSUSE 4 12-17-2006 12:45 PM
Problem with USB flash drive dmsynck Debian 4 11-23-2005 01:43 PM
USB flash drive problem Kensai Mandriva 6 02-23-2004 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration