Corrupted SD card
-
For some reason when i plugged my sd card into my Mac yesterday the system immediately switched off - the card is now corrupted. When i plug it into my Pi it starts to boot and gets beyond the first splash screen, it then does a file system check and then the screen fills up with numbers which scroll and it basically goes on like this all day!
so, how to fix?
If i plug it into my Mac it does not show in disk utility but it does in Apple Pi Baker - when i try to format it in this by 'prepping for noobs' it acts as though it has worked, but when i try to restore an image it does not work, i think it is unable to 'unmount' the disk in order to write to it. If i plug it back into my Pi after this it goes through the boot process as i mentioned above, so this shows it has not actually been reformatted.
If i plug it into my Mac it does not show in Disk Utility, however i am able to see it in terminal and it shows up as:
#: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *127.9 GB disk4 1: Windows_FAT_16 boot 59.8 MB disk4s1 2: Linux retropie 127.8 GB disk4s2
If i then try to format the whole thing i get the following:
Karls-iMac:~ karljeffery$ sudo diskutil eraseDisk FAT32 NAME MBRFormat /dev/disk4 Started erase on disk4 Unmounting disk Error: -69888: Couldn't unmount disk
So, next step is to try and force a repair, but this is the result:
Karls-iMac:~ karljeffery$ diskutil repairVolume /dev/disk4s1 Started file system repair on disk4s1 boot Updating boot support partitions for the volume as required Error: -69673: Unable to unmount volume for repair
So, looking at the various results, it seems like all my problems would be solved if it could 'unmount' the card and just get on with the job!
I have also tried using a program called 'SDFormatter' but again, this seems to be having problems unmounting as it says 'the card is used by other processes'.
Anyone have any tips or solutions that may help me, at this point i really dont want to have to spend cash on a new card!?
-
@chubsta Hmmmm. I was gonna suggest SD Card Formatter... Did you click the `Format size adjustment' option? As a last resort I would try putting it in a different device and formatting it there. A lot of people say to use a camera, if you don't have one try a phone or tablet. I don't think the card is lost, just yet.
-
When I have a card that needs formatting, I use a bootable USB with an image of "Lucid Puppy Linux".
In the start menu, under System, there is a program called GParted Partition Manager that has allowed me to deal with some particularly recalcitrant SD cards in the past.
I have a Windows machine, and it will not deal with cards that have been formatted with a Linux partition (ext4, for instance). The only way for me to get those cards back in service for Windows is to use Puppy to destroy the old partitions. Then I can either use GParted to create a new, Windows friendly FAT partition, or I can put the unformatted disk into the Windows machine and it is now visible.
Since you have a Mac, you'll have to search whether or not your specific model will have a problem with booting Puppy or not. (For instance, with MacBook Pros, if it has an Intel processor, you're good to go. If you have a Motorola processor, you have to find another solution.) If you have a windows box in the house, I haven't found one yet that doesn't play well with Puppy.
Good luck and I hope this helps.
Mike -
@chuuken
it is looking good for that to have worked, plus, as a bonus, i now know how to use a bootable usb which i am sure will come in handy again in the future - thanks for the help guys, much appreciated, after a whole day of messing about with it i may just have saved the card! -
Glad to hear it!
As an added bonus, if you know anybody who ends up with a machine that won't boot, the puppy USB is a great way to get into the drive and backup important files before they have to reinstall the OS. (Barring physical drive damage).
-
@chuuken I like puppy ok. But have you tried knoppix? I like all the cool apps it comes with.
-
@chuuken best thing is to backup important stuff ahead of time. Also making a backup image file of your sd card with a program like win32diskimager makes it 1000 times easier. I use real samsung micro sd cards and have not gotten a single corrupt card. With sandisk, kingston and several others, i got a lot of card corruption.
-
@NastyButtler322 I have not. I tend to find things as a result of fixing problems, more than exploring for the sake of finding new things. (meaning, once I find a good solution, I stop looking.)
I'll have to get myself a copy of knoppix and give it a whirl! The thing that caught my interest with Puppy was how light-weight it was, but I will be the first to admit it is frustrating if you want to use it as an actual "everyday OS". Knowing nothing else going in, Knoppix may solve some of those problems...
Thanks!
-
@edmaul69 I agree 100% about the backups.
That's an interesting note about the brands you've had trouble with. Sandisk isn't exactly no-name. I wonder what the difference is? -
interesting info guys, i will try getting a Samsung card next i think as i currently use a Sandisk one, won't hurt to have a different make.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.