LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 07-22-2013, 12:13 PM   #1
jokar.mohsen
Member
 
Registered: Jul 2008
Location: Tehran
Posts: 441

Rep: Reputation: 22
Unhappy I can't format my Flash memory :(


Hello Folks.
I want to format my flash memory but mkfs.vfat command tell me it is write protected, How can I fix it?

Thanks.
 
Old 07-22-2013, 12:39 PM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
assuming an sdcard, there is usually a little switch on the card

switch that switch
 
Old 07-23-2013, 09:45 AM   #3
jokar.mohsen
Member
 
Registered: Jul 2008
Location: Tehran
Posts: 441

Original Poster
Rep: Reputation: 22
Quote:
Originally Posted by Firerat View Post
assuming an sdcard, there is usually a little switch on the card

switch that switch
No, It have not any switch, I guess it is corrupted , How can I fix it?
 
Old 07-23-2013, 11:32 AM   #4
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
Have you run the command as root user (or with sudo)?
 
Old 07-23-2013, 01:42 PM   #5
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by jokar.mohsen View Post
No, It have not any switch, I guess it is corrupted , How can I fix it?
I honestly don't know, File systems can be mounted readonly,. but actual devices are typically not. I think the only time I have ever come across something like that is with sdcard lock switch.

Flash memory is quite ambiguous, can you be more specific?

Also the command you have used might be helpful

I'm not sure this is a 'root' problem as I would expect it to have come back with permission denied.
 
Old 07-23-2013, 06:25 PM   #6
jp734
LQ Newbie
 
Registered: Mar 2012
Posts: 29

Rep: Reputation: Disabled
Do you see a notch on the side of the card? Maybe the switch is just missing. If theere is, you can put scotch tape on it and it will make it writable. Just need to cover that notch. There is a pin that goes in there and when the pin is blocked, you can write on it.
 
Old 07-25-2013, 06:41 AM   #7
jokar.mohsen
Member
 
Registered: Jul 2008
Location: Tehran
Posts: 441

Original Poster
Rep: Reputation: 22
I use root command too but when I want to format it, Show me :

block device /dev/sdc is write-protected, mounting read-only

What is it?
 
Old 07-25-2013, 06:57 AM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by jokar.mohsen View Post
I use root command too but when I want to format it, Show me :

block device /dev/sdc is write-protected, mounting read-only

What is it?
Can you please describe exactly what kind of 'flash' memory this is.

Is it a card or a USB Thumb/Pen drive?

is it a card that slots into a USB adaptor

can you unplug it, then reinsert and give us the output of
Code:
dmesg
as an example
Code:
[188962.136052] usb 7-2.3: new high-speed USB device number 5 using ehci-pci
[188962.231923] usb 7-2.3: New USB device found, idVendor=090c, idProduct=1000
[188962.231927] usb 7-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[188962.231930] usb 7-2.3: Product: USB DISK
[188962.231933] usb 7-2.3: Manufacturer: SMI Corporation
[188962.231936] usb 7-2.3: SerialNumber: Not tellin You
[188962.232521] scsi11 : usb-storage 7-2.3:1.0
[188963.233195] scsi 11:0:0:0: Direct-Access     USB      Flash Disk       1100 PQ: 0 ANSI: 0 CCS
[188963.233496] sd 11:0:0:0: Attached scsi generic sg8 type 0
[188963.235183] sd 11:0:0:0: [sdh] 31326208 512-byte logical blocks: (16.0 GB/14.9 GiB)
[188963.236776] sd 11:0:0:0: [sdh] Write Protect is off
[188963.236781] sd 11:0:0:0: [sdh] Mode Sense: 43 00 00 00
[188963.237694] sd 11:0:0:0: [sdh] No Caching mode page present
[188963.237699] sd 11:0:0:0: [sdh] Assuming drive cache: write through
[188963.241554] sd 11:0:0:0: [sdh] No Caching mode page present
[188963.241558] sd 11:0:0:0: [sdh] Assuming drive cache: write through
[188963.242066]  sdh: sdh1
[188963.245680] sd 11:0:0:0: [sdh] No Caching mode page present
[188963.245684] sd 11:0:0:0: [sdh] Assuming drive cache: write through
[188963.245687] sd 11:0:0:0: [sdh] Attached SCSI removable disk
use
[code]
example
[188962.136052] usb 7-2.3: new high-speed USB device number 5 using ehci-pci
[188962.231923] usb 7-2.3: New USB device found, idVendor=090c, idProduct=1000
....
[/code]


Notice I also removed the serial no.
Not that it really matters,
 
Old 07-25-2013, 02:31 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,991

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Some cards may need to have an OEM software to fix this sort of issue.
 
Old 07-27-2013, 05:53 AM   #10
jokar.mohsen
Member
 
Registered: Jul 2008
Location: Tehran
Posts: 441

Original Poster
Rep: Reputation: 22
output is :

