Sunday, September 20, 2015

How to fix Link2sd partition when SD gets damaged (Android)

Recently, I've faced the problem lots of Android users have found any time: SD card is damaged. Try reformatting. Android sucks.

As many users claim, my SD worked well in the PC. In my case, I use Link2sd to partially solve the problem those idiots who program Android cause, not allowing you to install apps in the SD card. (Go to check Link2sd in the market for more info). That makes me have my card divided in two partitions, the FAT32 one for my stuff and the other one formatted in a weird Linux system (ext2, 3 or 4) for the app to work.

After the first connection to my PC and a disk scan that found nothing wrong (that is: right click on the device-> Properties, Tools tab->Error Checking->Check), and a restart in the Android device, I got it to stop talking shit about damage, and I could access my data without problem.

I didn't care at all about the rubbish I had in the FAT32 partition that was working now and it seems nobody out there cover how to repair the rest of the card, which stored my precious Link2sd apps. So, let's see.

This is a snapshot of Mini-Tool Partition Wizard. We can see the FAT32 partition there and the other one which says "Other". The software didn't recognize the partition. In my Android, the Link2sd apps were disappeared and if I tried to open Link2sd, it kept asking me to select the file system of the partition like the first time I used it. Something was clearly not working right with that partition.

Let's attempt to fix this rubbish

You need a Linux OS (use a live-cd, live-usb, virtual machine... for convenience), I used Lubuntu.

Plug the card in the computer and find the path to where it was mounted. Call me idiot but I think the best way to do this for an untrained Linux user is through Gparted, so install it.

Select the correct drive in the top right corner, and check the path. In this case, the unknown 2 GB partition is in /dev/sdb5.

Now, open the terminal in your Linux and write fsck and the path, so:

fsck /dev/sdb5

Press enter and hopefully it will find errors and will ask you to press 'y' for fixing each one of them.

Unmount properly the card before extracting it and insert it in your Android. Maybe you'll need a restart, and if you're lucky the lost apps will come back and you won't have to throw out the window your Android, yet.