LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 08-04-2014, 10:21 PM   #1
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,685

Rep: Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775
usb drive: cannot remount block device /dev/sdb1 read-write, is write-protected


hi, i have a usb thumb drive that has been running my xbmc full install for a couple of years. now it wont boot and i suspect its because the drive keeps complaining about being write-protected:
Code:
[schneidz@hyper ~]$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser
Bus 001 Device 012: ID 13fe:5200 Kingston Technology Company Inc. 
[schneidz@hyper ~]$ sudo fdisk -l /dev/sdb

Disk /dev/sdb: 31.0 GB, 31009800192 bytes
255 heads, 63 sectors/track, 3770 cylinders, total 60566016 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    20482047    10240000   83  Linux
/dev/sdb2        20482048    60534783    20026368   83  Linux
[schneidz@hyper ~]$ mount
...
/dev/sdb1 on /media/d9788d9b-9612-4983-830d-3ca680e715fe type ext2 (ro,nosuid,nodev,relatime,seclabel,errors=continue,uhelper=udisks)
/dev/sdb2 on /media/xbmc-data type ext2 (ro,nosuid,nodev,relatime,seclabel,errors=continue,uhelper=udisks)
[schneidz@hyper ~]$ sudo hdparm -r0 /dev/sdb

/dev/sdb:
 setting readonly to 0 (off)
 readonly      =  0 (off)
[schneidz@hyper ~]$ sudo mount -o remount,rw /dev/sdb1
mount: cannot remount block device /dev/sdb1 read-write, is write-protected
[schneidz@hyper ~]$ fsck -v /dev/sdb1
fsck from util-linux 2.19.1
e2fsck 1.41.14 (22-Dec-2010)
fsck.ext2: Read-only file system while trying to open /dev/sdb1
Disk write-protected; use the -n option to do a read-only
check of the device.
how to remove the write-protection (gparted wont format it) ?
i am able to copy all the files off of it but i just cant modify any of the files.

Last edited by schneidz; 08-04-2014 at 10:35 PM.
 
Old 08-05-2014, 06:25 AM   #2
heinblöd
Member
 
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 186

Rep: Reputation: 31
My first thought is a hardware failure.

You should check it's health before seeking further.

Here is a good explanation how to do this with badblocks :

http://superuser.com/questions/37627...stick-in-linux
 
1 members found this post helpful.
Old 08-05-2014, 09:24 AM   #3
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,685

Original Poster
Rep: Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775
thx: fyi
Code:
[schneidz@hyper ~]$ sudo badblocks -w -s -o usbstick.log  /dev/sdb
badblocks: Read-only file system while trying to open /dev/sdb
 
Old 08-07-2014, 04:01 AM   #4
heinblöd
Member
 
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 186

Rep: Reputation: 31
If it would be a sdcard i'd say it is locked by its little jumper ...;

Is there maybe some bios option, which allows only read access to external devices ?

Did you check in another pc if it is writable there ?

Or remove it from fstab (if it is in there) and mount manually on a different mount point ?

Did you check the mount point ? Sometimes there are files in the folder which is used as mount point (when the device got removed and sth tried to write to it)
 
Old 08-07-2014, 08:46 AM   #5
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,685

Original Poster
Rep: Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775
thanks:
Quote:
Originally Posted by heinblöd View Post
If it would be a sdcard i'd say it is locked by its little jumper ...;
there is no switch on the outside of it. maybe i can take it apart and use jumper wire to reflash it to read-write.

Quote:
Originally Posted by heinblöd View Post
Is there maybe some bios option, which allows only read access to external devices ?
when i plug my fone in, i can read-write.

Quote:
Originally Posted by heinblöd View Post
Did you check in another pc if it is writable there ?
doesnt work in any other pc.

Quote:
Originally Posted by heinblöd View Post
Or remove it from fstab (if it is in there) and mount manually on a different mount point ?
yup.

Quote:
Originally Posted by heinblöd View Post
Did you check the mount point ? Sometimes there are files in the folder which is used as mount point (when the device got removed and sth tried to write to it)
good points. at this point i think it is just busted. i think flash drive manufacturers are putting clever fail-safes on these drives since they fail so often.

similar if you have a failing internal hard drive it is best to disconnect it then plug it in as a secondary so you can save all your stuff to another hd before it is lost forever ?
 
Old 01-06-2015, 03:15 PM   #6
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,685

Original Poster
Rep: Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775
the s.m.a.r.t. monitor seems to be a little too trippy. i have since been using it as a read-only movie nas and it hasnt fully failed yet.
 
  


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
mount: block device is write-protected, mounting read-only xpucto Linux - Server 6 03-07-2014 02:08 PM
Detecting a USB device which is write protected shedevil Linux - Newbie 2 09-25-2013 08:33 AM
[SOLVED] samba mount: block device is write-protected, onlystream Linux - Newbie 1 03-31-2012 12:30 PM
remount USB Disk Read Write poetfreak MEPIS 1 08-30-2006 01:49 PM
"block device /dev/sda2 is write-protected, mounting read-only" - fstab problem blanks77 Linux - Hardware 1 04-28-2006 06:09 PM


All times are GMT -5. The time now is 12:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration