LinuxQuestions.org
Help answer threads with 0 replies.
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 09-30-2020, 02:03 PM   #1
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
USB flash drive read-only


I've been researching this for several days, with no luck. It's really just a learning exercise, not an "Urgent help required" thing. I have a SanDisk mini USB drive that has decided to become read-only. I cannot mount it otherwise, and gparted, testdisk, fsck, et al refuse to touch it because it is read-only. There are no physical switches on it. I would like to make it usable again, mostly just to see if I can do it. There is no data on it. It was formatted as ext4. I had it in a USB hub that switched between computers via a switch, and because of the small size I had forgotten that it was in the hub. I suspect the many switches were the cause of the problem. I know better, I just wasn't paying attention. As I said, it's only a 32GB flash drive, not expensive, with no data on it, but it's a problem I would like to learn to solve. If it's not fixable I can toss it without any pain, but knowledge is power, and I always want more.

Any suggestions?
 
Old 09-30-2020, 02:10 PM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486
Quote:
Originally Posted by sgosnell View Post
I've been researching this for several days, with no luck. It's really just a learning exercise, not an "Urgent help required" thing. I have a SanDisk mini USB drive that has decided to become read-only. I cannot mount it otherwise, and gparted, testdisk, fsck, et al refuse to touch it because it is read-only. There are no physical switches on it. I would like to make it usable again, mostly just to see if I can do it. There is no data on it. It was formatted as ext4. I had it in a USB hub that switched between computers via a switch, and because of the small size I had forgotten that it was in the hub. I suspect the many switches were the cause of the problem. I know better, I just wasn't paying attention. As I said, it's only a 32GB flash drive, not expensive, with no data on it, but it's a problem I would like to learn to solve. If it's not fixable I can toss it without any pain, but knowledge is power, and I always want more.

Any suggestions?
IIRC that is one of the symptoms of a flash drive failing. It sees too many errors and shuts of writing so it can no longer be used normally.
 
1 members found this post helpful.
Old 09-30-2020, 02:22 PM   #3
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,040
Blog Entries: 3

Rep: Reputation: 134Reputation: 134
I had a flash drive, usually gparted can fix faults on a flash drive, but I have had one that refused all attempts and I ditched it - it does happen.
 
1 members found this post helpful.
Old 09-30-2020, 02:49 PM   #4
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Original Poster
Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
It's probably toast. The magic number is reported to be wrong. I'll keep looking, and accepting suggestions, although it's probably a lost cause.
 
1 members found this post helpful.
Old 09-30-2020, 03:27 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,512

Rep: Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224
Can you write to the device using the dd command? If it is empty just try wiping out the partition table and start over.
 
1 members found this post helpful.
Old 09-30-2020, 05:15 PM   #6
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Original Poster
Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
I've tried repeatedly wiping the partition table and adding new. Neither works. Everything returns a read-only error. I can run e2fsck in read-only mode, but not any other way. Eveything refuses to alter anything on the drive.
 
Old 09-30-2020, 06:15 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,512

Rep: Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224
I would say it's toast...
 
Old 10-01-2020, 06:29 AM   #8
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,549

Rep: Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597Reputation: 1597
I've had a couple of SanDisk drives and SD cards fail on me and go in to read-only mode, retrieve the data, shred the card, move on. SanDisk are notorious for not being able to switch back once they've decided they are dead.
 
Old 10-01-2020, 09:19 AM   #9
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 22 MATE, Peppermint OS-Devuan, EndeavourOS
Posts: 4,287
Blog Entries: 48

Rep: Reputation: 1581Reputation: 1581Reputation: 1581Reputation: 1581Reputation: 1581Reputation: 1581Reputation: 1581Reputation: 1581Reputation: 1581Reputation: 1581Reputation: 1581
sgosnell,

It sounds like your USB drive may be faulty.

Try installing dcfldd, then zero the drive and then verify that it has been zeroed.

Then compare the two files with the comparison command (cmp).

dcfldd:
http://dcfldd.sourceforge.net/

Code:
sudo apt install dcfldd
Insert the USB drive and zero it:

Code:
sudo su
Code:
# dcfldd if=/dev/zero of=/dev/sdc bs=1M
Then remove and reinsert the USB drive.


Code:
# cmp /dev/zero /dev/sdc
My first output was:

7680 blocks (7680Mb) written. dcfldd:: No space left on device.

The cmp will hopefully fail at the point where it has reached the end of the drive.

If it fails before then, the drive isn't usable any more.


My second output was:

Code:
/dev/zero /dev/sdc differ: byte 1011713, line 1
which indicated a faulty drive.
 
Old 10-01-2020, 11:41 AM   #10
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Original Poster
Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
I appreciate the suggestions, and I'll keep them in mind for future problems, but sometimes it's better to just get on with life. The drive seems dead, and my interest in reviving a 10-year old flash drive has waned. I tossed it. I hesitate to mark the thread as solved, because throwing a drive in the trash isn't really a viable solution for most users. I'll give that some thought.
 
Old 10-01-2020, 01:35 PM   #11
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486
Quote:
Originally Posted by sgosnell View Post
I appreciate the suggestions, and I'll keep them in mind for future problems, but sometimes it's better to just get on with life. The drive seems dead, and my interest in reviving a 10-year old flash drive has waned. I tossed it. I hesitate to mark the thread as solved, because throwing a drive in the trash isn't really a viable solution for most users. I'll give that some thought.
For a 10 year old flash drive that seems the perfect solution to me. I doubt most users would persist in attempting to recover that device for nearly as long as you did.
 
Old 10-01-2020, 02:59 PM   #12
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Original Poster
Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
Probably most wouldn't. As I said, it was just a learning exercise, and with the current situation I have plenty of time on my hands. Eventually, though, better uses of time can be found.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Unable to affect changes to a Flash Drive that only mounts read only bushy Linux - Newbie 17 08-20-2019 12:56 PM
[SOLVED] USB flash drive becomes read only (again)! GTrax Linux - Hardware 18 04-29-2019 12:27 PM
USB flash drive (Pen drive) mounts read only prabhatsoni Linux - Hardware 24 07-02-2007 02:28 PM
FLASH FLASH XP Home and Samba Fix FLASH FLASH zollodav Linux - Networking 1 02-19-2006 02:16 AM
usb flash drive always read-only flihp Linux - Hardware 2 11-12-2005 06:14 PM

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

All times are GMT -5. The time now is 10:13 PM.

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