OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 5:03 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Recovering SD Disk...
PostPosted: Mon Oct 28, 2013 10:13 am 
Offline
Member
Member

Joined: Mon Aug 05, 2013 8:15 am
Posts: 46
Hi!
A guy asked me to try to recover his photos from a SD Disk(4GB). The disc was working well until he put it inside an "all at the price of 1 euro" memory card adapter. Now it is reporting on different systems, different capabilities. On mine it reports 32MB, how suspicious- the limit size for FAT16. I tried DD tool from the command line but it copied only 32 MB and returned an error. I think I still can't get over the Operative System(Windows in my case)

Anyway, my question would be if there is some tool, maybe some mini OS, that I could boot and interrogate the SD Disk directly, no matter what it's reporting, cuz I know it is 4 GB capable. I didn't programed an USB driver yet, or whatever kind of driver SD Cards need. I don't think I will program it soon. So my question is if there is any bootable tool (like the one that checks the RAM) that will deal directly with the hardware. I could think of issuing a read at the 3GB, let say, no matter what capability card is reporting, and if then I receive error code, I would give it back to the guy saying him that it's broken forever. I am speaking generally, because I don't know how such driver works, but you should understand what am I asking for.


Top
 Profile  
 
 Post subject: Re: Recovering SD Disk...
PostPosted: Mon Oct 28, 2013 11:01 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 27, 2010 4:53 pm
Posts: 1150
Location: Scotland
You could fiddle around trying to write your own software to do the job, and you could access the SD card through BIOS calls, but you'd probably be better off buying some software to do the job. There is one package that you should maybe give a go first which allows you to use a free demo version first which won't recover any files for you, but it will show you if they can be recovered: http://download.cnet.com/GetDataBack/3000-2094_4-10061631.html. If it can't see any files, it probably won't be worth buying any such package.

What I would do first though is try to copy the entire content of the disk using a hex editor and then save that to hard disk so that any further corruption to the SD card won't lose any more data.

_________________
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming


Top
 Profile  
 
 Post subject: Re: Recovering SD Disk...
PostPosted: Mon Oct 28, 2013 11:05 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 27, 2010 4:53 pm
Posts: 1150
Location: Scotland
While you're at it, use the hex editor to look at the first sector on the physical drive, then copy it and post it here. It may be that the only damage has been done to that sector and it might be possible to fix it with a little hacking - I'd like to see its partition table. If that part's in good order, it will then tell us which sectors need to be looked at next.

_________________
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming


Top
 Profile  
 
 Post subject: Re: Recovering SD Disk...
PostPosted: Mon Oct 28, 2013 11:36 am 
Offline
Member
Member