[ 435.660408] usb 1-6: USB disconnect, address 8
[ 440.452015] usb 1-6: new high speed USB device using ehci_hcd and address 9
[ 440.588816] usb 1-6: New USB device found, idVendor=13fe, idProduct=3e00
[ 440.588821] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 440.588826] usb 1-6: Product: Silicon-Power4G
[ 440.588829] usb 1-6: Manufacturer: UFD 2.0
[ 440.588832] usb 1-6: SerialNumber: 11060555E6B61B00CE5A0094
[ 440.588964] usb 1-6: configuration #1 chosen from 1 choice
[ 440.589150] scsi9 : SCSI emulation for USB Mass Storage devices
[ 440.589256] usb-storage: device found at 9
[ 440.589257] usb-storage: waiting for device to settle before scanning
[ 445.588208] usb-storage: device scan complete
[ 445.663440] scsi 9:0:0:0: Direct-Access UFD 2.0 Silicon-Power4G PMAP PQ: 0 ANSI: 0 CCS
[ 445.663777] sd 9:0:0:0: Attached scsi generic sg3 type 0
[ 446.248277] sd 9:0:0:0: [sdc] 7834944 512-byte logical blocks: (4.01 GB/3.73 GiB)
[ 446.248771] sd 9:0:0:0: [sdc] Write Protect is on
[ 446.248776] sd 9:0:0:0: [sdc] Mode Sense: 23 00 80 00
[ 446.248780] sd 9:0:0:0: [sdc] Assuming drive cache: write through
[ 446.251386] sd 9:0:0:0: [sdc] Assuming drive cache: write through
[ 446.251391] sdc:
[ 446.271010] sd 9:0:0:0: [sdc] Assuming drive cache: write through
[ 446.271013] sd 9:0:0:0: [sdc] Attached SCSI removable disk
[ 446.763274] FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!

---------- Post added 07-27-13 at 03:23 PM ----------

Quote:
Originally Posted by Firerat View Post
Can you please describe exactly what kind of 'flash' memory this is.

Is it a card or a USB Thumb/Pen drive?

is it a card that slots into a USB adaptor

can you unplug it, then reinsert and give us the output of
Code:
dmesg
as an example
Code:
[188962.136052] usb 7-2.3: new high-speed USB device number 5 using ehci-pci
[188962.231923] usb 7-2.3: New USB device found, idVendor=090c, idProduct=1000
[188962.231927] usb 7-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[188962.231930] usb 7-2.3: Product: USB DISK
[188962.231933] usb 7-2.3: Manufacturer: SMI Corporation
[188962.231936] usb 7-2.3: SerialNumber: Not tellin You
[188962.232521] scsi11 : usb-storage 7-2.3:1.0
[188963.233195] scsi 11:0:0:0: Direct-Access     USB      Flash Disk       1100 PQ: 0 ANSI: 0 CCS
[188963.233496] sd 11:0:0:0: Attached scsi generic sg8 type 0
[188963.235183] sd 11:0:0:0: [sdh] 31326208 512-byte logical blocks: (16.0 GB/14.9 GiB)
[188963.236776] sd 11:0:0:0: [sdh] Write Protect is off
[188963.236781] sd 11:0:0:0: [sdh] Mode Sense: 43 00 00 00
[188963.237694] sd 11:0:0:0: [sdh] No Caching mode page present
[188963.237699] sd 11:0:0:0: [sdh] Assuming drive cache: write through
[188963.241554] sd 11:0:0:0: [sdh] No Caching mode page present
[188963.241558] sd 11:0:0:0: [sdh] Assuming drive cache: write through
[188963.242066]  sdh: sdh1
[188963.245680] sd 11:0:0:0: [sdh] No Caching mode page present
[188963.245684] sd 11:0:0:0: [sdh] Assuming drive cache: write through
[188963.245687] sd 11:0:0:0: [sdh] Attached SCSI removable disk
use
[code]
example
[188962.136052] usb 7-2.3: new high-speed USB device number 5 using ehci-pci
[188962.231923] usb 7-2.3: New USB device found, idVendor=090c, idProduct=1000
....
[/code]


Notice I also removed the serial no.
Not that it really matters,

I copy and paste output.
 
Old 07-29-2013, 10:55 AM   #11
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Well it looks like a Silicon power Touch 835
as far as I can tell there is no physical "readonly" switch


I have no idea if this will work, as to be honest I don't know why it is write protected..
Was it encrypted using the "SP Widget Software" in windows?

Jefro mentioned in #9 that you may need OEM software to fix this problem,
If you have Windows available install the SP Widget Software, and explore options..

Alternatively ( and I have absolutely no idea if this will work for you )
change the write protection flag using hdparm
hdparm is probably not installed by default.

assuming a deb based system
Code:
sudo apt-get install hdparm
An rpm based system
Code:
yum install hdparm

This step is a little redundant, since we already know write protection is on..
But lets do it anyway.

as root
Code:
hdparm -r /dev/sdX
Where /dev/sdX is the correct name for your device

Now turn write protection off
again as root
Code:
hdparm -r 0 /dev/sdX
0 = off, 1 = on

Now try to format..
That might only 'half work' it could be that next time you "plug it in" it is write protected again
 
Old 08-03-2013, 08:08 AM   #12
jokar.mohsen
Member
 
Registered: Jul 2008
Location: Tehran
Posts: 441

Original Poster
Rep: Reputation: 22
Not worked
 
  


Reply



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
format my flash memory stick faizlo Linux - Hardware 5 08-03-2009 09:10 PM
i can not access my flash memory after installing ubuntu from flash eramax Ubuntu 2 10-27-2008 11:11 AM
Flash memory as Video memory in Ubuntu? caa1980 Ubuntu 6 10-25-2007 11:55 AM
USB memory, Compact Flash, Memory Stick energiza Linux - Hardware 2 08-22-2006 09:29 PM
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 05:39 PM

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

All times are GMT -5. The time now is 04:52 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