LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   I can't format my Flash memory :( (https://www.linuxquestions.org/questions/linux-hardware-18/i-cant-format-my-flash-memory-4175470517/)

jokar.mohsen 07-22-2013 12:13 PM

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.

Firerat 07-22-2013 12:39 PM

assuming an sdcard, there is usually a little switch on the card

switch that switch

jokar.mohsen 07-23-2013 09:45 AM

Quote:

Originally Posted by Firerat (Post 4994775)
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?

DavidMcCann 07-23-2013 11:32 AM

Have you run the command as root user (or with sudo)?

Firerat 07-23-2013 01:42 PM

Quote:

Originally Posted by jokar.mohsen (Post 4995277)
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.

jp734 07-23-2013 06:25 PM

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.

jokar.mohsen 07-25-2013 06:41 AM

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?

Firerat 07-25-2013 06:57 AM

Quote:

Originally Posted by jokar.mohsen (Post 4996497)
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,

jefro 07-25-2013 02:31 PM

Some cards may need to have an OEM software to fix this sort of issue.

jokar.mohsen 07-27-2013 05:53 AM

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 (Post 4996502)
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.

Firerat 07-29-2013 10:55 AM

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

jokar.mohsen 08-03-2013 08:08 AM

Not worked :(


All times are GMT -5. The time now is 06:31 AM.