Posts tagged ‘flash card’

Mounting the SDHC flash card

I bought a camera a few days ago. Eagerly wanting to import the images from the SDHC flash card I use with the camera I noticed my laptop came equiped with a flash card reader. It felt a little bit nostalgic as I inserted the flash card in the slot, reminding me to the days of floppies but better, instead of the always magneticly recorded data on the mechanical floppies. Which always seemed to loose data no matter how gentle you treated the disk. I have never had a flash card break.

I have no software to automatically mount newly detected storage media. So it was up to me to somehow figure out what file in /dev the device would be represented by. As I asked for advice on how to do this on the Archlinux IRC channel I got two very nice tips:

First by reading the messages from the message buffer of the kernel right after I inserted the card in the flash reader, using:

$ dmesg | tail

which yielded on the last lines of the buffer the messages,

mmc0: new high speed SDHC card at address bddc
mmcblk0: mmc0:bddc SD04G 3.69 GiB
 mmcblk0: p1

I could get the necessary information of what the kernel was doing. As one can see all was fine, I was a little bit worried because the text printed above the flash reader only says, “SD/MMC – MS/Pro”, so I was not sure it would support the SDHC standard. While the messages from dmesg is very human readable it only hints at what file you should mount in order to access the flash card. A quick search on the interent shows that for some people the file was named mmc0 but that file did not exists on my system so to find out the full name of the file, I used:

$ ls /dev -l | grep brw

which yielded,

brw-rw---- 1 root disk      7,   0 Jul  9 02:55 loop0
brw-rw---- 1 root disk    179,   0 Jul  9 04:53 mmcblk0
brw-rw---- 1 root disk    179,   1 Jul  9 04:53 mmcblk0p1
brw-rw---- 1 root disk      8,   0 Jul  9 02:55 sda
brw-rw---- 1 root disk      8,   1 Jul  9 02:55 sda1
brw-rw---- 1 root disk      8,   2 Jul  9 02:55 sda2
brw-rw---- 1 root disk      8,   3 Jul  9 02:55 sda3
brw-rw---- 1 root disk      8,   4 Jul  9 02:55 sda4
brw-rw---- 1 root optical  11,   0 Jul  9 02:55 sr0

Then simply mounting the file mmcblk0p1 at the location of my choice gave me access to the flash card.