Find the answer to your Linux question:
Results 1 to 8 of 8
Greetings all, I've installed a Live version of Slax on a USB stick in order to try and recover some data from an SD card that seems to have become ...
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    4

    Manual mount of SD card reader (laptop)

    Greetings all,

    I've installed a Live version of Slax on a USB stick in order to try and recover some data from an SD card that seems to have become corrupted. I'm hoping that at least some of the data is recoverable because at one stage I could actually mount the SD card in Windows and see thumbnails.

    Now I've familiarized myself a little with Slax and my old days of DOS are helping me come to terms with the console, so I'm not a total Noob. (but Noob nonetheless).

    Anyway, the problem is that I'm having trouble manually mounting the SD card. Now I know the reader works because it auto-mounts when I insert a non-corrupted SD card and I can read the data just fine. When I put in the corrupted card it doesn't automount so I try to mount from the console. The problem is that each time you umount an SDcard, the next time it increments the device name with some number. For example:

    1st mount (non-corrupted SDcard) will mount as /dev/mmcblk0p1
    The second mount might use /dev/mmcblk1p1 and so on and so forth.

    So when I remove the SDCard an insert the corrupted SDCard and try to use /dev/mmcblk0p1 (or an incremental variation thereof) I get an error like "device does not exist" or in the Gui I'll get something like "media not available".

    It even mounts in Windows XP 64-bit, it's just unreadable so my guess is there should be a way to "force" it to mount. Then I'm hoping to use photorec to restore the pics. I did try starting up photorec with a useable SDcard and then switching it with the corrupted card just before the sector scan, in the hopes that I could trick it but it doesn't seem to work. (Even if I replace the good card, it still can't read it so that indicates that once the good SDCard is unmounted the device just becomes totally unavailable to the system)

    Anyway, I was hoping some gurus here could give me some advice.

    Thanks.

  2. #2
    Linux Guru waterhead's Avatar
    Join Date
    Jul 2004
    Location
    Franklin, Wisconsin
    Posts
    4,577
    If the card is bad, or going bad, mounting may not work. What you could try is to make an image of the card. You can then mount the image, and maybe try getting files out of it.

    You would first need to know the actual dick name, not the mounted name. To list all of the disks on the system, run this command with root privileges.
    Code:
    fdisk -l
    That is a lower case "L", not the number one.

    On my Eee PC, the 8GB SD card looks like this.
    Code:
    Disk /dev/sdb: 8017 MB, 8017412096 bytes
    186 heads, 43 sectors/track, 1957 cylinders
    Units = cylinders of 7998 * 512 = 4094976 bytes
    Disk identifier: 0x0000d996
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1        1957     7826021+  83  Linux
    To image it, a command like this is used.
    Code:
    dd if=/dev/sdb of=/backup.img
    You need to give the entire path to where you want to save it to. It will be the same size as the disk, so to save it as a compressed file, use this.
    Code:
    dd if=/dev/sdb | gzip -c  /path/to/saved/backup.gz
    There ways to analyze and retrieve the data, using dd. Unfortunately, I am no expert at this. Hopefully someone can post and fill in all the things that I left out.
    Paul

    Please do not send Private Messages to me with requests for help. I will not reply.

  3. #3
    Linux Guru waterhead's Avatar
    Join Date
    Jul 2004
    Location
    Franklin, Wisconsin
    Posts
    4,577
    I was just reading this How-To for dd:

    Recover Data From a dead hard drive using dd -- Debian Admin

    If there are errors reading the card, you need to add this:

    conv=noerror,sync

    So the command would be this:
    Code:
     dd if=/dev/sdb conv=noerror,sync | gzip -9 /path/to/saved/backup.gz
    Last edited by waterhead; 06-08-2009 at 12:14 AM.
    Paul

    Please do not send Private Messages to me with requests for help. I will not reply.

  4. #4
    Just Joined!
    Join Date
    Jun 2009
    Posts
    4
    Thanks for the feedback.

    I tried using fdisk -l before but it doesn't list the sd card reader even when there is a valid SD card inserted. I can however use fdisk /dev/mmcblk0p1 for example and it will give me info about the SD card so in other words I have to specify it. Any other way to figure out the device name?

    I've tried mounting "/dev/sdb" but I get the error that it can't find it in mstab or fstab. I've looked at fstab and when I insert a valid SD card it adds a line for /dev/mmcblk0p1 (or an "incremental" variant).

    Windows will mount it, it just thinks it's RAW or "unallocated" so the FAT partition must be damages somewhere.

    Any other ideas?

  5. #5
    Linux Guru waterhead's Avatar
    Join Date
    Jul 2004
    Location
    Franklin, Wisconsin
    Posts
    4,577
    The /dev/sdb designation was for MY computer. That was only an example, so use what works on your PC. Read through this article from Linux Journal. It has some things that you can try.

    Hack and / - When Disaster Strikes: Hard Drive Crashes

    It looks like the ddrescue program is what you need to use.
    Paul

    Please do not send Private Messages to me with requests for help. I will not reply.

  6. #6
    Just Joined!
    Join Date
    Jun 2009
    Posts
    4
    Thanks, yeah I do have a device called /dev/sdb when I use "cd /dev" then execute an ls - lst so I thought it might be this device.

  7. #7
    Just Joined!
    Join Date
    Jun 2009
    Posts
    4
    okay so the real problem I'm having is in not being able to identify the device. Even when a valid SD card is inserted an "fdisk -l" doesn't show it up. Any way to figure out what the device name is?

  8. #8
    Linux Guru waterhead's Avatar
    Join Date
    Jul 2004
    Location
    Franklin, Wisconsin
    Posts
    4,577
    Not that I am familiar with. It's beginning to sound like there is a problem with the card reader. It should show the card with fdisk, especially if a known good card is in the slot.
    Paul

    Please do not send Private Messages to me with requests for help. I will not reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...