I have an old sd card with a pi image burned onto it. I want to burn a different image onto the card but I cannot get write access to the sd card. I've tried changing owners, permissions, fdisk, diskpart, gparted, and even checked if the hardware switch was engaged (It wasn't). I wrote to it originally using sudo dd
on a linux machine if that matters. Nothing seems to be working to get write access on the card.
2 Answers
You were trying to write the image to a partition on the card as opposed to the card itself.
sudo dd bs=4M if=/path/to/image.img of=/dev/sdb1
^^^^
The card would be just /dev/sdb
, and that's what you should use there.
I don't think that's a complete explanation, but hopefully it will help. You should also check if there's "lock" switch on it. I think the pi will ignore that (those switches don't really do anything, they're just observable by the OS via the hardware), but your other computer might be.
If you have access to a windows machine, try win32diskimager.
http://sourceforge.net/projects/win32diskimager/
It will format the contents of the drive completely, and write the new image onto it automatically.
sudo dd bs=4M if=/path/to/image.img of=/dev/sdb1
which gave me this error:dd: failed to open ‘/dev/sdb1’: Read-only file system
. Using gparted to try and edit the partitions on the sd card gives the same error:Unable to open /dev/sdb read-write (Read-only file system). /dev/sdb has been opened read-only