My Raspberry Pi, on which I host a Minecraft server, suddenly froze. I cannot not SSH in, nor can I join the Minecraft server. I ran the Minecraft server in Docker, via itzg/docker-minecraft-server. I turned off the Raspberry Pi, took out its microsd and plugged it into my PC, to at least attempt to run the Minecraft server from my PC to see if I still have the data. I tried to copy it with cp, but I got an input-output error. Could this be the filesystem’s fault? And how can I fix this? If you need any additional info about this crash, please do not hesitate to ask.

16 points
*

If it’s running off an SD card then it’s very likely the SD card is broken. It’s better to run a pi off a USB SSD drive. Hope you have backups. Good luck either way.

Edit (more context):

https://hackaday.com/2019/04/08/give-your-raspberry-pi-sd-card-a-break-log-to-ram/

https://hackaday.com/2022/03/09/raspberry-pi-and-the-story-of-sd-card-corruption/

permalink
report
reply
11 points

I’ll second that: every single issue I’ve had with any of the Pis that are around here have all been bad sd cards.

They’re useful if you’re using an OS that doesn’t ever write to them, but as soon as you’re using a full Linux distro or running software that is writing logs or data, they’re going to fail and probably sooner than later and, of course, at the most annoying time possible because it’s a computer and that’s their thing.

permalink
report
parent
reply
5 points

OP mentioned a Minecraft server, iirc that can be pretty noisy in the logs.

permalink
report
parent
reply
4 points

Oof, and a minecraft server is also constantly writing the world state to disk which will 1000% kill a sd card in a hurry.

permalink
report
parent
reply
8 points

tldr Sudden Death card

permalink
report
parent
reply
1 point

😹 that’s great

permalink
report
parent
reply
7 points

“He’s dead Jim”

MicroSD cards aren’t designed for a lot of writes. Your card it probably dead. If you must use a RPI with a SD card you should get an enterprise grade MicroSD

permalink
report
reply
3 points

I’ll get an M.2 HAT and an ssd

permalink
report
parent
reply
2 points

That works although its not all that cost effective

permalink
report
parent
reply
1 point

SSDs are crazy cheap, what are you talking about? I think the added reliability and speed is absolutely worth it

permalink
report
parent
reply
1 point

While I haven’t personally tried it, I’ve heard people have issues with cooling when using the M.2 hat, especially when using their Pi for intensive applications (like hosting a Minecraft server). I’d honestly recommend just getting a 2.5" USB drive enclosure and an SSD. Costs about the same amount of money without the drawback of poor cooling. You can use it with any case, since it just connects via USB. I have been running my Pi this way for years (in fact I have never used an SD card in it).

permalink
report
parent
reply
1 point

I think “endurance” cards are where you get something reasonably non-self-destructive, for a modest premium.

permalink
report
parent
reply
1 point

The enterprise cards are pricey but the can take a beating and have a large write capacity

permalink
report
parent
reply
6 points

If you think it’s the filesystem try running fsck. It sounds like a failing storage device to me but there’s not nearly enough information to say for sure

permalink
report
reply
4 points

Could this possibly result in the loss of data? If so, what’s a simple way to do a backup of an entire disk?

permalink
report
parent
reply
7 points

fsck almost certainly isn’t going to cause loss of data, but it will likely inform you about a loss that already occurred if that is the issue you are having.

permalink
report
parent
reply
4 points
*

ddrescue is probably your best bet

dd is the simplest: dd if=/path/to/disk/device of=/path/to/backup/file but it may fail with a broken device. ddrescue is similar but handles io errors appropriately and can retry bad reads.

permalink
report
parent
reply
2 points
*

If the disk is failing anything you do that reads or writes it could cause data loss. Even having it plugged in and powered potentially could. It depends on what component of it is failing.

That being said, fsck is pretty safe. It’s the equivalent of chkdsk in windows, it looks specifically at the filesystem for things that may have gotten screwy.

ddrescue/gddrescue is your best bet for recovery. It can detect bad blocks and skip them, and it has some p robust resuming capabilities if your disk locks up while.its running. I usually use it to clone entire physical disks to another disk or an image file that can be mounted. I don’t know if it can be used to grab specific files, I’ve never tried.

If it was me, I’d take the disk out and let it cool to room temperature. Then I’d ddrescue the whole thing, with resume turned on, to an image file. Then I’d run fsck. If fsck finds and recovers filesystem issues, I’d put it back in the pi, continue using it, and start doing regular backups of important files via a cron task.

permalink
report
parent
reply
4 points

I managed to get it working. fscked the microsd and copied the files over to my pc. I’m going to be running MC on my pc until I get the Raspberry Pi M.2 HAT and an SSD

permalink
report
parent
reply
3 points
*

Just as info, there are boards to add NVME and SATA drives. https://www.raspberrypi.com/products/m2-hat-plus/

permalink
report
reply
4 points

I am aware of that, going to order one soon

permalink
report
parent
reply
2 points
*
Removed by mod
permalink
report
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 7.5K

    Monthly active users

  • 6.6K

    Posts

  • 179K

    Comments