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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-30-2020, 02:03 PM
|
#1
|
Senior Member
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943
|
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?
|
|
|
09-30-2020, 02:10 PM
|
#2
|
Senior Member
Registered: Aug 2016
Posts: 3,345
|
Quote:
Originally Posted by sgosnell
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.
|
09-30-2020, 02:22 PM
|
#3
|
Senior Member
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,040
Rep: 
|
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.
|
09-30-2020, 02:49 PM
|
#4
|
Senior Member
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943
Original Poster
|
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.
|
09-30-2020, 03:27 PM
|
#5
|
Moderator
Registered: Aug 2002
Posts: 26,512
|
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.
|
09-30-2020, 05:15 PM
|
#6
|
Senior Member
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943
Original Poster
|
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.
|
|
|
09-30-2020, 06:15 PM
|
#7
|
Moderator
Registered: Aug 2002
Posts: 26,512
|
I would say it's toast...
|
|
|
10-01-2020, 06:29 AM
|
#8
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,549
|
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.
|
|
|
10-01-2020, 09:19 AM
|
#9
|
Senior Member
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 22 MATE, Peppermint OS-Devuan, EndeavourOS
Posts: 4,287
|
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:
# 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.
|
|
|
10-01-2020, 11:41 AM
|
#10
|
Senior Member
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943
Original Poster
|
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.
|
|
|
10-01-2020, 01:35 PM
|
#11
|
Senior Member
Registered: Aug 2016
Posts: 3,345
|
Quote:
Originally Posted by sgosnell
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.
|
|
|
10-01-2020, 02:59 PM
|
#12
|
Senior Member
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943
Original Poster
|
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. 
|
|
|
All times are GMT -5. The time now is 10:13 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|