When moving a cable, I violently ripped the SD card out of my Raspberry Pi by accident, breaking some of the slot's plastic in the process. I was certainly careless, but using flimsy plastic for a component that can receive quite a bit of physical stress is probably not the best idea. The missing parts are highlighted below in red.
What doesn't work
Those plastic bits are crucial for retaining the SD card, so it's virtually impossible to operate the device for prolonged periods of time. The SD card needs to be firmly in place for continued use. Clamps or glue don't provide the necessary rigidity for that - a slight shift in how the card is situated could already disconnect the card and crash the OS further down the road. The only thing that worked for me was pressing down the card with my fingers.
The cleanest solution is certainly replacing the slot with a (hopefully better) new part. That might not be an option for a variety of reasons:
- Not being confident in your soldering skills
- Not being able to solder at all
- Needing the Pi to work right now, but:
- Stores are closed because it's a weekend and a holiday
- Ordering online takes too long and shipping costs triple the price of the item are outrageous
- Godzilla is roaming the streets around the electronics store
In that case, someone had the glorious idea to use glue and an old credit card to build a makeshift cover for the slot. This solution works, but is still plagued by the slot contacts' sensitivity. Additional fitting is necessary to keep the SD card steady.
Booting from USB instead is not possible, because the device is hardwired to use the SD card. That can be worked around, though.
Solve the hardware problem in software
Using USB storage for the root file system is possible once the kernel has been booted from the SD card. The steps for powering up the device are as follows:
- Insert the USB storage device.
- Carefully insert the SD card into the slot and hold it down firmly.
- Connect to the power supply.
- Wait for a few seconds, ideally until the flashing LEDs on the Pi indicate activity.
- Remove the SD card.
rootfs parameter in the
cmdline.txt file on the SD card's FAT partition (the first one) needs to be set to
This is assuming that the OS was installed on the USB storage device the same way as it would be installed on an SD card, where the partition layout generally consists of the FAT-formatted boot partition in the first position, and the root partition in the second position.
The USB storage device could also contain the root file system alone in the first position, changing
/dev/sda2 in these instructions to
If multiple USB storage devices are connected, using
sdb instead of
sda may be necessary, depending on in which order the devices are enumerated.
With these changes, the USB storage device would be used for the root partition, but the boot would still fail, because it is attempted to check the integrity of the SD card's partitions during startup.
To avoid this, edit
/etc/fstab to use
/dev/sda2 as the root partition.
The directive for the boot partition is no longer necessary, since its contents on the USB storage device are not used.
This solution comes with a small caveat. Updating the kernel becomes a little more cumbersome, because it has to be done manually on the SD card, and will no longer work with the package manager. Still, it's a viable hack until an opportunity to replace the SD slot comes along.
There are comments.