6

I can't do anything via dd with my Physical devices agreed. I can only work with partitions like disk2s1, but can not read from whole disk like disk2. Can't find where is the root of problem.

Steps:
  1. Check disks: diskutil list
  2. Unmount: diskutil unmountDisk /dev/disk2

Then

$ sudo dd bs=4m if=/dev/disk2 of=~/Desktop/PiOS_full_root.img
dd: /dev/disk2: Permission denied

What causes this problem? why dd sends this error from sudo


there are similar topics around. What've tried, but doesn't works:

and many others. nothing is helps.

  • I check system preferences and gave full disk access to iTerm2 (doesn't help)
  • unmount via diskutil unmountDisk and diskutil unmount
  • Change USB ports (many people said because of the physical lock of sd card.
  • change disk / rdisk naming - result the same
  • Lock\unlock state doesn't affect it (it's microUSB, put without adapter into the microsd slot)

Any suggestions, what to check, and how to fix it?

Here is the log:

log


~ ❯ diskutil list                                                                                                                                                                                 
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         500.0 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +500.0 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD - Data     437.8 GB   disk1s1
   2:                APFS Volume Preboot                 80.6 MB    disk1s2
   3:                APFS Volume Recovery                528.5 MB   disk1s3
   4:                APFS Volume VM                      1.1 GB     disk1s4
   5:                APFS Volume Macintosh HD            11.2 GB    disk1s5

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *15.9 GB    disk2
   1:             Windows_FAT_32 boot                    268.4 MB   disk2s1
   2:                      Linux                         15.7 GB    disk2s2


 ~ ❯ diskutil unmountDisk /dev/disk2                                                                                                                                                               
Unmount of all volumes on disk2 was successful

 ~ ❯ sudo dd bs=1m if=/dev/rdisk2 of=~/Pi_Backup.img
dd: /dev/disk2: Permission denied

 ~ ❯ ls -lhdO /dev/disk2                                                                                                                                                                           
brw-r-----  1 root  operator  -   1,   9 Jul 11 17:39 /dev/disk2


Update: another interesting thing: I chack disk in disk utility -> Get info -it's not writable!

But if I mount boot partition disk2s1 - I can write there!

5
  • 1
    You want to read the disk, missing wrote permissions shouldn’t be an issue
    – nohillside
    Commented Jul 11, 2020 at 11:42
  • agreed. now I can't even read it. only work with partitions like disk2s1, not whole disk disk2
    – skywinder
    Commented Jul 11, 2020 at 12:06
  • Did you reboot already?
    – nohillside
    Commented Jul 11, 2020 at 12:07
  • sure reboot and change all the ports for microsd
    – skywinder
    Commented Jul 11, 2020 at 12:11
  • make sure that disk2 is unmounted Commented Jul 12, 2020 at 14:57

2 Answers 2

5

I realize that exactly the same setup is working on other MacBooks and even with another admin user on this laptop. So no matter, what kind o issue it is: I think it's something related to my personal setup and setting, not to the system in general. So I will close this question for now.

If someone get the same problem: try to do the same steps as I described above or in the end: change the machine or user on your one if there is a chance to do this.

  1. make sure that diskX is unmounted via diskutil unmountDisk and diskutil unmount
  2. Change USB ports
  3. if it's SD card: blow with air into the slot (many people said because of the physical lock sensor of sd card.
  4. make sure, that you work via sudo. (just in case, you can check it via which sudo command)
5
  • This is the second time the Internet has provided me the same solution: blowing into the SD slot like we used to do with video game cartridges. To anybody finding the suggestion incredulous: How much more time would you like to lose because the solution is too silly? Commented Mar 22, 2021 at 0:21
  • 1
    Silly, I know, but it just worked for me! Had a SD card that was showing up as read-only. I removed the card, blew on the card contacts, blew into the SD card slot on the Mac (this is an older Mac with a built-in SD card slot, that hadn't been used in a while). It worked! Tried the SD card again, and it is now letting me write to it.
    – Krellan
    Commented Nov 24, 2021 at 11:50
  • I just had a similar argument with the SD card slot in an older MBP. I did have to clear the dust out of the slot, but the thing that fixed the "Permission denied" was taking out the SD card adapter (the "fake" SD card that lets me use a microSD card in the slot), and sliding the tiny "lock" switch on it back and forth a few times, then setting back to unlocked - put it in again, and suddenly I could write to the (microSD) card.
    – CarlRJ
    Commented Jan 26, 2022 at 9:12
  • @Krellan same her - I just had to move the write protection switch in the microSD adaptor Commented Aug 12, 2022 at 14:13
  • While this answer is essentially "Did you try turning it off and then back on" equivalent advice, it is correct. Graphically un-mounting or using "mount" isn't good enough. Even though you won't see the device in /dev, re-mount it, then remove it with diskutil. That worked for me.
    – mreff555
    Commented Aug 27, 2023 at 21:37
1

Answer: OP steps are correct. If you follow all the earlier caveats, the problem is (likely) due to the hardware you are using.

I had the same "permission denied" problem and tried all the earlier suggestions with no improvement. I was using the built-in MicroCard port of a UGreen brand thunderbolt port expander (MBP2019-Intel, plus an older Intel-based machine plugging it into a USB port using a converter). Also tried several Linux VMs, in Parallels and VirtualBox, on the same machines. The thunderbolt port expander does correctly read/write ordinary files on MicroSD cards.

Then I tried plugging an older UGreen USB-based card reader into the UGreen thunderbolt gizmo. That worked on the MBP; it's blazingly slow.

I've previously been disappointed with other UGreen devices, but all the low-end options look like they use the same boards with different casings for branding. They all get crappy ratings. (Hint: don't use the charging port if you can avoid it.) I'm not convinced the more expensive ones would be any better, but maybe I'm too pessimistic.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .