corkscrew2094
Posts: 4
Joined: Mon May 25, 2015 10:41 am

restore image to sd card

Thu Jul 23, 2015 3:17 am

Hi
I have been backing up my pi regularly by removing the sd card and creating an image of it on my main pc running Linux Mint 17, using the following command

Code: Select all

sudo dcfldd if=/dev/sdb | gzip > /media/cem/data/iso/pi/8gpi04-1.gz
This command works perfectly and creates the images, however when I try to restore on of the image's with

Code: Select all

sudo gzip -dc /media/cem/data/iso/pi/8gbi04 | dd of=/dev/sdb
I get the following error
dd: failed to open ‘/dev/sdb’: Permission denied
I have been following the instructions from http://www.libregeek.org/2014/03/15/bac ... pberry-pi/

What am I doing wrong?

drgeoff
Posts: 11247
Joined: Wed Jan 25, 2012 6:39 pm

Re: restore image to sd card

Thu Jul 23, 2015 7:25 am

Try doing the gzip and the dd operations separately. sudo for the dd command.
Quis custodiet ipsos custodes?

User avatar
rpdom
Posts: 17736
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: restore image to sd card

Thu Jul 23, 2015 8:09 am

or try

Code: Select all

gzip -dc /media/cem/data/iso/pi/8gbi04 | sudo dd of=/dev/sdb
You might also need sudo for the gzip (I don't know Mint, doesn't it have gunzip or zcat?), depending on the read permissions on the file.

corkscrew2094
Posts: 4
Joined: Mon May 25, 2015 10:41 am

Re: restore image to sd card

Thu Jul 23, 2015 10:15 am

Brilliant!! just needed to move the sudo part to in front of dd

User avatar
IgorGanapolsky
Posts: 33
Joined: Sun Apr 10, 2016 8:32 pm

Re: restore image to sd card

Mon Dec 05, 2016 2:36 pm

rpdom wrote:or try

Code: Select all

gzip -dc /media/cem/data/iso/pi/8gbi04 | sudo dd of=/dev/sdb
You might also need sudo for the gzip (I don't know Mint, doesn't it have gunzip or zcat?), depending on the read permissions on the file.
Awesome answer. It is easy to miss the omitted `sudo` in the dd part after the pipe.

Return to “Troubleshooting”