Ask / Submit

SD Card recovery on Linux or similar

asked 2015-08-28 18:36:33 +0300

monkeyisland gravatar image

updated 2016-06-18 01:50:20 +0300

misc11 gravatar image

I have made a big mistake.

I have a SDcard and i entered the card in my jolla an copied all folders including pictures and videos.

Then i remove the card and doing a factory reset to my jolla. After everything went fine i inserted the sd card but the card was empty. It is possible that the jolla have formatted the sd card again ? is there any chance to get back up my data? i am running on

Thank you all

edit retag flag offensive close delete



I haven't heard of Sailfish formatting SD cards without using terminal.

jollailija ( 2015-08-28 19:20:53 +0300 )edit

I did this several times - copying all my files with File Browser to SD card & then reset device. Never a single problem - I'm using a 32Gb card.

Unfortunately I have no clue how to get yoir data back - did you doublecheck if the data was really copied? Maybe a recovery tool could help - you would need a microSD card reader on your PC. There are some good recovery tools available for Linux and other systems (often not free though). But those recovery processes are never fun...

molan ( 2015-08-28 20:26:13 +0300 )edit

as already suggested, unless you have manually carried out inputting lines of code in terminal to format your card, then your data should still be there. Have you removed the sd card from your Jolla and attempted to read the card from another device?, like your PC?

Edz ( 2015-08-28 20:54:21 +0300 )edit

6 Answers

Sort by » oldest newest most voted

answered 2015-08-28 20:25:38 +0300

gfwp gravatar image

Corrupted card FS assuming that the SD card was formatted with FAT FS, as root

with devel-su

fsck.vfat -a /dev/sdb (or whatever is your SD card)

edit flag offensive delete publish link more



The device would be /dev/mmcblk1p1 if the SD card has only one partition. However, I doubt this helps at all, as the system would do that automatically before on any mount attempt anyway.

raimue ( 2015-08-28 23:45:16 +0300 )edit

answered 2015-08-28 22:47:49 +0300

J4ZZ gravatar image

updated 2015-08-28 22:51:35 +0300

For Fat, Ext or Ntfs filesystems I always get my data back by using opensource software 'testdisk' For Btrfs I lately had to play with the 'brtfs restore' command and some brtfs-undelete scripts. The latter took quite a bit of reading and understanding but finally it worked. Even without having had a btrfs snapshot of my subvolume, I could restore my accidently deleted files. Cheers, J4ZZ

edit flag offensive delete publish link more

answered 2015-08-29 14:23:45 +0300

MartinK gravatar image

I recommend trying to run PhotoRec and TestDisk on the card:

I have had good experience with using both for data rescue from memory cards in the past. :)

edit flag offensive delete publish link more


@:MartinK and all others Thank you for your helps i tested photorec and testdisk i can say that i get some files but not all.

monkeyisland ( 2015-09-01 11:33:24 +0300 )edit

answered 2015-08-30 14:14:17 +0300

gabs5807 gravatar image

updated 2015-08-30 23:49:55 +0300

Hello, first of all it is necessary to know, what happend. If only the master boot record is destroyed, you can recreate the partitions with standard mechanism on linux (e.g. gparted). But be in kep in mind, do not create the filesystem only the partition! If you exactly know the start and size (or end) of the partition, you can recreate it and you have access to all your lost data :-). If the file system is also destroyed you can use the tools foremost an magicrescue (both tools in standard repositories of debian and variations like ubunto or mint ..). They scan the device for magic pattern (file headers) and save them on a target directory. This is only possible if you are not use partition encryption! For more information have a look at the manual pages of the tools. Btw: before you do any thing with your card, take a backup of the whole card (e.g. dd if=SD-Card device of=SD-Card-save.img bs=1024k).

edit flag offensive delete publish link more

answered 2015-08-28 21:22:21 +0300

I'd try using Gparted's "Attempt data rescue"-feature. Gparted is a Linux tool that is included in at least, if I recall correctly, Ubuntu and Linux Mint distributions (if not, you can get it from the software store or use aptoide/apt-get/yam/what-ever-tool-your-distro-has-for-installing-software).

