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

Re: Using dd to backup a PI SD

Thu Dec 01, 2016 4:20 pm

kalehrl wrote:Something like this:
Then:

Code: Select all

sudo dd bs=4M if=/dev/sdb | gzip > /home/your_username/image`date +%d%m%y`.gz
What does bs=4M mean?

User avatar
DougieLawson
Posts: 40227
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Using dd to backup a PI SD

Thu Dec 01, 2016 4:44 pm

It means read a 4MB (4,194,304byte) block on every read, so that reduces the number of I/O operations that need to be completed to copy the card.

I normally look at how much free memory I've got on the machine and allocate 90% of it to a dd copy (that can be anything up to 200M).
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

User avatar
B.Goode
Posts: 10725
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Using dd to backup a PI SD

Thu Dec 01, 2016 4:50 pm

If @Dougie had not been around to answer your query promptly you could have got the information from a site like this: https://linux.die.net/man/1/dd

Or by typing

Code: Select all

man dd
at the shell (command line) prompt of any Linux system.

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

Re: Using dd to backup a PI SD

Thu Dec 01, 2016 9:07 pm

Further to the above replies, SD cards often work in "pages" of memory of 4MB. Writing data in that size blocks may lead to better write performance and less wear on the card. Writing to smaller blocks can mean that the card has to read the 4MB page into an internal buffer, erase the original page, and write it back out again with the changes. Then it has to do rewrite the same page with the next bit that has changed.

It cant just erase and re-write part of a page, it has to be the whole thing. (It may cache the changes for a period of time or until it has a whole page of writes stored. Flash storage controllers are much smarter than they used to be).

jogl
Posts: 93
Joined: Sun Mar 13, 2016 12:02 pm
Location: SW Ontario Canada

Re: Using dd to backup a PI SD

Sun Jan 08, 2017 8:12 pm

For what it is worth, I followed kalehrl's original instructions and was able to make a working clone (so far, time will tell).

Old Gateway desktop (AMD processor) running Jessie with XFCE desktop).

EricK-NL
Posts: 1
Joined: Tue Mar 28, 2017 7:55 pm

Re: Using dd to backup a PI SD

Fri May 12, 2017 8:34 am

Is it possible to install SD-Card-Copier in Jessie-lite?
I don't need all the features of the full Rabian
so wanted to add this handy feature but cant find any links...

Eric

fruitoftheloom
Posts: 24553
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Using dd to backup a PI SD

Fri May 12, 2017 8:49 am

EricK-NL wrote:Is it possible to install SD-Card-Copier in Jessie-lite?
I don't need all the features of the full Rabian
so wanted to add this handy feature but cant find any links...

Eric
Pi-Clone SD Card Copier is a GUI Program, maybe take a look at RPi-Clone instead ??

https://github.com/billw2/rpi-clone
Thinking outside the box is better than burying your head in the sand...

Return to “Beginners”