LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   SD card became read only mode after update (https://www.linuxquestions.org/questions/linux-hardware-18/sd-card-became-read-only-mode-after-update-4175735364/)

KorialStrasZ 03-27-2024 06:13 AM

SD card became read only mode after update
 
Hello!
Im using slackware current. When update the system around 20 march my sd cards became read only mode. The same card is read write mode on another machine also with slackware but without this update.
Can someone tell me which package may occurs the problem just to downgrade to previous version.

Till now i try these without success:
dosfsck -a /dev/mmcblk0p1
hdparm -r0 /dev/mmcblk0p1
always return: readonly = 1 (on)

its not about permissions because root also cant write on sd cards
in /var/log/messages find this:
from 20 march kernel: mmcblk0: mmc0:59b4 5cMJR 59.7 GiB
and on march 21: kernel: mmcblk0: mmc0:59b4 5cMJR 59.7 GiB (ro)

USB flash drives are not affected.

pan64 03-27-2024 07:03 AM

probably the card died. Probably there is another error, which will force the system to set it read only. You need to check the logs.

business_kid 03-27-2024 07:11 AM

I don't think it's a package. There's often a setting in /etc/fstab in the option "errors=remount,ro" for sd cards. If the card is going belly-up, this preserves the readable data.

The larger sd cards (≅30mm×20mm) can have little switches to physically set r/w or read only. sd cards don't live long and should not be rewritten frequently.

KorialStrasZ 03-27-2024 07:15 AM

Sorry guys none of this cause the problem. As i said its not only one card and several cards which suddenly became read only after update. And the same card is working perfectly in read/write mode on another slackware machine which has not updated.

KorialStrasZ 03-27-2024 08:39 AM

Its totally strange but when i switch to windows 10 pro and then the sd card was read only too, but when i do safety remove it and insert it again suddenly it became writable as it should be. Its very strange because now in slackware is also writable... And all other card became writable.
If someone have the similar problem may try to fix it by this way. I don't know what is happening at the end.

pan64 03-27-2024 08:59 AM

for me it looks like you removed the card from the reader without umounting it (or something similar).

KorialStrasZ 03-27-2024 09:35 AM

Quote:

Originally Posted by pan64 (Post 6492271)
for me it looks like you removed the card from the reader without umounting it (or something similar).

It's not the case. Why in another PC also with slackware the same sd card working in writable mode?

business_kid 03-27-2024 10:38 AM

Quote:

Originally Posted by KorialStrasZ (Post 6492277)
It's not the case. Why in another PC also with slackware the same sd card working in writable mode?

That's an interesting question, but only you have the answer in your hands. Check the obvious stuff like /etc/fstab, & less obvious stuff , (e.g. kernel settings or version, dodgy sdcard socket or usb plug). You're not telling us. Have you inserted the card into both, run 'sudo dmesg |tail -n 20' and compared outputs?

You can read the sdcard, so I'm not too worried if you have to use another PC to do it while you compare settings. Does it work on a liveslak usb?

KorialStrasZ 03-27-2024 01:32 PM

Quote:

Originally Posted by business_kid (Post 6492289)
That's an interesting question, but only you have the answer in your hands. Check the obvious stuff like /etc/fstab, & less obvious stuff , (e.g. kernel settings or version, dodgy sdcard socket or usb plug). You're not telling us. Have you inserted the card into both, run 'sudo dmesg |tail -n 20' and compared outputs?

You can read the sdcard, so I'm not too worried if you have to use another PC to do it while you compare settings. Does it work on a liveslak usb?

fstab is not the problem
dodgy sdcard socket or usb plug - not the problem now it works on both pc, if the socked/plug is broken will never work until repair.
sudo dmesg |tail -n 20' and compared outputs? - now i cant do that because cards start work as normal on both pc and if the problem with read only mode happen again i will see if there is any difference in logs. As i see only difference before was this "(ro)" from my first post.
kernel settings or version - kernel is the same version
Something happen during insert the card in windows and cant figure it out, but now works in writable mode on both pcs.

business_kid 03-27-2024 03:09 PM

Quote:

Originally Posted by KorialStrasZ
Something happen during insert the card in windows and cant figure it out, but now works in writable mode on both pcs.

Great! So now you apply Rule #1 of maintenance
Code:

If it works, don't fix it!
My guess is windows may have done something to the format, especially if it's FAT formatted. Try umounting the disk and running these next time if the problem recurs
  1. fsck.vfat -a /dev/mmcblk0
    # Fix the dirty bit and write. Remount.If there's still an issue
  2. sudo mount -o remount,rw /dev/mmcblk0
At least you might get an intelligent error, which is always useful.

KorialStrasZ 03-27-2024 11:46 PM

Yes i will try. But the most curious thing is that the same cards which now is working perfectly:
1. Work in slackware pc1 in read only mode, and i cant remount in read-write mode because it always says sd card is read-only mode. Cant remove dirty bit because it again says sd card is read-only mode.
2. The same sd cards work in slackware on PC2 in read-write mode without any problems. So if the problem is in the way sd cards are unplugged, dirty bit, file system or something similar... Should they work perfectly on another PC also with slackware? Something missing...
And if the problem start again will try to find out what is the missing peace...
BTW do you have an idea how can i recreate the problem just with one sd card for testing?

pan64 03-28-2024 01:55 AM

probably you have a problem with a reader, not the sd card itself. Or just it wasn't inserted properly. Or something else happened.

KorialStrasZ 03-28-2024 01:13 PM

Quote:

Originally Posted by pan64 (Post 6492447)
probably you have a problem with a reader, not the sd card itself. Or just it wasn't inserted properly. Or something else happened.

Not possible. If the reader was the problem it cant be fixed by itself. Now the same reader and the same CARDS is working as it should - in read-write mode.


All times are GMT -5. The time now is 10:42 PM.