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 12-22-2015, 08:41 AM   #1
MattFly
Member
 
Registered: Apr 2015
Posts: 98

Rep: Reputation: Disabled
usb drive mounted only as read-only and nothing I do can format it


Just wondering if I could get this back to its original state. Don't mind what is on it, the thing is that nothing I try can format it:
Code:
 #dmesg | tail

[52972.857024] scsi host15: usb-storage 1-1:1.0
[52973.857471] scsi 15:0:0:0: Direct-Access     SanDisk  Cruzer Blade     1.26 PQ: 0 ANSI: 5
[52973.858255] sd 15:0:0:0: Attached scsi generic sg1 type 0
[52973.859130] sd 15:0:0:0: [sdb] 62530624 512-byte logical blocks: (32.0 GB/29.8 GiB)
[52973.859988] sd 15:0:0:0: [sdb] Write Protect is on
[52973.859999] sd 15:0:0:0: [sdb] Mode Sense: 43 00 80 00
[52973.860263] sd 15:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA   '
[52973.868617]  sdb: sdb1
[52973.870216] sd 15:0:0:0: [sdb] Attached SCSI removable disk
[53339.873378] dumpe2fs[31395]: segfault at 0 ip 00007f7cbd65e6fa sp 00007fffb6114108 error 4 in libc-2.21.so[7f7cbd5d3000+1c0000]

# fsck -n /dev/sdb1
fsck de util-linux 2.26.2
fsck.fat 3.0.28 (2015-05-16)
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
 Automatically removing dirty bit.
Leaving filesystem unchanged.
/dev/sdb1: 7 files, 320278/1953029 clusters


# sudo hdparm -r0 /dev/sdb

/dev/sdb:
 setting readonly to 0 (off)
 readonly      =  0 (off)


# mkfs.vfat /dev/sdb1
mkfs.fat 3.0.28 (2015-05-16)
mkfs.vfat: unable to open /dev/sdb1: Read-only file system
It was mkfs.vfat formated (linux envoriment) and when I was writing on it a lot of files it just sudenlly stop for ever allowing do write.

I've already tried another computer, live usb, gparted,parted, fsck; on windows: deep format tools, chkdsk, diskparted, a lot of software. Nothing seens possible do be done, everything returns a error message that the device is read only or has write protection.

That was a expensive device for me and I am up to try everything that whould be thought.Is a recent drive althought it has no warranty anymore.

Any way/program to force formating this? Any idea will be helpfull.
 
Old 12-22-2015, 09:29 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Google "SanDisk Cruzer Blade read only" and you will find quite a few results. Among them some that indicate a hardware fault that requires returning the product. I would talk to SanDisk.
 
Old 12-22-2015, 09:40 AM   #3
MattFly
Member
 
Registered: Apr 2015
Posts: 98

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
Google "SanDisk Cruzer Blade read only" and you will find quite a few results. Among them some that indicate a hardware fault that requires returning the product. I would talk to SanDisk.
Unfortunantly I can't do that. What can you say about the two first outputs of my last post? Doesn't it seens to be a bad formated drive with end up by locking write permissions to safety?
 
Old 12-22-2015, 09:57 AM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,981

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
If you can't return it, I would try to unmount sdb1 and zero fill the mbr on the drive like so:

Code:
# umount /dev/sdb1
# dd if=/dev/zero of=/dev/sdb bs=512 count=1
If that doesn't work, try zero filling the entire drive:

Code:
# dd if=/dev/zero of=/dev/sdb
If the above runs, then try partitioning and formatting the drive. If there is a firmware lock on the drive as appears to be the case, there's not much you can do unless the manufacturer has a tool to unlock the drive which does not appear to be the case from my limited googling. The above code is worth a try anyway before giving up on the drive.
 
Old 12-22-2015, 11:14 AM   #5
MattFly
Member
 
Registered: Apr 2015
Posts: 98

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kilgoretrout View Post
If you can't return it, I would try to unmount sdb1 and zero fill the mbr on the drive like so:

Code:
# umount /dev/sdb1
# dd if=/dev/zero of=/dev/sdb bs=512 count=1
If that doesn't work, try zero filling the entire drive:

Code:
# dd if=/dev/zero of=/dev/sdb
If the above runs, then try partitioning and formatting the drive. If there is a firmware lock on the drive as appears to be the case, there's not much you can do unless the manufacturer has a tool to unlock the drive which does not appear to be the case from my limited googling. The above code is worth a try anyway before giving up on the drive.
Yes I tried it:
Code:
# dd if=/dev/zero of=/dev/sdb bs=512 count=1
dd: failed to open “/dev/sdb”: Read only file system
# dd if=/dev/zero of=/dev/sdb
dd: failed to open “/dev/sdb”: Read only file system
I was just suposing this firmware lock. I'll look for something realted at the official website.
 
Old 12-28-2015, 11:27 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by MattFly View Post
Just wondering if I could get this back to its original state. Don't mind what is on it, the thing is that nothing I try can format it:

Any way/program to force formating this? Any idea will be helpfull.

take read only off of usb stick try that

Code:
sudo hdparm -r0 /dev/sdb
 
Old 10-11-2019, 07:14 PM   #7
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
Exactly what I am looking for! Thx

$ sudo yum install hdparm

Yes my device is /dev/sdb. Did you do an
$fdisk -l to determine yours first. Of course you did!



$ sudo hdparm -r0 /dev/sdb

/dev/sdb:
setting readonly to 0 (off)
readonly = 0 (off)

I could just chuck this silly device but why not just fix it!?
 
Old 10-12-2019, 02:43 PM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
After zeroing a drive with dd, I like to verify that it's zeroe'd with cmp.

# dcfldd if=/dev/zero of=/dev/mydisk# bs=4M
# cmp /dev/zero /dev/mydisk#

if it fails before end of device, it didn't take the dd writes. Some SD hardware fails to read-only hardware wise. Or near read-only states. I've had several fail over the years. Not that many technically, but I tend to buy new ones and run the OS on the new ones every six-ish months (paranoia level). Recalling that some of the early nand flash things were never meant to have more than a dozen writes to any one byte over it's lifetime. Fine for photos that you write once and forget about, not so great for operating systems.
 
  


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
mounted drive is READ only - how to READ and WRITE? vegastech Linux - Newbie 4 06-11-2009 01:55 AM
Format a Compact Flash Drive While Mounted sadarax Linux - General 2 12-15-2005 04:26 AM
Can't read mounted drive mabarnes Linux - Newbie 4 12-19-2003 11:36 PM
Mounted drive read-only! MultiMike Linux - Newbie 8 06-09-2003 05:21 PM
why is my mounted drive read only? nyroc Linux - General 2 01-18-2003 07:24 PM

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

All times are GMT -5. The time now is 02:47 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
Open Source Consulting | Domain Registration