remove "read only"(write protection) from pendrive

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
Post Reply
69Rixter
Level 3
Level 3
Posts: 187
Joined: Sun Aug 31, 2014 3:20 pm
Location: Central Ohio

remove "read only"(write protection) from pendrive

Post by 69Rixter » Sat Feb 10, 2018 6:26 pm

Afternoon:

I have a problem that's got me baffled and hope there's folks here who can help. I have a Kingston DT101 16Gb pendrive that has somehow attained "Read Only" status. I assure you I never configured this 'write protection". So, I've tried (in Win7) diskpart, regedit, a D/l program "EaseUs", and in Linux; sudo apt-get remove write protection sdE, wiped partition/rebuild partition. The drive will "write", which I don't understand, but at the incredibly slow rate of 1.8-2.4Mb/s. The benchmark for the drive is 5Mb/s minimum. So, first let me say it's not about replacing the drive, buying another one, it's about removing the write protection and figuring out how it got on the drive in the first place. Oh, this is the second time I've had this same scenario happen and I couldn't 'fix" the other drive. Anyone believe they are able to help me out?

:? Rick

User avatar
Termy
Level 5
Level 5
Posts: 762
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: remove "read only"(write protection) from pendrive

Post by Termy » Sat Feb 10, 2018 6:40 pm

Hi, Rick.

If you enter a terminal and enter lsblk can you identify the name of the device? (ex: /dev/sdh1) If so, enter lsblk -no ro /dev/sdh1 (where sdh1 is the drive and partition relevant to your setup) and tell me if you see a "0" or a "1". This is just to confirm the system is accessing it in read only mode, and not some sort of hardware issue. Just to double-check, run this too: hdparm -r /dev/sda You may need to prefix the command with sudo . It may not work as I can't remember if Mint comes with hdparm. If they both show read-only, then I guess it's most definitely in read-only mode!

So, to check, you're having issues with the drive(s) in Windows too? Or is this exclusively an issue with Linux?
69Rixter wrote:The drive will "write", which I don't understand, but at the incredibly slow rate of 1.8-2.4Mb/s.
So it's not read-only? I'm confused. Is Linux telling you somewhere that it's read-only, but you're none-the-less still able to write data to it, albeit slowly?

As this has happened before, I'm more inclined to believe this is a software configuration issue, on the Linux side. Most especially because this sudo apt-get remove write protection sdE is nonsensical. :? Did somebody somewhere tell you to run that?

By the way, if the above tests still show it's in read-only mode, can you try remounting in rw? Via the terminal, of course. xD Using this command: sudo mount -o remount,rw /dev/sdh1 where sdh1 is again whatever is applicable to your setup.
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

User avatar
coffee412
Level 5
Level 5
Posts: 817
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact:

Re: remove "read only"(write protection) from pendrive

Post by coffee412 » Sat Feb 10, 2018 7:42 pm

I have a sandisk 32 gig flash drive. Its got the same problem. I have researched this and have found that when the sandisk controller detects an error it will put the drive in read only mode to protect what data is on the drive. This gives you the opportunity to get the data off the drive and get rid of it.

Thats my understanding at this point unless someone has been able to change it to rw. I cannot and I assume the drive basically has failed.
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
IceWarp * Samba AD * Mint 18.1 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36

User avatar
Termy
Level 5
Level 5
Posts: 762
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: remove "read only"(write protection) from pendrive

Post by Termy » Sat Feb 10, 2018 7:45 pm

That sounds like a handy feature. However, LInux has something similar: if enabled, a file system met with some sort of error will remount itself as read-only. Root (/) usually has this set by default: errors=remount-ro Is a bit strange to see that enabled on an external drive though.
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

User avatar
coffee412
Level 5
Level 5
Posts: 817
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact:

Re: remove "read only"(write protection) from pendrive

Post by coffee412 » Sat Feb 10, 2018 7:58 pm

Termy wrote:
Sat Feb 10, 2018 7:45 pm
That sounds like a handy feature. However, LInux has something similar: if enabled, a file system met with some sort of error will remount itself as read-only. Root (/) usually has this set by default: errors=remount-ro Is a bit strange to see that enabled on an external drive though.
Its not an actual drive but a mem stick (flash drive ect. whatever you want to call it)
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
IceWarp * Samba AD * Mint 18.1 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36

69Rixter
Level 3
Level 3
Posts: 187
Joined: Sun Aug 31, 2014 3:20 pm
Location: Central Ohio

Re: remove "read only"(write protection) from pendrive

Post by 69Rixter » Sat Feb 10, 2018 9:58 pm

Evening:

OK, got "read only" issue resolved. This is the output of 'diskpart";
Current Read Only :NO
Read Only :NO
Boot Disk :NO
Pagefile Disk :NO
Hibernation File Disk :NO
Crashdump Disk :NO
Clustered Disk :NO

Now, I immediately tested the "write" (transfer) and still, it was exceedingly slow; Avg. rate 1.8 Mb/s; lowest rate 1.69Mb/s. Benchtest for this device 5 Mb/s minimum. HHHHMMM. Got any suggestions?

:?: Rick

User avatar
Termy
Level 5
Level 5
Posts: 762
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: remove "read only"(write protection) from pendrive

Post by Termy » Sun Feb 11, 2018 8:34 am

coffee412 wrote:
Sat Feb 10, 2018 7:58 pm
Its not an actual drive but a mem stick (flash drive ect. whatever you want to call it)
Oh yeah, I know -- I still consider it a drive, you know, since 'pendrive', and 'flash drive'. :P
69Rixter wrote:Now, I immediately tested the "write" (transfer) and still, it was exceedingly slow; Avg. rate 1.8 Mb/s; lowest rate 1.69Mb/s. Benchtest for this device 5 Mb/s minimum. HHHHMMM. Got any suggestions?
Glad to see the read-only issue is solved! Just to check, are you sure it's not plugging into an old USB 1.1 port? Those things are slooow as heck. Have you also tried the stick in different ports? In-case the port itself is faulty. Lastly, the port may not be getting enough power; I think they're usually rated at 500mA, at least for USB 2, I believe. If you unplug the other USB devices from the same hub, does the transfer speed go up?
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

69Rixter
Level 3
Level 3
Posts: 187
Joined: Sun Aug 31, 2014 3:20 pm
Location: Central Ohio

Re: remove "read only"(write protection) from pendrive

Post by 69Rixter » Sun Feb 11, 2018 9:15 am

Hey Termy:

Well, NO, I'm not SURE of anything concerning this issue/pendrive. Just the fact that it still 'wrote" to the drive when it 'supposedly" was in read only mode makes me shake my head. As far as the problem being within the USB port and or the comp itself, absolutely, that could be the problem???? So, today, I've got a bit of time on my hands and I plan on running a number of 'tests" to try and determine what the heck is going on. I'll get back to everyone on my results in the next few days.

Keep Pushin' On:
:twisted: Rick

User avatar
austin.texas
Level 20
Level 20
Posts: 12055
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: remove "read only"(write protection) from pendrive

Post by austin.texas » Sun Feb 11, 2018 9:31 am

To find out the speed of the USB port (1.1, 2.0, or 3.0) , plug in the flash drive and run:

Code: Select all

lsusb
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

69Rixter
Level 3
Level 3
Posts: 187
Joined: Sun Aug 31, 2014 3:20 pm
Location: Central Ohio

Re: remove "read only"(write protection) from pendrive

Post by 69Rixter » Sun Feb 11, 2018 3:43 pm

Afternoon TERMY:

Just a bit of initial testing. I took 2 of my other pendrives and tested transfer speed using same comp/same ports. I got an average 5.5Mb/s. Then ran a transfer to Kingston from one of those aforementioned pendrives and got avg. 1.90 Gb/s ??? Next same pendrives, same comp, same files tranfered on LM 18.3 and got Avg. 4.2Gb/s??? This get weirder the more I 'test"". OK, so ran lsusb and received
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0781:5575 SanDisk Corp.
Bus 001 Device 004: ID 413c:2113 Dell Computer Corp.
Bus 001 Device 003: ID 0424:2412 Standard Microsystems Corp.
Bus 001 Device 002: ID 413c:301a Dell Computer Corp.
Bus 001 Device 006: ID 0951:1665 Kingston Technology Digital DataTraveler SE9 64GB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

2 things here; #1. bus 001 dev. 6: ID0951:1665 Kkingston Tech. Dig. DT SE9 64GB no, no, no!!! It's 16Gb!!! ??? (I might have an answer for that) #2. Bus 002 Device 001 & Bus 001 Device 001 Same device, different hubs? NOT! OK, what am I looking at here? BTW... Bus002 Dev. 001; Bus001 Dev.5 & Bus001 Dev.001 are the same 8Gb Sandisk pendrive that runs my LM 18.3. And forgive my ignorance, but I don't see where the drive in question (Bus001 Dev.6) shows the USB port speed? If you'll note in my earlier thread the device "name" of the Kingston pendrive is DT 101 and not SE9. (not a big deal) and last...when kingston is in MSWin7 it registers 14.43 usuable space. When in LM 18.3 it registers 15.5; difference of a Gb? LOL LOL Any plausible explanation? You suppose I should go on using the disc and forget all the questions? :roll: :lol:
OK, I'm still trying to determine the speed of the ports. Be back later:

Rick

User avatar
austin.texas
Level 20
Level 20
Posts: 12055
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: remove "read only"(write protection) from pendrive

Post by austin.texas » Sun Feb 11, 2018 4:02 pm

I expected to see something like this:
where my Toshiba is connected to Bus 011 and it is listed as 3.0 (both bold lines here)
~ $ lsusb
Bus 013 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 012 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 012 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 011 Device 002: ID 0480:a007 Toshiba America Inc External Disk USB 3.0
Bus 011 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 010 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Your results do show that the Kingston is connected to a 2.0 port - not 3.0
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

