I was installing RedSleeve onto my new Raspberry PI and needed to fix a problem when writing the image onto the SD card. I kept getting “Permission denied” error messages, when issuing the command to write the image.
Am I using sudo? Yes I am.
Is the disk unmount before trying to write to it? Yes it is.
Ok everything seems to be in order. Let’s check my command
Ah, Ha!! sudo is not being applied to the part of the command after the pipe.
Ok, how to solve this. We can use the “-c” switch on the bash command to apply sudo to the entire command string.
Now my SD is being written to.