TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: JAN PANTELTJE
from: HENRI DERKSEN
date: 2019-01-13 02:39:00
subject: [Deutsch] Wie 16GB SD-Kar

Hello Jan,

JP>>> 1) make a backup of your 16 GB SDcard, NOT on the raspi,

HD>> Why no Pi ?

You did not anwer this simply question.

JP>>> but on a Linux PC:
JP>>> dd if=/dev/X of=cardimage.iso

HD>> You forget two important things, i.e. the block size and the Sync !
HD>> So the two commands should be at least:
HD>>
HD>> sudo dd if=/sda of=/dev/sdb bs=1M conv=noerr,sync [RETURN]
HD>> sudo sync                                         [RETURN]

JP> Not in my uexperience.

At 5 th of august 2018 you wrote something different here:

***** Citation:
JP>>>> The other problem you then have is that you cannot run a verify.
JP>>>> diff myimage /dev/sd?

HD>>> Until now I never did.
HD>>> I just tried if the copy works well.
HD>>> But indeed shut down the source card, and making a backup of it when
HD>>> it not runs is the best procedure.

HD>> A friend of my at the Dutch RISC OS Big Ben Computer club in Drachten.NL,
HD>> and lives in Groningen.NL,
HD>> told me in october 2016 to use the following syntax:
HD>> sudo dd if=jessie.img of=/dev/sda bs=4M
HD>> And he said that it is very important to use:
HD>> sync
HD>> after the copy with the dd command has finished.
HD>> That "sync" writes the last bytes from the buffer to the destination
HD>> SDcard.
HD>> After that you can verify its contents if the copy did succeed properly.

JP> Yes, I have the old Unix habit of typing 'sync' 3 times every now and
JP> then.

JP> An other thing I notice with my USB sticks is that even after copy and
JP> sync the LED on the USB stick keeps flashing,
JP> sometimes for up to a minute or so.
JP> I once asked in a Linux group if it was safe to remove the USB stick
JP> when that LED was still flashing
JP> and was told that was OK...
JP> Nevertheless I always wait until it is off.
JP> For SDcards it is hard to tell, no LED, but I think the internal
JP> controller on the cards / sticks does some housekeeping
JP> even after the copy has finished.
JP> So maybe it is better to leave it in for a minute or so longer.
***** Eind of citation.

So you know very well how important it is to work safely,
as you type "sync" 3 times, and wait minutes after copying ;-).
In that case give the right syntax to newbe's please.
And donot "attack" me for important safety parameters, such as sync.

Note; we are now on Raspbian Stretch in stead of Jessie or Wheezy

JP> I _do_ use dvdimagecmp to test if the image is the same as the card:
JP> http://panteltje.com/panteltje/dvd/dvdimagecmp-0.3.tgz

Sorry but I do not use a CDVD-drive at my Pi's.

JP> dvdimagecmp -a /dev/sdb -b the_image_i_made

That is not a standard command available at Pi Linux versions I think.
But thanks for availability via your site.

JP> will report errors and progress,
JP> better than 'diff'.

Why better?, please define that with reasons, motivation etc..
Better without reason is not a good argument.

JP> So far never seen an error with
JP> dd if=/dev/whatever of=my_new_perfect_image
JP> :-)

Dream on.
But, are you very sure about the term: "whatever" after the /dev ?
I still did not could restore a backup I did earlier made to
/dev/null or /dev/zero.
Can you proof that:
sudo dd=if/dev/null of=my_new_perfect-restoration.img bs=1M
gives a very good and working restore of your previous backup?,
works great he? ;-).
You only get an emty file, just tested.
Or the destination SDcard is still emty.
Af Deutch: /dev/null ist: ins blaue hinein, or bitbucket.

JP> Always use card write to hardidsk, and then hardisk to 
JP> cards

Why "allways" via a harddisk ?
Please give reasons/motivs.
What's wrong whith copying from a source card to a destination card directly
using two card-reader/writers?

JP> I do not delete the hardidsk image either:
JP> panteltje12: /mnt/sda1/encode_ts # l 1/*
JP> -rw-r--r-- 1 root root 8048869376 Dec  8 14:02 1/1.img

JP> 'l' (l as in logic, not '1') is bash alias for 'ls -rtl' to save typing.
JP> And if you really want to save typing and use terminals a lot use zsh as
JP> shell.

ok.

JP> Anyways that is my old 8 GB raspi router image that is now on a 16 GB
JP> card.
JP> the '1' refers to the last part of the IP address (fixed), cool way to
JP> number cards.

Using the IP-adres, even if fixed, is not a good idea.
When installing a new router, the complete list of IP adresses are changed,
or you have reprogram that again.
Or in future only IPv6 is used in stead of IPv4.
From then on that IPv4-adress is useless.
The MAC-adres of the machine could be a better unique marker as filename,
because that hardly ever changes.

When you have a crash, you first have to restore an image to a SDcard.
My method is installing once a year a complete new Raspbian Linux,
configure that via a text list of experienced changes I wish,
and than make a backup to more than one microSDcard of the same capacity.
Then you have more backup's of the same card.
In case of a crash, I can immediately change to another card much faster.
Then I donot need a HDD or DVD's to store images and give them names ;-).
Or restore them first to a card to get back online.

JP> An other cool thing to store cards, I bought one of these on ebay:
JP> https://ebay.com/itm/252717916459
JP> it arrived yesterday.
JP> You being very precise, make sure you store it in an EMP safe metal box.

I am not running a commercial bank, but only a hobby.

JP> All cards are saved on DVD / bluray whatever, and all are checked,
JP> no sync, no conv=noerr,sync

Do not forget that we are writing to a (German) newbe here.
That "conv=noerr,sync" is necessarry in case of possible read errors.
The sync command afterwards is for copying the buffer to the destination
properly

JP> But feel free to do that :-)

Ones you will thank me for doing that safety procedure allways,
otherwise, you will cry once very hard when you lose an almost completely
filled large medium, on which you worked very hard for a long time,
and left that sync away, because it can ones hurt, as Murphy is always trying.
What can go wrong, will happen onces or even more times.
So work safe, at least in giving advice to newbe's.
What you realy do at your home is your own bussiness.

JP> Happy NewYear!

You too.

Henri.

---
* Origin: Connectivity is the Future; UniCorn BBS 31 26 4425506 (2:280/1208)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.