banner



How To Repair A Corrupt Sd Card

Tutorial: Repairing Corrupted SD Cards for the Raspberry Pi on Macbrokensd

Accept you ever had your Raspberry Pi stopped booting up?   The carmine and the yellowish lights flash a few times and and so quit?   These are classic symptoms of a corrupted SD Card.

This posting volition walk through how to set a corrupted SD Card for your Raspberry Pi using a Mac and VirtualBox.   This is a adequately complicated procedure, but near of it but has to exist done once and then you tin can fix corrupted cards quickly and efficiently.

Why practice SD Cards get Corrupted?

When the SD Card is being written, there are windows of vulnerability.  At that place seem to exist four main scenarios during which SD Cards become corrupted:

  1. Powering your Raspberry Pi down without doing a "sudo halt".   Practise this enough, y'all will corrupt your bill of fare.
  2. Poor quality SD Cards.   Fake SanDisk cards especially.
  3. Marginal ability supplies.  Watch the Red LED on newer Raspberry Pi's.   If it is blinking, there are issues.   Poor ability quality from the mains tin likewise screw up your Raspberry Pi
  4. Overclocking your Pi.   If you push it too far, things outset not quite working correctly.

OK, what can I practise with a Corrupted SD Menu?

1562-00The first thing you can do is BEFORE you get corrupted, back up your SD Carte on a regular basis.   If you spend hours configuring an SD Bill of fare, then back it upward.   Changing your software?   Back it upwardly.   It will save you a lot of fourth dimension if you end up corrupting or destroying the SD Bill of fare.  Here is how to do it on a Mac.

Sometimes, the SD Carte du jour is really damaged.  In that instance, y'all aren't going to be able to fix the carte.  Yet, y'all can become your files off the SD Bill of fare in many cases.  Check out this posting.

Fixing a Corrupted SD Card

Overall, this is the procedure for fixing a corrupted SD Menu using a Mac.   The process is like for a PC, only requires different instructions to install and get VirtualBox working.

  1. Back upward your SD Carte, if possible.    Here is how to do it on a Mac.
  2. Install VirtualBox on your Mac
  3. Install Ubuntu in Virtual Box
  4. Attach SD Card to Ubuntu
  5. Run "fsck" to repair the SD Carte

Install VirtualBox on your Mac

VirtualBox is a "virtualizer" which ways that it allows you lot to install an operating arrangement in a "Box" inside another operating organization.  Information technology is open source and free to use.   In this case we will exist installing Linux (Ubuntu) on a Mac OS X platform.

Stride ane: Download the VirtualBox .dmg file for the Mac Bone 10  from this page:

Step 2: Click on the downloaded .dmg file.

Step 3: Double click on the VirtualBox.pkg icon

Screen Shot 2022-01-25 at 7.52.07 AM

Footstep 4: Follow the instructions to install VirtualBox in the applications directory.

Step 5: Now download the installation file (.iso) for Ubuntu from this link:    Annotation: Make certain you use this link – ubuntu-1510-desktop-i386.iso.  If this link isn't available, get to https://mirror.pnl.gov/releases/ and find the latest release.   The default download link on Ubuntu server volition download an amd64 paradigm, which Will NOT Work on your Mac OS 10.

Step six: Start up VirtualBox from Applications

Pace seven: Click on "New"

Screen Shot 2022-01-25 at 8.07.00 AM

Step 8: Enter "Ubuntu" equally the name.  Linux and 64 bit will be automatically selected.  Click Continue.

Screen Shot 2022-01-25 at 8.11.16 AM

Step 9: Click on continue until yous are done, using all the defaults.

Step 10: Click on settings and and so on Storage and then on Controller: SATA

Step 11: Enter 2 in port count!   This is an important step not to miss!  Click "OK" to shut

Screen Shot 2022-01-25 at 8.13.21 AM

Pace 12: Fix to install Ubuntu now!   Click the Get-go Button

Stride 13:  When y'all are promoted to select an image, select the ubuntu .iso image downloaded in Step v.

Screen Shot 2022-01-25 at 8.24.51 AM

Step 14:  Select "Install Ubuntu" from the screen, then "Keep" from the side by side screen and and so keeping the defaults, finally "Install Now".

Screen Shot 2022-01-25 at 8.27.36 AM

Step 15: Click "Go on" when asked to erase the virtual disk.  Don't worry, this is not your Mac Bone Ten deejay.

Step xvi: Select your Timezone.  Hit "Continue"

Screen Shot 2022-01-25 at 8.30.14 AM

Footstep 17: Put in your proper name and choose a countersign. Make sure you can recall it! Now hit "Continue" and you are installing Ubuntu.

Screen Shot 2022-01-25 at 8.32.07 AM

