PDA

View Full Version : dd sd card issue




skippymac
Mar 4, 2013, 04:00 PM
I didn't know where to post this so I thought I'd put it here, please move it if it's in the wrong place!

I'm trying to install a raspbmc image on an 8GB sd card for my raspberry pi. I put it in my MBP sd card slot and do the following:

diskutil unmount /dev/disk4s1
dd bs=1m if=~/Downloads/installer.img of=/dev/rdisk4

and every single time I get this error:

dd: /dev/rdisk4: Permission denied

I tried this with a USB drive and it worked just fine. I have tried it with the sd switch in both locked and unlocked positions and have even tried blowing in the sd slot as per this page. (http://groovecoder.com/2012/11/25/mac-raspberry-pi-dd-permission-denied/)

Is my sd card slot well and truly screwed or is this another problem? Do I just need to blow harder?! :rolleyes:



ElectricSheep
Mar 4, 2013, 05:55 PM
Uh, even though it seems like a totally obvious thing...

...are you executing these commands with superuser privileges?

skippymac
Mar 4, 2013, 06:29 PM
Uh, even though it seems like a totally obvious thing...

...are you executing these commands with superuser privileges?

tried both with and without sudo and same thing happened both times :(

Nermal
Mar 4, 2013, 07:16 PM
You definitely need sudo. Where did you get "rdisk4" from? Did you look it up through System Profiler (good) or just copy it from a tutorial (bad)?

skippymac
Mar 5, 2013, 04:17 AM
You definitely need sudo. Where did you get "rdisk4" from? Did you look it up through System Profiler (good) or just copy it from a tutorial (bad)?

used df -h to find the sd card

chown33
Mar 5, 2013, 10:05 AM
tried both with and without sudo and same thing happened both times :(

Post the complete command, and the exact error message.

It seems unlikely that a correct use with 'sudo' could result in a Permission denied error.


The raspbmc website also shows a Python-based install process. What happens if you use that?

Nermal
Mar 5, 2013, 12:42 PM
used df -h to find the sd card

Edit: This is not good advice; see below.

While df probably does something similar, when I've looked it up using System Profiler then I get disk1, not rdisk1 (and this works in dd). Try disk4 instead of rdisk4 and see what happens.

robvas
Mar 5, 2013, 12:53 PM
Is there a write-protect switch on the SD card?

http://i.imgur.com/raZ53K3.gif

While df probably does something similar, when I've looked it up using System Profiler then I get disk1, not rdisk1 (and this works in dd). Try disk4 instead of rdisk4 and see what happens.

The command you should use is actually:

sudo diskutil list

However, you want to use /dev/rdisk4 and not just /dev/disk4 - Writing to a 'raw' device with dd (in the case of an SD card) is much, much faster. link (http://raspberrypi.stackexchange.com/a/4059/3880)

Nermal
Mar 5, 2013, 02:35 PM
However, you want to use /dev/rdisk4 and not just /dev/disk4 - Writing to a 'raw' device with dd (in the case of an SD card) is much, much faster. link (http://raspberrypi.stackexchange.com/a/4059/3880)

Thanks for that, it's good to know. I wondered why it took so long to write!

skippymac
Mar 5, 2013, 03:17 PM
Post the complete command, and the exact error message.

It seems unlikely that a correct use with 'sudo' could result in a Permission denied error.


The raspbmc website also shows a Python-based install process. What happens if you use that?

Same thing with the install.py it gives the same error. Here's an example of what commands I've been using (It's disk 3 now)
diskutil unmount /dev/disk3s1
Volume UNTITLED on disk3s1 unmounted

dd bs=1m if=~/Downloads/installer.img of=/dev/rdisk3
dd: /dev/rdisk3: Permission denied

sudo dd bs=1m if=~/Downloads/installer.img of=/dev/rdisk3
dd: /dev/rdisk3: Permission denied

Is there a write-protect switch on the SD card?

Yes, and I've tried it multiple times in both positions. Im beginning to think the write protection switch in my sd card reader is knackered :(

robvas
Mar 5, 2013, 03:52 PM
Thanks for that, it's good to know. I wondered why it took so long to write!

Imagine what I thought when I went out and bought faster, more expensive SD cards and it still took forever to write an image.

chown33
Mar 5, 2013, 04:28 PM
Yes, and I've tried it multiple times in both positions. Im beginning to think the write protection switch in my sd card reader is knackered :(

ls -l /dev/*disk*

Is the device writable or not?

ElectricSheep
Mar 5, 2013, 05:07 PM
Yes, and I've tried it multiple times in both positions. Im beginning to think the write protection switch in my sd card reader is knackered :(

Can you use the SD card normally (Format it with Disk Utility, copy files to it with the Finder, etc)? If not, then yeah, its probably the card.

skippymac
Mar 6, 2013, 02:42 AM
I can't write any files to any sd cards so it looks like my reader has given up the ghost :(

juancn
Jun 10, 2013, 01:16 PM
I had the exact same problem, I managed to get it to work by unmounting just the fat partition of the SD card, but not the whole SD from Disk Utility (I selected 'NO NAME' rather than 'Apple SDXC reader media').

I also made rdisk3 writable, but I'm not sure if this helped at all.

Hope it helps others.

mrfusi0n
Feb 28, 2014, 11:24 AM
I was having the exact same problem (getting a permission denied error to the device even when using sudo). I figured maybe it was an issue with sudo not giving me full root access so I first ran:

sudo su

Then entered my password and retried the dd command (without "sudo" since I'm not using the root user).
It worked!!!
Hope this helps someone...