[Deutsch] Wie 16GB SD-Karte auf 64 GB "klonen"?

Moin!

Geht das? Eine vorhandene SD-Karte 16 GB im laufendem Betrieb auf eine

64GB-Karte klonen. Ein Kartenleser ist vorhanden. Pi 3b, Raspian (aktuell)

am Mac vorbereiten (1 oder 2 Partionen?) und dann klonen? Einfach im Finder Daten kopiren wird woh nicht gehen - oder?

--
Kennst du groops.de, die Freizeitgemeinschaft im deutschsprachigem  
Raum? Reinschauen kostet nichts...  
Urlaubsbilder: http://www.thomas-heier.de  
Filme: http://www.youtube.com/user/thshDE?feature=mhum#g/u
Reply to
Thomas Heier
Loading thread data ...

Am Tue, 08 Jan 2019 19:16:25 +0100 schrieb Thomas Heier:

Auch Moin! Entschuldigung, wenn ich jetzt auf Englisch zurueckschreibe, aber so duerfte die Zielgruppe groesser sein -- Sorry for writing back in English, but this way more of us can read it.

You have: A 16GB SD card containing a working (Raaspberry) installation, and

you want: to get it to work on a 64GB card?

Well, when installing Raspbian Stretch I just unzipped and copied the image to the device on the fly:

unzip -p 2018-11-13-raspbian-stretch-full.zip > /dev/sdb

The very first time of booting the OS recognises that the SD card ist not fully used and asks if it should expand the partition (yes).

Same option I have seen in the raspi-config menu.

So, have you already tried to just copy the content of the 16GB card to the 64GB card, starting at the beginning of the device and then expand the partition?

Best regards,

Markus

--

Please reply to group only. 
For private email please use http://www.dipl-ing-kessler.de/email.htm
Reply to
Markus Robert Kessler

Thomas Heier) wrote

You need a Linux PC, Apple is dead anyways :-)

1) make a backup of your 16 GB SDcard, NOT on the raspi, but on a Linux PC: dd if=/dev/X of=cardimage.iso where X is what dmesg shows what device your card is when you insert it, for example /dev/sdb Remove SDcard 2) copy the backup image to your 64 GB card, NOT on the raspi, but on a Linux PC: dd if=cardimage.iso of=/dev/XX 3) follow these instructions from
formatting link
Step by Step Instructions Now stick the 64 GB SDcard into raspi, and boot. From the command line or a terminal window enter the following sudo fdisk /dev/mmcblk0 then type p to list the partition table you should see three partitions. if you look in the last column labeled System you should have W95 FAT32 Linux Linux Swap make a note of the start number for partiton 2, you will need this later. though it will likely still be on the screen (just in case). next type d to delete a partition. You will then be prompted for the number of the partition you want to delete. In the case above you want to delete both the Linux and Linux swap partitions. So type 2 then type d again and then type 3 to delete the swap partition. Now you can resize the main partition. type n to create a new partition. This new partition needs to be a primary partition so type p. Next enter 2 when prompted for a partition number. You will now be prompted for the first sector for the new partition. Enter the start number from the earlier step (the Linux partition) Next you will be prompted for the last sector you can just hit enter to accept the default which will utilize the remaining disk space. Type w to save the changes you have made. Next reboot the system with the following command: sudo reboot once the system has reboot and you are back at the commandline enter the following command: sudo resize2fs /dev/mmcblk0p2 Note: this can take a long time (depending on the card size and speed) be patient and let it finish so you do not mess up the file system and have to start from scratch. Once it is done reboot the system with the following command: sudo reboot You can now verify that the system is using the full capacity of the SD Card by entering the following command: df -h

I just did that to make 16 GB cards from 8GB cards (for several raspies).

Reply to
Jan Panteltje

Am Tue, 08 Jan 2019 19:16:25 +0100 schrieb Thomas Heier:

Moin! :-)

To not full-quote Jan's posting, just a short addition here:

Of course you can do all that on a MAC and any other unixoide OS also. The needed dd command is also available there, but just foget to do all that in the desktop environment. That's a job for the command line -- the heart of you MAC.

Just be careful when it comes to writing to /dev/disk1 or such disks to not overwrite your MAC's main data disk.

A good explanation in German language is to be read here:

formatting link

Best regards,

Markus

--
Please reply to group only. 
For private email please use http://www.dipl-ing-kessler.de/email.htm
Reply to
Markus Robert Kessler

Yes, but,

Mac = Apple Macintosh MAC = Media Access Control address = ethernet hardware address

Reply to
A. Dumas

This is old out of date advice, all recent Rasbian images do not have a swap partition (if swap is needed a swap files is used). This means the linux partition is the last on the disc, and can easily be expanded in to the unused space using resize2fs

---druck

Reply to
druck

Mac=Mackintosh = rubberised fabric rainproof overcoat..

as in:

"You gotta light, mack?" "No, but I've got a dark brown overcoat".

--
The New Left are the people they warned you about.
Reply to
The Natural Philosopher

MAC = Man Against Computer

--
/~\  cgibbs@kltpzyxm.invalid (Charlie Gibbs) 
\ /  I'm really at ac.dekanfrus if you read it the right way. 
 X   Top-posted messages will probably be ignored.  See RFC1855. 
/ \  Fight low-contrast text in web pages!  http://contrastrebellion.com
Reply to
Charlie Gibbs

Henri Derksen wrote in

Not in my uexperience. I _do_ use dvdimagecmp to test if the image is the same as the card:

formatting link

dvdimagecmp -a /dev/sdb -b the_image_i_made

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

So far never seen an error with dd if=/dev/whatever of=my_new_perfect_image

:-)

Always use card write to hardidsk, and then hardisk to cards I do not delete the hardidsk image either:

panteltje12: /mnt/sda1/encode_ts # l 1/*

-rw-r--r-- 1 root root 8048869376 Dec 8 14:02 1/1.img

'l' (l as in logic, not '1') is bash alias for 'ls -rtl' to save typing. And if you really want to save typing and use terminals a lot use zsh as shell. Anyways that is my old 8 GB raspi router image that is now on a 16 GB card. the '1' refers to the last part of the IP address (fixed), cool way to number cards.

An other cool thing to store cards, I bought one of these on ebay:

formatting link
it arrived yesterday. You being very precise, make sure you store it in an EMP safe metal box.

dvdimagecmp comes from dvd burning stuff I was (and still am it seems) into:

formatting link

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

But feel free to do that :-)

Happy NewYear!

Reply to
Jan Panteltje

[Snip]

Omitting block size will still copy the card OK, it will just do it very slowly and may rapidly degrade life of the card. You will be writing in

512 byte sectors, and the controller may (if it isn't very clever) have to rewrite an entire flash block of at least 128KB each time. By specifying bs=1M you will ensure the controller always writes whole flash blocks, and is much quicker.

Omitting sync normally doesn't cause a problem if removing the card a second or two after the copy has finished. So it depends if you always want to do things correctly, or see how long you can get away with sloppy practice before things go wrong!

---druck

Reply to
druck

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>

formatting link

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>

formatting link
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.

Reply to
Henri Derksen

Henri Derksen wrote

No, the ONLY way to know if a copy was OK is to use 'diff' or in my case dvdimagecmp I do not 'always' use sync 3 times, it is an old Unix thing.

The instructions I quoted and gave are for a harddisk copy, and I clearly stated 'on a Linux PC'.

Read it again.

Reply to
Jan Panteltje

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.