edit flag offensive delete publish link more


No Joy for me. My 128 GB Sandisk card seems to be broken. The saddest thing is this is that Phone (Jolla) did not give any warning. I tried to listen podcast and some music two nights back, but I was only able to listen for few minutes of the podcast and all tracks of music I tried (stored on the card) failed. So yesterday I had some time and looked. Jolla said "unrecognized filesystem on card" and offered to format it to ext4. I took the card and tried to recover it with a laptop. Neither Gparted and testdisk where able to recover any partition information. I tried to reformat the card first with the phone, no joy. Reformat failed also with the laptop. Not a big deal, I lost contact information and few hundred pictures, but not a big deal for me.

I know that android phones complain constantly when there is a problem with the card. My Jolla did not give single warning. Oh well, luckily I have another 128 GB available.

I have had this 128 GB card since March 2014 on the same Jolla phone. In the beginning it had btrfs in it, but I reformatted it to ext4 on august 2014. Short lived. I have a 64 GB Sandisk card on my N900 (since December 2009) and it is still working.

Lupin ( 2017-12-24 13:29:20 +0300 )edit

Another problem related to this. I opted to use my 200 GB Sandisk card and thought that best way to ensure compatibility with the phone would be to format it with the phone. So inserted the card into phone, Tallennustila/Storage shows incompatible file system. I chose Alusta (format) and the phone says "Backup your data before yada yada..." and offers button "Remove all files" which i pressed. Got the expected countdown "Removing all files in 5..4..3.." When it went there was no visible activity anywhere so went back to storage view and chose "Update" from the pull-down -menu. No change. After three tries I resigned and put the card into my laptop and did the formatting there. Inserted the formatted card into phone which was still running and it mounted the card automatically and shows now: 9,3 GB in use, 171,1 GB free. memory card ext4. So far so good. Now I have to import my contacts and music again. I'll report back.

Lupin ( 2017-12-24 14:30:21 +0300 )edit

answered 2016-06-17 23:21:33 +0300

jdrescher2006 gravatar image

Oh no!! I can't believe this. I made the same mistake. I copied all data and even a backup to my sd card. Then I did a factory reset and the card was EMPTY!!!

I did this before and the Jolla did not delete or format the card. Is this supposed to be some new feature?

I will now try to restore my data. Expecting the worst...

edit flag offensive delete publish link more



Don't know if it matters (shouldn't imho), but was the SD-card inside the phone when you did the factory reset?

avhakola ( 2016-06-17 23:57:20 +0300 )edit

Yes it was in the phone. I can't imagine that the phone will format the SD card while factory reset process. When I insert the SD card to a Windows computer it says the card is not formatted.

jdrescher2006 ( 2016-06-18 16:37:27 +0300 )edit

Did the card have FAT filesystem before it was emptied?

avhakola ( 2016-06-18 17:26:05 +0300 )edit

SD-card won't get mounted on first time automatically. I made my backup on /media/sdcard and soon after that got the message "out of free space". I noticed that the backup was not on sd-card. I made new fs and mounted the sd-card and after next reboot sd-card got UUID.

jalomann ( 2016-06-18 17:40:00 +0300 )edit

I was able to fix it! It is a 32GB card formatted with an ext4 filesystem. After the Jolla messed it up I inserted it into the card reader of my Thinkpad. Gparted on Ubuntu showed a !!32MB!! partition of unknown type and suggested to format it, which I of course didn't do.

Then I used the software testdisk as suggested by @J4ZZ. This software could not detect any deleted filesystems and was of no use.

BUT: after I replugged the card to my card reader the next morning, it worked again!!! The original ext4 partition with all my data is magically there again!

I don't know, maybe it was something testdisk did. Glad that I have my data back. I will never leave an SD card in the Jolla while factory reset, although by being able to copy the data right in the backup app, it is suggested that it will be safe there :-(

jdrescher2006 ( 2016-06-22 16:20:15 +0300 )edit
Login/Signup to Answer

Question tools



Asked: 2015-08-28 18:36:33 +0300

Seen: 1,940 times

Last updated: Dec 24 '17