View: 12191|Reply: 4

Duplicate SD Card for Armbian

[Copy link]

4

threads

8

posts

40

credits

Novice

Rank: 1

credits
40
Published in 2017-5-23 06:27:03 | Show all floors |Read mode
Hi,

I just installed Armbian on my OrangePI Zero instead of the Debian that I was using.   I used an 8 GIG Card.     Now that I have a booting system that can connect via WIFI,  I wanted to create a backup card so that if I screw something up, I can recover.    I created a backup image with Win32DiskImager, but it was too big to fit onto the new card.   I forced the image to fit with

http://www.roadkil.net/listing.php/C2/Disk Utilities
That utility worked with images on my Raspberry PI.   It would fail at the end of the image, but on the Raspberry PI, the end of the image was just blank space anyway.    On Armbian, this did not work and mounting the card as /dev/sda with a card reader shows that the file system appears to be blank.   On my Debian installs of Jessie on the Raspberry PI, the SD card is formatted into a FAT32 boot drive and a ext4 Linux drive.    On Armbian, this appears to be done with just a single ext4 Linux drive.    Perhaps that is why my previous tricks are not working.

Are there some tricks to copying the image from a working SD Card to a blank one?     I tried a straight dd copy.   That completed without any issues, however the resultant card would not boot the OrangePi Zero.  

Thanks.

----- Steve




0

threads

45

posts

625

credits

Senior member

Rank: 4

credits
625
Published in 2017-5-23 07:18:43 | Show all floors

4

threads

8

posts

40

credits

Novice

Rank: 1

credits
40
 Author| Published in 2017-5-25 05:58:57 | Show all floors
I shrank the image on Linux using GParted.   I can duplicate the card using "dd" under Linux without any errors.   However, under Windows if I save the image and then try to copy it to a new card, two bad things happen.   First, Windows wants to make the cloned card FAT32.   Secondly, the saved image in Windows is still too big in size.  I guess that is because Windows is doing a raw copy of the actual card size and not the size of the partition.   

Even the trick of using the roadkil.net code does not work.   I got it to work once or twice, but usually afterwards copying I get an SD Card that the OrangePi does not think is formatted properly.  

Is anyone duplicating or cloning Armbian using Windows machines?

0

threads

45

posts

625

credits

Senior member

Rank: 4

credits
625
Published in 2017-5-26 06:06:15 | Show all floors

RE: Duplicate SD Card for Armbian

Edited by RagnerBG at 2017-5-26 06:08
mrburns42 replied at 2017-5-25 05:58
I shrank the image on Linux using GParted.   I can duplicate the card using "dd" under Linux without ...

What do you mean by size of the partition and size of the card? Every software for partitions clone, copy the entire partition and not just used space. What software are you using for cloning under Windows? In Windows, i am using win32diskimager. You can try to manipulate the partitions of ready image copy with some software like AOMEI Partition Assistant. Not sure if this will ever be supported in any software like it, but you can google about this. Isn't it easier to copy your image in working Armbian in your device and do the things in above link i posted?

4

threads

8

posts

40

credits

Novice

Rank: 1

credits
40
 Author| Published in 2017-5-31 20:28:01 | Show all floors
All SD Cards are only approximately the size that the manufacturer is claiming.   Apparently all cards have a few bad sectors that are marked off.   Programs like Win32DiskImager creates an image of the entire card, not just a partition on the card.    I am using 8 GIG cards.  Some are about 7.7 GIG in total size, some are less than 7.5 GIG in total size.    Using GParted, I shrink the partition of the source card to about 7.2 GIG.   This leaves the rest of the space as unused at the end of the card.   A 7.2 GIG partition will fit in all my 8 GIG cards.   Then went I make an image, the file is the size of the entire card, since it is always a raw image and not a partition image. (Windows apparently does not have native support for ext4 partitions, so Windows does not understand the partition table.)   However, the stuff at the end is not any good data, since it is the part that was removed from the ext4 partition.
  
If I use the Roadkil software to copy the image back to the destination SD card, then the copy may fail at the very end if the raw size of the destination card is less than the raw size of the source card.  However, that is the unused area, so I end up with a working SD Card even though the copy failed at the very end.    Win32DiskImager checks the raw card size BEFORE starting the write, and will abort if there is not enough room, so it is not usable for copying to cards that are slightly smaller in raw size than the original.     

More testing found that Win32DiskImager does not work for me with SD Cards that contain a single ext4 partition.   Raspberry PI and BeagleBone cards work, but those contain a FAT partition as well.   I tried two different Windows computers and two different SD Card readers.  Using Win32DiskImager I get IO errors part way through either the Read or Write.   The error happens at random places.  Occasionally, it will complete, but the card is not boot the Orange PI.   This happens even when I try to write the same image that back to the original SD Card.

Using only the RoadKil code, I can create images and restore them to different SD cards.  The resultant cards will boot and work in  the OrangePI.  So I do have a working solution for cloning or duplicating the Armbian SD Cards now using Windows.   My earlier fails with the Roadkil code was due to my attempting to use an image created by Win32DiskImager.   That source image was apparently corrupted.  

Warning:  be very careful with the RoadKil code.   It is not specific to SD Cards.   It is a generic disk image program.  Therefore, it will default to your C drive!   You definitely do not want to muck around with that image.  Make sure you switch to your SD Card before doing any reading or writing.   
   
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list