mmcblk0 device is the main boot device since it has all of those extra partitions. The
mmcblk0p1 is verified to have
ext4 as the rootfs.
It is mounted, so you wouldn’t want to use
dd with it, but
mmcblk1 is verified as your SD card, and specifically
mmcblk1p1 is the destination.
Your command “
df -h” does indicate individual partition sizes, so anything “
dd if=/devmmcblk0” will exceed the size of just “
mmcblk0p1”. Are you trying to copy everything, or just the rootfs? If you want to keep a backup somewhere I can see why you might want to copy everything, but if this is for booting to, then that other content cannot be put on the SD card…just the rootfs.
Keep in mind that a
dd command which places all of
mmcblk0 onto SD card would produce all of those partitions, and not just one. “
mmcblk0” also includes some invisible content for the GPT partition scheme, so total device copy exceeds the size required even for the sum of visible partitions (partition scheme data might be invisible, but its size is not zero).
FYI, you might continue after providing more details on exactly what you want to accomplish since there are a lot of little nuances which change how to go about what you are doing.
If you wanted to copy the rootfs to the SD card’s first partition, then it would go something like this (but if you’ve overwritten some of the invisible GPT data there might be additional steps):
sudo dd if=/dev/mmcblk0p1 of=/dev/mmcblk1p1 bs=1M
(notice that block size of
bs=1M won’t change anything other than buffer size, and will be somewhat faster with a 1M block size…you could leave that out if you want)
Note that the danger here is that if
mmcblk0p1 is a running filesystem, then it can change during copy. You could use Magic SysRq to at least make it read only (then reboot after the copy). Basically, if it is a local keyboard:
# Each "s" syncs.
# "u" remounts read-only
…make sure the SD card is not mounted at that time, and after the rootfs is read-only, then add the SD card. Do not mount the SD card anywhere, just
dd to it without mount.
Note: “alt” is the ALT key, and there is a more obscure key near the scroll lock key which shows shifted as “PrtScn” (printscreen) and unshifted as “SysRq” (system request).