How do I mount an SD card?

567,808

Solution 1

I have the same laptop, the slot does work on Ubuntu 12.04, but the OS doesn't seem to find the card when it is inserted. It appears you have 2 options in the short term:

  1. Reboot with the SDcard in the slot.

  2. Do a PCI re-scan

    echo 1 | sudo tee /sys/bus/pci/rescan
    

The bug with the workaround is listed here.

Solution 2

There are a few things you can do to make sure everything is working as expected.

1) Verify that Ubuntu knows about your SD card slot and what to do with it
2) Verify that Ubuntu knows you inserted something
3) Verify that Ubuntu understands the filesystem on the thing you inserted.

1) Check the outputs of the commands sudo lspci -v -nn, sudo lsusb, and sudo lshw on the command line. Here is a good guide for understanding lshw which lists an example SD Card reader.

2) Then run the following command before inserting the SD card and a few seconds after inserting it: ls -la /dev/sd*. This command lists all of the hard drives, CDs, DVDs, floppies, SD cards, etc that Ubuntu knows about. (These are called Block Devices).

Ideally you will see a few entries on the second run that you don't see on the first. For example:

$ls -la /dev/sd*
brw-rw---- 1 root disk 8,  0 2012-01-14 11:27 /dev/sda
brw-rw---- 1 root disk 8, 16 2012-01-14 11:27 /dev/sdb
brw-rw---- 1 root disk 8, 32 2012-01-14 11:27 /dev/sdc
brw-rw---- 1 root disk 8, 33 2012-01-14 11:27 /dev/sdc1
brw-rw---- 1 root disk 8, 34 2012-01-14 11:27 /dev/sdc2
brw-rw---- 1 root disk 8, 35 2012-01-14 11:27 /dev/sdc3
brw-rw---- 1 root disk 8, 36 2012-01-14 11:27 /dev/sdc4
brw-rw---- 1 root disk 8, 37 2012-01-14 11:27 /dev/sdc5

(Now insert the SD card)

$ls -la /dev/sd*
brw-rw---- 1 root disk 8,  0 2012-01-14 11:27 /dev/sda
brw-rw---- 1 root disk 8, 16 2012-01-14 11:27 /dev/sdb
brw-rw---- 1 root disk 8, 32 2012-01-14 11:27 /dev/sdc
brw-rw---- 1 root disk 8, 33 2012-01-14 11:27 /dev/sdc1
brw-rw---- 1 root disk 8, 34 2012-01-14 11:27 /dev/sdc2
brw-rw---- 1 root disk 8, 35 2012-01-14 11:27 /dev/sdc3
brw-rw---- 1 root disk 8, 36 2012-01-14 11:27 /dev/sdc4
brw-rw---- 1 root disk 8, 37 2012-01-14 11:27 /dev/sdc5
brw-rw---- 1 root disk 8, 64 2012-01-14 11:28 /dev/sdd

See that extra one at the end /dev/sdd that is the SD card.

3) Check that Ubuntu understands the filesystem on the drive. I would bet it is either Fat32 or NTFS. You can check if your copy of Ubuntu understands those filesystems (it should) by running this command: cat /proc/filesystems. In this list vfat is Fat32 and (for all intents and purposes) fuse is NTFS. **Note: this list is not extensive.

A better way is to simply try to mount the SD card manually. Run the following commands in order until one works (replace the X in /dev/sdX1 with the letter from step 2):

sudo mount /dev/sdX1 /mnt
sudo mount -t vfat /dev/sdX1 /mnt
sudo mount -t ntfs /dev/sdX1 /mnt
sudo mount -t msdos /dev/sdX1 /mnt

No output means it worked, and you should be able to navigate to your SD card with nautilus at /mnt. If none of them worked, try plugging your SD card into a windows machine and running chkdsk on it, or verify the filesystem type.

Solution 3

This seems to work better for me:

