JP Vossen on 22 Nov 2011 19:34:15 -0800 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
[PLUG] Recovering a FAT16 SD Card in an MP3 Player |
Short version: cgsecurity's 'testdisk' [1] trivially fixed it. Long version:My daughter's $20 SanDisk Sansa Shaker Digital player [2] battery died (which happens often since it's a single AAA), and it killed the SD Card on its way out (happens rarely). Usually when it takes out the SD Card, if I mount the card in a laptop reader it then Just Works again in the player. Once I think I had to 'fsck -r /dev/sdb' or something once. Maybe. But this time, it somehow nuked the boot sector.
Ubuntu could see the SD Card in the reader, but showed no partitions or file systems. Mounting via USB to the shaker itself showed /dev/sdb just fine, and various flavors of 'fdisk' showed sdb1 FAT16 partitions on the 1G SD Card. But no data...
So first, just in case, I ran: $ sudo -s # ddrescue -v /dev/sdb shaker.dd After that, I: # aptitude install testdisk # testdisk /dev/sdbThen I followed http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step. The post analysis screen showed 2 identical full-disk FAT16 partitions, which is kinda good, except for the part about there being 2 and neither one actually working. Then after the "Quick Search" it told me something about no partitions found. That was odd, because of the 2 it knew about before that.
So I bounced back a bit, looked at http://www.cgsecurity.org/wiki/Advanced_FAT_Repair, then followed these menus:
> [Advanced] > [Boot] > [Rebuild BS]I wrote the new boot sector and exited, and it told me I had to reboot, which was not true. (Windows roots showing?) I simply ran 'mount /dev/sdb /mnt' and there were all the songs again. Nice!
For whatever good it will do, I set the read-only tab on the SD Card this time... I also created a trivial script to re-copy the songs from the NFS share to the USB mount-point, just in case it ever really dies and I need to replace the card & and songs.
____________________________ [1] http://en.wikipedia.org/wiki/Testdisk[2] http://kb.sandisk.com/app/answers/detail/a_id/180/~/using-the-sansa-shaker-player
Just in case this helps someone later, JP ----------------------------|:::======|------------------------------- JP Vossen, CISSP |:::======| http://bashcookbook.com/ My Account, My Opinions |=========| http://www.jpsdomain.org/ ----------------------------|=========|------------------------------- "Microsoft Tax" = the additional hardware & yearly fees for the add-on software required to protect Windows from its own poorly designed and implemented self, while the overhead incidentally flattens Moore's Law. ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug