I have a 16Gb micro sd card, (with no external lock) which has on it Noobs with Risc OS, Raspbian, LibreElec.
I wanted to play with the partitions using gparted on a separate laptop running Ubuntu.
Specifically I wanted to decrease the size of the LibreElec partition and give the space to the Raspbian partition, these used partitions 9, 10 and 11, so easy.
First I made a copy of the whole sd card as a backup image using Win32DiskImager, just in case, so I could always go back.
I then tried to change the partition layout using gparted, but although it appeared to work, once it finished, the partition layout always appeared to be the same? I put the sd back in my Pi, and sure enough nothing had changed? Eventually after quite a lot of mucking about I realised that the card was completely locked to writing, I tried all the usual reformat methods SDFormatter, HDDLLF, (low level format), 2 different cameras, even
sudo dd if=dev/zero of=/dev/sdb bs=4096 count=4096
to write blanks to the start of the SD. Nothing would write to the SD.
So I decided to write the image file I had taken back onto a fresh new 16Gb micro SD card, using Win32DiskImager, this worked fine, I tested the image, perfect, I could write to it fine, I rebooted, everything was fine. So I removed the SD card and again used Gparted to change the partitions, this time everything worked perfectly, I reduced partition 11 down to 1Gb, moved partition 10 along, so that I could then expand partition 9 into the free space, perfect, everything worked great, I put the SD back into the Pi, perfect, so to be sure I did an
sudo apt-get dist-upgrade
to get Raspbian completely up to date, this worked and everything was fine, rebooted to be sure, yes everything was good and fully updated, so I decided to tidy up, set up a few things the way I wanted, updated a software development directory to my latest sources, all good. I then decided to again back up the SD to an img file using Win32DiskImager, this went ahead ok. I finally put the SD back into the Pi, the SD card was locked!!! So now I have 2 perfectly good 16Gb SD cards, which read fine, but can't be written to,


I then came across this
viewtopic.php?p=162205#p162205 and this
viewtopic.php?f=28&t=160955, which lead to this
https://github.com/BertoldVdb/sdtool
I installed the sdtool onto another of my Pis, which has an external disk where /home/pi is located, so that I could then replace it's SD with the duff SD, but still have the sdtool on the disk, ran it and found that both SD cards have the
Code: Select all
[+] Write protection state: Permanent
So I still have 2 x 16GB micro SD cards, which are effectively bin fodder.
Any one else had problems with SD cards becoming read only? Especially after having used Win32DiskImager?
Regards,
Kevin.