1

I'm well aware this question has been asked about a million times already but apparently nothing seems to help me.

I was just going about my business over ssh on my raspi zero when I suddenly lost connection. I went to check on it and I was greeted with a black screen with the LED off. I immediately thought it's fried but then there was absolutely no reason for that so I checked and there was 3.3V, so I rebooted and I got kernel panic, could not mount VFS (179,2) or something of the kind.

I put the SD card in a USB card reader to try to fix it but whenever I plug it in it says it is in read only mode and only the boot partition gets mounted. This happens if I try to mount rootfs:

# sudo mount /dev/sdc2 /mnt
mount: /mnt: cannot mount /dev/sdc2 read-only.

I have found gnome's disks utility to be quite useful over the years so I resorted to it but without any luck as well. I ran the "Check filesystem" option, which reported that the fs is not broken:

enter image description here

Also no luck with e2fsck:

# e2fsck -f /dev/sdc2
e2fsck 1.46.2 (28-Feb-2021)
e2fsck: Read-only file system while trying to open /dev/sdc2
Disk write-protected; use the -n option to do a read-only
check of the device.

After some more digging I discovered I can mount it with

# mount -o ro,noload /dev/sdc2 /mnt

And files seem to be ok, so I think if I knew what was the reason it's going into readonly mode then maybe I could recover it...

Any help's greatly appreciated!!!

EDIT:

I also tried opening the card with a standard sd card adapter and I got voltage switch error and error -110.

1
  • If your sd card has gone readonly, the sd card is failing. Copy any required files off quickly.
    – CoderMike
    Jan 12, 2023 at 13:01

2 Answers 2

1

"I'm well aware this question has been asked about a million times already" - a slight exaggeration, but it is true the question is often asked and rarely answered.

There are reasons for this:-

  1. Expert users don't bother trying to fix corrupt file systems, we just restore from a backup. (Although I haven't needed to restore for over a year.)
  2. For some reason experienced users rarely seem to have these problems (unless it is a SD Card failure - in which case "repair" is futile).
  3. Those who ask these questions rarely provide any meaningful diagnostics.

If it was me I would just do a low level format with the SD Association formatter and restore; the SD Card may be usable, with possibly reduced capacity. Ultimately problems will probably recur because the underlying NAND is failing.

Failing SD Cards may go into RO mode (to protect existing data) - this is an irrecoverable error.

1
  • It turns out my case is the last mentioned by you. Fortunately I at least saved my data, but lost about a day to setup the system again.
    – php_nub_qq
    Jan 13, 2023 at 18:23
0

I had such a situation in the past, the only thing that fixed it for me was setting up a new microsd card. If you're card is still readable, transfer the files to a new one. If the card was quite new, make a warranty call, if it was already old (some years), then get a new one.

1
  • Yeah I tried that but the new card doesn't boot, apparently copying some files over from the old one breaks it.
    – php_nub_qq
    Jan 11, 2023 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.