69Rixter
Level 3
Level 3
Posts: 187
Joined: Sun Aug 31, 2014 3:20 pm
Location: Central Ohio

Re: remove "read only"(write protection) from pendrive

Post by 69Rixter » Mon Feb 12, 2018 8:13 pm

Hey:

Alright, I've tried to run the tests for the USB ports, but just wasn't sure of the "programs" that I could've used, or of how to get the info from the comps themselves. So, let's go this route and see what you all think. Supposing I were to do a thorough "wipe" of the drive. No, not just a format, but a complete wipe of the entire pendrive. I don't feel the problem lies in the USB ports anyways. Something altered the write cache ( I believe) of the pendrive when the "read only" designation occurred. Should I do the "nuke", what program would I then use to re-establish use of the drive. Now, IF I don't run a "nuke" of the drive, my last option would be to just fill it up and forget 'writing"/transferring anything else. Just use it as "read only". And understand, when giving an opinion, please state so! OH, lastly...anyone have any thoughts on what may have cause the drive to revert to "read only"? I know that some pendrives have a 'defense" mode that should something occur that is detrimental, the drive will revert to read only just to protect the files stored on them, but other than that, I'm clueless.

Another Day, Another Dollar...in debt!

Rick

User avatar
Termy
Level 5
Level 5
Posts: 762
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: remove "read only"(write protection) from pendrive

Post by Termy » Tue Feb 13, 2018 11:14 am

Lol I like the bit at the end of that last post.

I'm wondering now, with the size mis-match, from where did you buy the card or pendrive in question? Because it's unfortunately common for scammers to sell these things, rated at a different size than that which they actually have. I'm not sure if this is so relevant today, but it definitely used to be. It might be that Windows is seeing this, but Linux isn't, as much as I hate to say it. Did you format it yourself and create the partition table yourself?

If something changed the write-caching setting (I'm thinking this isn't so likely), you can enable/disable it with sudo hdparm -W? DEV, where 'DEV' is the block device name, sans partition number (for example: /dev/sda), and where '?' is either '0' (disable), or '1' (enable). Omit the -W? part completely to simply display the current value for the device. Do NOT use the -w (lower-case) flag with hdparm, as that is dangerous.
69Rixter wrote:Should I do the "nuke", what program would I then use to re-establish use of the drive.
One method would be to run gksudo gparted (or of course access it via your menu) to recreate a partition table on that pendrive or whatever it is (this will effectively erase everything on it!), then create a partition on it and continue that way.
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

69Rixter
Level 3
Level 3
Posts: 187
Joined: Sun Aug 31, 2014 3:20 pm
Location: Central Ohio

Re: remove "read only"(write protection) from pendrive

Post by 69Rixter » Tue Feb 13, 2018 5:35 pm

Afternoon Everyone:

Well, spent far more time on this than it actually deserved for the end result is still the same. Please, that is not meant to be criticism. I threw out a line hoping to find a 'fix" and it's apparent that there isn't one. The drive is dying and soon will be headed to the local landfill. I've tried all the suggestions here (and a few others) and none has improved the write speed/remedied the problem. I appreciate all who've responded. Hey, at least I've "learned" a bit. If anyone has opinions/ideas on how the drive reverted to R/O , I'd entertain them. This is the second drive I've had this happen to and I couldn't save the other one either. Luckily, that drive was under warranty. One issue that really left me puzzled: when in chkdsk and Linux's version of chkdsk (command line) the 'specs" of the pendrive kept showing up as 64Gb and it was a 16Gb. Something REALLY screwy there???? And, this was a fairly new pendrive (just over a y/o) and not that much used. Oh, well. KUDOS to all.

Keep Pushin' On:

Rick

User avatar
Termy
Level 5
Level 5
Posts: 762
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: remove "read only"(write protection) from pendrive

Post by Termy » Tue Feb 13, 2018 7:22 pm

Keep ahold of the drive. Just in-case you find the solution later on, or it comes in handy for testing, should this happen yet again, which I'm expecting it will. As this has happened more than once, I'm thinking either the seller is dodgy, the line is dodgy, or something is misconfigured somewhere. Maybe all three. lol :P
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

69Rixter
Level 3
Level 3
Posts: 187
Joined: Sun Aug 31, 2014 3:20 pm
Location: Central Ohio

Re: remove "read only"(write protection) from pendrive

Post by 69Rixter » Tue Feb 13, 2018 10:35 pm

Re: ALL

Well, I didn't accomplish what I wanted but not for lack of trying. Everyone pitched in and hopefully we all learned something. TERMY suggested I hold onto the drive just for future reference. I may do that. Right now, I'm gonna go ahead and fill it completely with files I can afford to lose and use it as R/O. When/if it finally goes over the edge, well, pendrives are inexpensive (for now). I still think there has to be a way to re-image them, but then I guess that just shows my ignorance of they way they operate.(?) So, THANX to all who participated. I can't see any good reason to continue this thread. Give yourselves ALL a good pat-on-the-back!!!

'Til We Meet Again:

:twisted: Rick

Post Reply

Return to “Other topics”