MicroSD card is set to Read-only state. How can I write data on it?
I have a MicroSD card reader in my notebook. When I insert a MicroSD memory card into it, I can't write any data on it - it's read-only. The same thing happens when I try to do it under root. And I can't change the permission policy for it. This problem happens for all microSD cards (I've tested 2 cards). I've encountered it on Ubuntu 12.04 LTS, now I'm on Ubuntu 12.10, the problem is still on it's place. When I try to insert such a "read-only" card in my mobile phone, everything's OK and I can write data on it. So, can anybody tell me, how can I write a data onto the card?
UPD: here's fdisk -l
output:
Disk /dev/sdc1: 2013 MB, 2013135360 bytes
62 heads, 62 sectors/track, 1022 cylinders, total 3931905 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: 0x00000000
Device Boot Start End Blocks Id System
The file system of the card is msdos
. As to me it's weird.
UPD2: I've found a small "lock" switch on my card adapter, and it turns out, that when I insert it in my notebook, it switches on. Perhaps, I have to find some glue or something to get that switch stuck...
UPD3: There was no glue near me, so I've decided to buy another card-reader.
Solution 1:
Two possibilities, first is that being a hardware thing, as micro SDHC have a little notch you can easily notice which matches another notch in the reader and that basically just enables it in read-only mode. That you can't change, just try to use another reader or you could put a piece of silicon or tape on notch, easiest thing is to use another reader.
Second possibility is that being a file permission issue, in which case you can do the following : In terminal, use these commands:
gksudo nautilus
This will launch nautilus in root shell and bypass all permissions. OR:
sudo fdisk -l
This will give you a list of the drives on your system, figure out which drive it is in the list, easiest way is to look for the blocks
as this is the space. It will probably be /dev/sdb
or /dev/sdc
, then
sudo chown -hR <your username> <the SDHC drive, /dev/sdb for example>
this will change ownership of the drive to you. OR:
sudo chmod -R 777 <the SDHC drive, /dev/sdb for example>
Though if you just execute the first command sudo nautilus
it will save you all this trouble, but you'll have to do it every time you use the SDHC.
If all of this doesn't work, use this command :
sudo mount --options remount,rw <the SDHC drive, /dev/sdb for example, find it using fdisk -l>
If there's anything you don't understand just comment.
Solution 2:
Not able to get it try this login to root mode.. open terminal type
hdparm -r0 /dev/sdc
than your write protection bit or say ur read only bit will be set to ZERO and now you type
mount /media/ur_pen_drive_name(like mine is HSR)/ -o remount,rw
And that's it.... remember windows can't do this because there is a virus in your pen drive ok... now it doesn't any permission to be changed so if you find any .exe file not getting deleted from your pd just do the above two step and than you'll be able to delete it...
Solution 3:
Physical write protection
For those who never used SD cards before (there's a first time for everything, mine was in my late 20's!), you have to move the LOCK switch to the unlocked position:
Image attribution.
It is analogous for a micro SD adapter with a MicroSD inside: the dongle is on the adapter:
Related: https://raspberrypi.stackexchange.com/questions/8225/trying-to-image-sd-card-not-working-read-only-file-system
Solution 4:
While in the command window, you could see if the system objects to making the disk read-write. Suppose for example it is mounted as /dev/sdb1. Become root or use sudo:
mount -orw,remount /dev/sdb1
will either make the disk writable or give you an error message indicating why it can't.