If you are using a USB drive or SD card to boot your Raspberry Pi, you may encounter the fsck error. Several users have reported the Raspberri Pi causing fsck error resulting in a corrupted SD card.
I have experienced several instances of data corruption on the SD card on my Pi. I am still investigating the root cause of this. At the moment to correct filesystem errors I shut down the pi and put the card into my laptop to fsck the root filesystem.
To avoid USB or SD card corruption make sure you use a USB power hub to connect your USB flash drives. If your boot SD or USB drive is corrupted, try fixing the drives by following the steps in the article below.
How do I fix Raspberry Pi causing fsck errors?
1. Fix the SD card using a Windows computer
- Remove the SD card from the Raspberry Pi slot.
- Connect it to a Windows computer. Since the process won’t take more than a couple of minutes, borrow a Windows system if you don’t have one yourself.
- Once connected to your Windows computer, the PC will automatically detect that there is a problem with the card.
- When the Do you want to scan and fix Removable Disk dialog appears, click on Scan and fix.
- Wait for Windows to scan the drive for errors and fix them.
- Once fixed, eject the SD card and insert it into your Raspberry Pi device.
- Reboot the device and check if the error is resolved.
Using a Windows computer to fix the SD card issue is a much simpler solution than using the Ubunto terminal commands. However, if the issue persists and Windows fails to fix the drives, proceed with the next set of steps.
2. Use Linux terminal to repair the drive
- Eject the SD card or USB drive from your Raspberry Pi.
- Connect it to a Linux system using a card reader or USB port.
- Press Ctrl + Alt + T in Ubuntu to open the terminal.
- Type mount and hit enter to find your pen drive or SD card letter.
- Type the following command and hit enter. Make sure to replace the sdc1 in the below command with the pen drive or SD card letter applicable to your drive.
sudo dosfsck -w -r -l -a -v -t /dev/sdc1
- The dosfsck will scan the drive for errors and fix them.
- Once finished, eject the SD card and insert it into Raspberry Pi to see if the error is resolved.
In the above command:
- -w means write to disk immediately.
- -r run the performs disk check interactively.
- -l means to list the filename processed.
- -a asks the tool to fix any errors if found.
- -v means verbose mode.
- -t means mark unreadable cluster. You can skip the -t switch if the scanning and repairing process is taking too much time.
The Raspberry Pi can cause fsck error if the boot drive that is your SD card is corrupted. The error can be fixed using the Windows USB drive troubleshooter or using the dosfsck tool in Linux.
Follow the steps in the article and let us know which method helped you resolve the issue in the comments.