Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Peripherals / Hardware
Reload this Page Can't write to USB Flash Drive
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Peripherals / Hardware Is your hardware supported? Having trouble getting some hardware working? Post here!

Reply
 
Thread Tools Display Modes
Old 06-08-2008   #1 (permalink)
Just Joined!
 
leisa's Avatar
 
Join Date: Jun 2008
Location: The World Wide Web
Posts: 13
Can't write to USB Flash Drive

Hi.

I have a pair of 4GB USB flash drives that I can't use. To be specific, these drives can't be written to at all.

I've attempted most of the obvious things. I've tried to remove/reformat the FAT32 partitions using Gparted. Fdisk doesn't recognize the partitions at all. Cfdisk outputs that "Partition begins after end-of-disk," Dosfsck finds all sorts of errors on thee drives but refuses to correct them. Mkdosfs didn't do anything. I tried to zero-out the drives using DD to no avail. Ditto for badblocks.

There is a small amount of data (one file) on each of these drives but nothing important. I don't care about recovering the data. I just want to be able to make these drives usable again.

Anyone have any suggestions?

--Leisa
leisa is offline   Reply With Quote
Old 06-08-2008   #2 (permalink)
Linux Enthusiast
 
Join Date: Nov 2007
Posts: 558
A) Do the USB sticks have a little switch on them (physically) that makes them read-only?

B) If not:

Code:
shred -vz -n 1 /dev/sdX
*Replace X with the correct drive from fdisk -l.

If that is failing, why? Check /var/log/messages, etc. I/O Error = HW problem.
HROAdmin26 is offline   Reply With Quote
Old 06-08-2008   #3 (permalink)
Just Joined!
 
leisa's Avatar
 
Join Date: Jun 2008
Location: The World Wide Web
Posts: 13
Hi,


Quote:
Originally Posted by HROAdmin26 View Post
A) Do the USB sticks have a little switch on them (physically) that makes them read-only?
There's no switch.



Quote:
B) If not:

shred -vz -n 1 /dev/sdX
Tried it as you suggested. Got all sorts of I/O errors (as expected).



Quote:
If that is failing, why? Check /var/log/messages, etc. I/O Error = HW problem.
Here's a sampling of the error messages in 'messages'.

Code:
Jun  8 19:29:09 laptop kernel: [256364.911826] sd 2:0:0:0: [sdb] Sense Key : Medium Error [current] 
Jun  8 19:29:09 laptop kernel: [256364.911831] sd 2:0:0:0: [sdb] Add. Sense: Cannot write medium - incompatible format
Jun  8 19:29:09 laptop kernel: [256364.911838] end_request: I/O error, dev sdb, sector 1007579
Jun  8 19:29:09 laptop kernel: [256364.924364] sd 2:0:0:0: [sdb] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK
It's worth noting that both of these drives went for a dump immediately after being inserted in (two different) Windows machines. This wasn't something that I thought important when the first one went several months ago but when the second one went down last week immediately after being used in an attempt to transfer data from my old XP laptop, I realized that these two incidents have something in common.
leisa is offline   Reply With Quote
Old 06-09-2008   #4 (permalink)
Linux Enthusiast
 
Join Date: Nov 2007
Posts: 558
Not much else to do. The write command being issued to the device is failing with a HW error message.

SCSI Sense Codes => Cannot write medium - incompatible format
HROAdmin26 is offline   Reply With Quote
Old 06-09-2008   #5 (permalink)
Just Joined!
 
leisa's Avatar
 
Join Date: Jun 2008
Location: The World Wide Web
Posts: 13
Yeah. I had a feeling that these drives were toast. Wish I knew exactly what caused it though.

Thanks anyway.

--Leisa
leisa is offline   Reply With Quote
Old 08-07-2008   #6 (permalink)
Just Joined!
 
Join Date: Aug 2008
Posts: 1
Did you tried changing the file system?
My Linux Notebook: Problem Writing to USB Flash Drive on Linux
theriach is offline   Reply With Quote
Old 08-12-2008   #7 (permalink)
Just Joined!
 
leisa's Avatar
 
Join Date: Jun 2008
Location: The World Wide Web
Posts: 13
Yes...

...but changing the file system requires writing to the drive.
leisa is offline   Reply With Quote
Old 08-13-2008   #8 (permalink)
Just Joined!
 
Join Date: Jan 2008
Posts: 57
Are these drives brand new? It's hard to believe they're toast already.

I bought a USB Flash drive recently and can use it fine in Linux.

Did you try booting up your OS and then inserting the USB flash drive afterwards?

Which Linux OS are you using? You could even test in on a LiveCD.

If you use an off-shoot Debian OS, you could try.... System -> Monitoring -> kdiskfree or kwikdisk (or System -> Applications -> kwikdisk)

See if the application 'sees it.' GParted should be able to see it, though. Try using other usb ports as well.

For some reason, it might not be mounting.
kopete is offline   Reply With Quote
Old 08-13-2008   #9 (permalink)
Just Joined!
 
leisa's Avatar
 
Join Date: Jun 2008
Location: The World Wide Web
Posts: 13
Quote:
Originally Posted by kopete View Post
Are these drives brand new? It's hard to believe they're toast already.
They're almost new.

Quote:
Did you try booting up your OS and then inserting the USB flash drive afterwards?
Yes.

Quote:
See if the application 'sees it.' GParted should be able to see it, though. Try using other usb ports as well.
I can see these drives in Gparted. I can go through the motions of deleting /changing the file system or formatting the drives. But Gparted won't actually carry out the commands.

Mounting these drives isn't the problem. They mount just fine. I can read them. I just can't write to them in any way, regardless of operating system.

As I mentioned earlier in this thread, they initially worked fine in Linux. Only after I tried to use the drives to transfer files from Windows machines did they break.
leisa is offline   Reply With Quote
Old 08-13-2008   #10 (permalink)
Just Joined!
 
Join Date: Jan 2008
Posts: 57
Quote:
Originally Posted by leisa View Post
They're almost new.

I can see these drives in Gparted. I can go through the motions of deleting /changing the file system or formatting the drives. But Gparted won't actually carry out the commands.

Mounting these drives isn't the problem. They mount just fine. I can read them. I just can't write to them in any way, regardless of operating system.

As I mentioned earlier in this thread, they initially worked fine in Linux. Only after I tried to use the drives to transfer files from Windows machines did they break.
Windows machines? XP? Vista? Were the files in a partition using NTFS format or FAT32? If it was NTFS, your Linux OS needs ntfs-3g installed. I think Ubuntu has it installed by default but I'm not sure. It could be part of the problem, perhaps.

You're saying you can't write to the usb drives in Linux from Linux either anymore? I would find out which /dev/sdXn (where X is the letter and n the number designation) Ubuntu is assigning it and try to create a directory for it. Then try to write something to it. Try doing it as root.

I would look at that and then go from there (eventually, you'll want to format but perhaps, see if there's any issues there?).
kopete is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 12:28 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0