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