Wednesday, October 9, 2013

Mount my SD Card in Ubuntu 12.04

I had several problems mounting my SD Card in Ubuntu.  From NOTHING happening (my worst case of issue ... How can some-one troubleshoot with NO, ZERO messages etc ... to the partitions being mounted but readonly ... So I could never install Raspbmc (or any distro for that matter) onto my  Raspberry Pi 
Until I came across a post on Ask Ubuntu which pointed me in the right direction.
Turned out to be a permissions issue. 
First thing to do is to check the permissions on the hardware device mounting your card. You'll need to find the device name. To do this run the following command:
sudo fdisk -l
Your device will probably be something along the lines of /dev/sdb1, in my case the SD Reader was /dev/mmcblk0p1.
Next you need to get the permissions on this device:
sudo ls -l /dev/mmcblk0p1
Replace "/dev/mmcblk0p1" with your device location. The output will look something like this:
brw-rw---- 1 root disk 179, 1 Feb 3 21:58 /dev/mmcblk0p1
This tells us the device is owned by User 'root' and group 'disk' You need to be a member of group 'disk' to be able to write to the SD card. You can check which groups your a member of with
groups username
In my case I was not a member of the 'disk' group, I rectified this with
sudo usermod -g disk username
This adds you to the group 'disk' which should allow you to now read & write to the SD card
The BIG thing for me was adding my user to the Group 'disk' which sorted everything out.  Thanks to Cage for pointing this out.
Hope this helps.
73