Step 18: Now click "Restart Now" when the installation is finished. If Ubuntu does not start (which happens oft the first time), and then hit the "x" in the corner and select "Ability Off the Car".

Screen Shot 2022-01-25 at 8.52.07 AM

Screen Shot 2022-01-25 at 8.56.18 AM

Step nineteen: Now y'all have your Ubuntu Virtual Auto running.  Click the "X' on the window and select "Ship the shutdown signal".  Then click "Shutdown"

Adding the SD Card to your Ubuntu Virtual Machine

In club to mountain and ready your corrupted SD Card, you need to add together it to the Ubuntu virtual motorcar.  This is the complicated part of this procedure.

Step 1:  Insert your SD Card into the reader on your Mac OS X machine.  Beneath is on the Mac Mini.   On a Mac Volume, it will be on the side.

IMG_7116

Step two: Open up a terminal window and type:

diskutil listing

Step iii: You will see a list similar to this.  Look for your SD bill of fare and note the /dev path (/dev/disk4 in this case)

Screen Shot 2022-01-25 at 9.06.18 AM

Step 4: In the terminal window type (replacing /dev/diskX with what yous found in Stride  three):

diskutil unmountDisk /dev/diskX            Screen Shot 2022-01-25 at 9.11.15 AM          

Step 5: change directory in the concluding window to the "VirtualBox VMs"  on our development machine this command is:

cd "/Users/evolution/VirtualBox VMs"

Note the quotes around the directory name.  Adding spaces in directory names and filenames causes all sorts of issues.   The user on our machine is "development".   The user name on your machine volition be different.

Step 6: Now nosotros come to the magic.  Type the following (replacing diskX with what you institute in Step three):

sudo VBoxManage internalcommands createrawvmdk -filename ./sd-card.vmdk -rawdisk /dev/diskX          

Step 7:   Now we have an .vmdk file pointing to your raw SD Carte du jour device.   Nosotros next have to set the permissions on this file so your Ubuntu VirtualBox auto can read the file.

sudo chmod 777 /dev/diskX
sudo chmod 777 ./sd-card.vmdk

Screen Shot 2022-01-25 at 9.16.24 AM

Step eight:  Next we have to add together the SD Card (a SATA device) in the Ubuntu virtual machine storage configuration built in the previous section.

Footstep 9: Click on Settings in VirtualBox and select Storage.  If port count is "i" change it to "2"

Screen Shot 2022-01-25 at 9.21.23 AM

Step 10:  Click on the icon on the right of the Controller: SATA disk and select "Choose existing disk".   Select the .vmdk file built in Pace 6 above.   If information technology reports that it is busy (Mac Bone X likes to remount things for some reason), echo Step 4 and quickly practise Step 10 again.

Footstep 11:  Click OK

Step 12: Start your Ubuntu Virtual machine with the start push button.

Now finally, we can repair the SD Card.

Repairing the SD Carte du jour

Step 1: Select the peak most icon on the Ubuntu Desktop.  Blazon "Terminal" in the search line.

Screen Shot 2022-01-25 at 11.32.48 AM

Step two: Select the Terminal Icon on the top line.  You will get a terminal window.

Step iii: type

sudo lsblk -l

into the final window (you may accept to enter your password from Footstep 17 in the department above)

Screen Shot 2022-01-25 at 9.49.41 AM

Step 4: Note the name "/dev/sdb".   That is your SD Carte du jour on the Ubuntu system.   Note it may be different, merely if you followed these directions, information technology should exist the same.

Footstep 5:  Now the magic.  Finally.  We will fix the sdb2 sectionalisation on sdb.   That is the linux organization.  Type the following in the final window:

sudo fsck -fy /dev/sdb2

This may take a while, depending on the speed of your motorcar.  Notation that the following picture shows yous what you become on a clean, adept SD Card.   If yous have issues, it will show you what it is doing.

Screen Shot 2022-01-25 at 9.56.42 AM

rasberry-pi-b_-with-sd-cardDetermination

At present yous should have a repaired Raspberry Pi SD Card.   If information technology doesn't work, you may have bigger bug.  Get-go by looking at more than "fsck repair" pages on the web.   If the card is bad, look at mounting the SD Card under your Ubuntu Virtual machine and going into the file organization to try to recover your most important files.

The next time you need to repair an SD Card, you should only have to plug it into your Mac OS X and and so start Ubuntu from VirtualBox.  Annotation that the paradigm you built for the SD Card repair probably won't kicking without an SD Card plugged in.  If yous want to use Ubuntu without the SD Card, build another image in VirtualBox.   You lot don't take to delete the SD Menu Ubuntu image.

Source: https://www.switchdoc.com/2016/01/tutorial-repairing-corrupted-sd-cards-for-the-raspberry-pi-on-mac/

Posted by: merkelhigend.blogspot.com

0 Response to "How To Repair A Corrupt Sd Card"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel