Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 4, 2013, 05:00 PM   #1
skippymac
macrumors 6502a
 
skippymac's Avatar
 
Join Date: Jun 2010
Location: Hampshire, UK
dd sd card issue

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:

Code:
diskutil unmount /dev/disk4s1
dd bs=1m if=~/Downloads/installer.img of=/dev/rdisk4
and every single time I get this error:

Code:
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.

Is my sd card slot well and truly screwed or is this another problem? Do I just need to blow harder?!
__________________
13" 2.4GHz 2010 MBP, 8GB RAM, 1TB HDD/128GB SSD
i5-3350p, GTX770 PC | Sony Xperia Z1 | Nexus 7 2012
skippymac is offline   0 Reply With Quote
Old Mar 4, 2013, 06:55 PM   #2
ElectricSheep
macrumors 6502
 
Join Date: Feb 2004
Location: Wilmington, DE
Send a message via AIM to ElectricSheep
Uh, even though it seems like a totally obvious thing...

...are you executing these commands with superuser privileges?
__________________
15'' MBP (early 2011) | i7 3770k Hackintosh | i7 Mac Mini (late 2012) | iPhone 5 | iPad 3 (2012) | iPad mini | MacOS X 10.9.2
ElectricSheep is offline   0 Reply With Quote
Old Mar 4, 2013, 07:29 PM   #3
skippymac
Thread Starter
macrumors 6502a
 
skippymac's Avatar
 
Join Date: Jun 2010
Location: Hampshire, UK
Quote:
Originally Posted by ElectricSheep View Post
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
__________________
13" 2.4GHz 2010 MBP, 8GB RAM, 1TB HDD/128GB SSD
i5-3350p, GTX770 PC | Sony Xperia Z1 | Nexus 7 2012
skippymac is offline   0 Reply With Quote
Old Mar 4, 2013, 08:16 PM   #4
Nermal
Moderator
 
Nermal's Avatar
 
Join Date: Dec 2002
Location: Whakatane, New Zealand
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)?
Nermal is offline   0 Reply With Quote
Old Mar 5, 2013, 05:17 AM   #5
skippymac
Thread Starter
macrumors 6502a
 
skippymac's Avatar
 
Join Date: Jun 2010
Location: Hampshire, UK
Quote:
Originally Posted by Nermal View Post
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
__________________
13" 2.4GHz 2010 MBP, 8GB RAM, 1TB HDD/128GB SSD
i5-3350p, GTX770 PC | Sony Xperia Z1 | Nexus 7 2012
skippymac is offline   0 Reply With Quote
Old Mar 5, 2013, 11:05 AM   #6
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by skippymac View Post
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?
chown33 is offline   0 Reply With Quote
Old Mar 5, 2013, 01:42 PM   #7
Nermal
Moderator
 
Nermal's Avatar
 
Join Date: Dec 2002
Location: Whakatane, New Zealand
Quote:
Originally Posted by skippymac View Post
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.

Last edited by Nermal; Mar 5, 2013 at 03:36 PM.
Nermal is offline   0 Reply With Quote
Old Mar 5, 2013, 01:53 PM   #8
robvas
macrumors 68000
 
Join Date: Mar 2009
Location: USA
Is there a write-protect switch on the SD card?



Quote:
Originally Posted by Nermal View Post
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
robvas is offline   0 Reply With Quote
Old Mar 5, 2013, 03:35 PM   #9
Nermal
Moderator
 
Nermal's Avatar
 
Join Date: Dec 2002
Location: Whakatane, New Zealand
Quote:
Originally Posted by robvas View Post
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
Thanks for that, it's good to know. I wondered why it took so long to write!
Nermal is offline   0 Reply With Quote
Old Mar 5, 2013, 04:17 PM   #10
skippymac
Thread Starter
macrumors 6502a
 
skippymac's Avatar
 
Join Date: Jun 2010
Location: Hampshire, UK
Quote:
Originally Posted by chown33 View Post
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)
Code:
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
Quote:
Originally Posted by robvas View Post
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
__________________
13" 2.4GHz 2010 MBP, 8GB RAM, 1TB HDD/128GB SSD
i5-3350p, GTX770 PC | Sony Xperia Z1 | Nexus 7 2012
skippymac is offline   0 Reply With Quote
Old Mar 5, 2013, 04:52 PM   #11
robvas
macrumors 68000
 
Join Date: Mar 2009
Location: USA
Quote:
Originally Posted by Nermal View Post
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.
robvas is offline   0 Reply With Quote
Old Mar 5, 2013, 05:28 PM   #12
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by skippymac View Post
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
Code:
ls -l /dev/*disk*
Is the device writable or not?
chown33 is offline   0 Reply With Quote
Old Mar 5, 2013, 06:07 PM   #13
ElectricSheep
macrumors 6502
 
Join Date: Feb 2004
Location: Wilmington, DE
Send a message via AIM to ElectricSheep
Quote:
Originally Posted by skippymac View Post
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.
__________________
15'' MBP (early 2011) | i7 3770k Hackintosh | i7 Mac Mini (late 2012) | iPhone 5 | iPad 3 (2012) | iPad mini | MacOS X 10.9.2
ElectricSheep is offline   0 Reply With Quote
Old Mar 6, 2013, 03:42 AM   #14
skippymac
Thread Starter
macrumors 6502a
 
skippymac's Avatar
 
Join Date: Jun 2010
Location: Hampshire, UK
I can't write any files to any sd cards so it looks like my reader has given up the ghost
__________________
13" 2.4GHz 2010 MBP, 8GB RAM, 1TB HDD/128GB SSD
i5-3350p, GTX770 PC | Sony Xperia Z1 | Nexus 7 2012
skippymac is offline   0 Reply With Quote
Old Jun 10, 2013, 02:16 PM   #15
juancn
macrumors newbie
 
Join Date: Jun 2013
Found a fix

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.
juancn is offline   0 Reply With Quote
Old Feb 28, 2014, 12:24 PM   #16
mrfusi0n
macrumors newbie
 
Join Date: Feb 2014
Another solution

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...
mrfusi0n is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Debit Card Issue LadyX Community Discussion 30 Feb 7, 2014 02:45 AM
Graphics Card/Driver Issue MinEderPlayz iMac 0 Sep 10, 2013 10:17 AM
Graphics Card Issue? DKRises iMac 1 Mar 5, 2013 02:40 AM
Possible graphics card issue? Ice Dragon Mac mini 1 Feb 7, 2013 06:28 AM
Sd card speed issue?? ivnj Mac mini 0 Aug 15, 2012 11:45 PM

Forum Jump

All times are GMT -5. The time now is 01:57 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC