I have a 32GB SD Card that contains an Armbian installation for some pi gadget. I want to clone the content into a 16GB card. Using GParted, I shrank the partitions to be less than 16GB and here is the state of the SD Card as shown in fdisk
. There are 2 partitions, one is the Armbian and the other one is an small FAT32 partition to share files with windows.
Disk /dev/sdk: 29,74 GiB, 31914983424 bytes, 62333952 sectors
Disk model: USB3.0 CRW-SD/MS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x22563e30
Device Boot Start End Sectors Size Id Type
/dev/sdk1 8192 25690111 25681920 12,3G 83 Linux
/dev/sdk2 25690112 26509311 819200 400M b W95 FAT32
Can you please tell me what would I need to do now to exactly clone what is on the card, including the boot partition? It is strange that the Armbian leaved 8129 sectors free, and calls it unpartitioned space, what is in that area?
If I do something like:
dd if=/dev/sdk of=/home/user/backup.iso
It will create an image with size 32GB.... but I want it to be limited to the last sector of /dev/sdk2
.
count
option limits the number of blocks, and thebs
option defines the blocksize. As stated in the answer, actually. – berndbausch May 29 '21 at 10:48