Problems with my SD card

Discussion in 'Linux' started by man222, Feb 3, 2009.

  1. man222

    man222

    Joined:
    Jan 21, 2009
    Messages:
    3
    Likes Received:
    0
    A couple of months ago I acquired an A110 and added an 8GB SanDisk in the left-hand slot. At first the inclusion of the extra 8GB worked automatically and I was not aware of where my files were being placed, though having searched here it seems they were being put on the SD.

    Recently I have been having a problem where suddenly my SD becomes read-only and I cannot do anything with it, such as print files to it or run the application I am using (GRAMPS). Restarting cures the problem but only for a while, and the problem is getting more frequent so I need to do something about it - is it a hardware problem with the A110 or the SD, or has the software been corrupted in some way?

    Some symptoms that might be relevant are that in the file manager I can now unmount the SD whereas I thought that previously there was some other option (umounting and remounting does not make any difference), that after trying various ways of examining the files the home directory just becomes empty, and that in Terminal trying to use ls on a directory fails with "Stale NSF file handle".

    Any ideas, please, in simple language.

    Mike
     
    man222, Feb 3, 2009
    #1
  2. man222

    mattytee

    Joined:
    Nov 30, 2008
    Messages:
    112
    Likes Received:
    1
    Check your /etc/fstab and post it here if it looks odd. Be especially aware of entries beginning /dev/mmc . What filesystem is running on the card?

    It's likely aufs is acting up. When you remove and reinsert the card while running, do you get a message about it being added?

    The other thing I'd look at, if all that seems OK, is to fdisk the card and rebuild the partition table on it. Back up the contents of the card first!

    Code:
    sudo fdisk -l
    to find the device ID for the card, probably /dev/mmcblk01 or similar. Card must be inserted to get this info. Don't have any other cards inserted.

    Code:
    sudo fdisk /dev/mmcblk01
    (or whatever it is -- leave off the partition number, probably p01 -- you want to deal with the block device).
    p prints the list of partitions. I have seen some CRAZY ones on SD cards with all kinds of errors. Same thing with USB sticks. We'll fix all that here.
    d deletes partitions. Do it once for each partition, it will ask what number. You'll know this from the list of partitions.
    w writes the new (blank) partition table. Make sure and remove the card completely.

    Run fdisk again, same way as above.
    p to print a list. Is it empty? Good. Otherwise, go back through the steps above.
    n to add a new partition.
    p for primary.
    1 for 1st partition.
    82 for linux filesystem. (If you want to use the card on Windows PCs as well, make the partition FAT32. (I believe that's b in fdisk).)
    w to write partition table. Remove the card completely and plug it back in.

    Code:
    mkfs -t ext2 /dev/mmcblk01p1
    to make a Linux filesystem. This time we're using the partition number because we want to make a filesystem on that partition.

    To make a fat32 filesystem, you'll need to either do it on windows or install dosfstools and run
    Code:
    mkfs -t vfat /dev/mmcblk01p1
    Hopefully that'll do it.
     
    mattytee, Feb 4, 2009
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.