Joined: Mon Aug 05, 2013 8:15 am
Posts: 46
Thank you for the reply!
I tried it now and even other three demos and nothing. Only one of them offered me raw scan....
I wish to program a tool like that but I have not the time :( All takes too much time, even a pity driver. Anyway i'm allways programing something :)
I think I have to restore the computer, I tested so much software, I got a lot of unwanted pop-ups

PS: Last software let me see the content of disk in HEX, but it was all 0s. I will give up for now, but as usual, I will say to the guy to keep that memory card and never throw it, who knows, someday maybe I could test on it my card reader routines, anyway, programing that is my last goal. I am working on other most important parts of my OS now.


Top
 Profile  
 
 Post subject: Re: Recovering SD Disk...
PostPosted: Mon Oct 28, 2013 12:28 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 27, 2010 4:53 pm
Posts: 1150
Location: Scotland
Have you actually tried a hex editor? If you don't have one, http://mh-nexus.de/en/hxd/ is safe. You can then look at the physical drive to see if there's anything on it. It's highly unlikely that the whole thing's been turned to zeros. If the FAT tables are undamaged, it may be relatively simple to write code to recover all the files, even with the simplest OS. That would be a fun project. Don't give up on it yet, but do as I asked and use a hex editor to look at the first sector (sector 0) on the physical disk, then copy its content and post it here. If the disk doesn't show up at all, it would be worth writing a little code to use the BIOS from a simple OS to read the first sector, and if that can't cope either it will suggest that the disk has been damaged beyond the point where it can be accessed through any normal means (in which case it might be necessary to put an illegal file on it and hand it in to the police to get them to recover all the data in return for a small prison sentence).

_________________
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming


Top
 Profile  
 
 Post subject: Re: Recovering SD Disk...
PostPosted: Mon Oct 28, 2013 1:43 pm 
Offline
Member
Member

Joined: Mon Aug 05, 2013 8:15 am
Posts: 46
I can't do anything more trough the Windows interface. The next step would be to use BIOS calls. But now I will just give up on that, because I have to finish an important piece of my OS.
I saw briefly your project and sounds curious. How sad I am so busy with mine. I would like to give it a try.
Now I'm just coding a stable and well standardised OS. When I have a programing interface for that OS, I will publish it. But now I just want it to be as much stable as possible, as stable as windows. People are never doubting if installing windows their computers will get harmed. That's what I like for now for my system. I know maybe here are many fanatics of Linux, but Linux damaged my PC and the PC of others I know.
Good luck on your project! I am assembly user, we have things in common!


Top
 Profile  
 
 Post subject: Re: Recovering SD Disk...
PostPosted: Tue Oct 29, 2013 3:15 am 
Offline

Joined: Tue Oct 29, 2013 3:00 am
Posts: 1
Hi, I think there is something wrong with your SD disk. As you have lost many photos, so if you can repair your SD Disk, you can restore the lost photos at least. And I'm sure these photos are important for you. I have used this program to recover lots of pictures, you can also refer to here:How to restore lost photos from Nikon camera. Hope this will help you.


Top
 Profile  
 
 Post subject: Re: Recovering SD Disk...
PostPosted: Tue Oct 29, 2013 4:57 pm 
Offline
Member
Member

Joined: Tue Nov 08, 2011 11:35 am
Posts: 453
There are several SD card controllers that have such capacity-changing bug.
Here's solution for one of such controllers: http://www.idioten-notschlachten.de/blo ... -sie-asmi/
Note: I'm not sure that it'll help you and won't destroy your data.

There are also a lot of similar tools and articles at flashboot.ru (you can try using google with 'site:flashboot.ru' to search and translate.google to read, that's how I use it), unfortunately I don't know similar english/german sites.
Btw, try googling the IDs of your card with 'capacity changed' keywords, you can possibly find a solution like that one for ASMI cards.


Top
 Profile  
 
 Post subject: Re: Recovering SD Disk...
PostPosted: Thu Oct 31, 2013 11:00 am 
Offline
Member
Member

Joined: Mon Aug 05, 2013 8:15 am
Posts: 46
Thank you both! I will keep on that later, not mine photos was lost after all. I just wanted to become the top geek of my little town. Because everybody that is understanding or working with computers here tried to recuperate that data and failed.


Top
 Profile  
 
 Post subject: Re: Recovering SD Disk...
PostPosted: Sun Dec 22, 2013 4:06 am 
Offline
Member
Member

Joined: Tue Apr 13, 2010 8:00 pm
Posts: 285
Testdisk is a good program for recovering stuff. It accesses at the sector level, so it'll see anything a hex editor could see.


Top
 Profile  
 
 Post subject: Re: Recovering SD Disk...
PostPosted: Thu Dec 26, 2013 8:53 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 30, 2013 8:11 am
Posts: 70
<shameless idiot :oops: >Hey! Wait a second.
Wasn't the same "exact" word-to-word question posted a while ago?
Infact the replies also look the same.
Is this a bug?</shameless idiot :oops: >
As for the SD Disk, Try putting it in other OSes, I remember the same issue
with my floppy disks, Windows told me that the size was 32 MB ( :shock: ), after putting
it into Ubuntu I could easily access it as a FAT12 floppy.
Don't know if this is possible how about converting the disk as a whole file and then examining the contents.
I think that you can use DD to do this,
If this writes a image to a disk :
Code:
dd if=SDisk.img of=/dev/sdXX

then this should write the disk to an image
Code:
dd if=/dev/sdXX of=SDisk.img

Am I wrong?
If this is correct, then you would be able to examine the contents of the disk without
really examining at the BIOS level or something. Hence less risk.

_________________
When you say, "I wrote a program that crashed Windows," people just stare at you blankly and say, "Hey, I got those with the system, for free." - Linus Torvalds
64 bit Kernel in early development
http://github.com/nerdguy12/core64


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 52 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group