sudo fdisk -l (it's a lower case L)

This shows all the /dev/sdX names and blocks and more information about the capacity/space of the "disks".

Then, I just use the command:

sudo mkdir /media/sdcard/ (create a directory for the SD card to be mounted to)

(command mount) (location name /dev/sdd1/) (mounted to created folder) sudo mount /dev/sdd1/ /media/sdcard/

You can mount it to just media if you want, and then here is the umount command for unmounting:

sudo umount /dev/sdd1/

Then, you can remove the directory with sudo rmdir /sdcard.

Solution 4

After more than a year, I found a permanent solution described in Read Your SD card with your Ubuntu laptop.

Quoting from the cited page:

«Do the following things.

  1. Backup the file /etc/modules

    sudo cp /etc/modules /etc/modules.bak

  2. Add one line to /etc/modules

    gksu gedit /etc/modules or sudo vi /etc/modules

3.Tag this on to the end of the file in a new line:

tifm_sd

When you restart, you’re card reader will be functional. You’ll see that when you slap an SD card into the reader, it will automount.

But wait, don’t want to have to restart your machine? Go back to the terminal you impatient person and type:

sudo modprobe tifm_sd

That's all. After a restart, my laptop recognized the inserted SD card and opened the SD card in Nautilus.»

Solution 5

OK, based on your very detailed hardware information (thanks!), it doesn't look like the system is seeing the card reader; as in, it's not attached to either the PCI or the USB buses. It's as if it doesn't exist.

Do you know for certain that the card reader works? it might have a loose connection (check the cables from the reader to the motherboard). Also, check that it's not disabled in the BIOS/Setup.

Share:
567,808

Related videos on Youtube

lofidevops
Author by

lofidevops

Updated on September 18, 2022

Comments

  • lofidevops
    lofidevops over 1 year

    My computer has an SD card slot. When I put a working SD card into the slot, nothing happens. When I put a CD or DVD in, or plug in a USB drive, the medium is mounted and available. Is there something special I need to do for SD cards?

    Hardware specifics

    I am running 11.10 on a Dell XPS L502X. The card slot is marked "SDXC/MMC - MS/Pro" (which Wikipedia tells me are various SD card types).

    • Admin
      Admin over 12 years
      Normally you don't need to do anything special. Could you update the question to include the version of Ubuntu you're using? Also, you can open a terminal (ctrl-alt-t), type "tail -f /var/log/syslog", insert an SD card, and see what messages pop up. If you don't know what they mean you could paste the lines that appear when you insert the SD card in your question too. All this info is helpful to see what may be wrong with your card reader.
    • Admin
      Admin over 12 years
      @roadmr I was going to post the results from syslog along with Huckle's suggestions, but when I plugged the SD card in... nothing happened! I may be missing something, but based on the output from the commands below, I think it doesn't even know the slot is there
    • Admin
      Admin over 12 years
      Could you please update the question with your computer's make/model, version of Ubuntu, as well as the output of running "sudo lspci -nn". We can then check if your card reader is supported by your Ubuntu version.
    • Admin
      Admin over 12 years
      @roadmr updated, and included the briefer lspci output in gist.github.com/77efea8cb1e4ca6eae1a
    • Admin
      Admin over 12 years
      thanks, I don't see the card reader in lspci output, so maybe it's connected to the USB bus, could you post output of lsusb? then again, it's rare for USB card readers to not work at all..
    • Admin
      Admin over 12 years
      @roadmr thanks, lsusb is on the gist page (under the verbose lspci)
    • Admin
      Admin about 4 years
      I tried most of the answers below and then realised my SD card was under /mnt/
  • lofidevops
    lofidevops over 12 years
    thanks for such a detailed answer, unfortunately I haven't been able to get past step 2 (and I cheated to go that far I think ;) - I can't see anything SD-card-like in gist.github.com/77efea8cb1e4ca6eae1a - let me know if you expand your answer or if this begs a new question "where is my sd card?!!111!"
  • Huckle
    Huckle over 12 years
    Can you verify that it works in another operating system (such as windows)?
  • lofidevops
    lofidevops over 12 years
    unfortunately I can't, windows machine doesn't have an SD slot, but I'll see if I can get another card - would it be worth it (and not harmful) to try this even though the symptoms are different? askubuntu.com/questions/78881/…
  • lofidevops
    lofidevops over 12 years
    also added filesystems output to gist link - fuse is present but vfat isn't
  • Huckle
    Huckle over 12 years
    /proc/filesystems wont list all available filesystems, but it is a quick method of getting the common ones and is easier than looking through the man page for mount. However I think your problem exists in the hardware. Do you have any experience with Virtual Machines? Running windows in a VM might offer some insight.
  • Josiah
    Josiah about 12 years
    I have this same issue and I can confirm that the SD card works in windows.
  • BlitZz
    BlitZz about 12 years
    Josiah: do you have the very same make and model of computer? if not, then it's most likely not the same issue.
  • Josiah
    Josiah about 12 years
    yup save make and model + I'm using the same ubuntu version. I found that the SD card is recognised as long as it has been inserted before the computer boots up
  • Eliah Kagan
    Eliah Kagan almost 12 years
    You can equally easily add a volume label in Ubuntu with Disk Utility or GParted Partition Editor.
  • user67782
    user67782 almost 12 years
    Only if you can mount it first.
  • Eliah Kagan
    Eliah Kagan almost 12 years
    No, GParted will definitely change the volume label of an unmounted partition. I just double-checked to be sure. See this screenshot. (Plus, I've done it many, many times.)
  • user67782
    user67782 almost 12 years
    Good solution using Ubuntu only. Thanks @d3vid for the question.
  • PasanW
    PasanW about 11 years
    Hi. I'm having the same problem. When I type sudo mount -t ntfs /dev/sdc /mnt I get the following error message. "Error reading bootsector: Input/output error Failed to mount '/dev/sdc': Input/output error NTFS is either inconsistent, or there is a hardware fault, or it's a SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows then reboot into Windows twice. The usage of the /f parameter is very important! If the device is a SoftRAID/FakeRAID then first activate ... Please see the 'dmraid' documentation for more details. "
  • Huckle
    Huckle about 11 years
    Do you need the contents of the SD Card, if not I'd suggest testing a filesystem that is native to linux. If it still doesn't work, then there's a hardware issue. If it works, the filesystem was bad.
  • Espressofa
    Espressofa about 11 years
    This worked for me, too. Except mine was named /dev/mmcblk0p1 for some reason.
  • edwin
    edwin almost 10 years
    In the second option, the redirection (>) should have been a pipe (|). Edited.
  • Planky
    Planky over 9 years
    Tried this. Didn't work for me on Ubuntu 12.04
  • iMitwe
    iMitwe over 8 years
    Additionally, I had to put a bit of water ( well, saliva in fact) on the SD card slot reader for the system to recognize it, and then I had /dev/mmcblk0p1. I hope I helped.
  • fccoelho
    fccoelho over 7 years
    Worked for me. Just modprobed it and voilà!
  • Slashback
    Slashback over 6 years
    +1 Did the trick on HP EliteBook 8740w Debian Jessie.
  • LRDPRDX
    LRDPRDX over 6 years
    What should I do after the second point? BTW, I have 1 as an output.