Probably you don't want a 4G partition table, a 4G partition,
and a 4G filesystem on your 8G card, but that's what you'll
get when you use dd. This should work, unless you have bad blocks
on your 8G, which dd will just assume are good. To use the
additional space, you would need to expand the
partition, resize the filesystem, and maybe then
edit the /etc/fstab file for new UUIDs.
The alternative is to partition the 8G disk the
way you want it, setting the size of root, and deciding
if you really want swap. Format the partition(s) with
the filesystem you want -- maybe no journaling on an
SD card, so ext2 or ext4 without journaling. Copy
the files over with any copy program which can copy file
attributes and not follow links (look at the option switches).
tar works just fine with the following:
sudo tar -cf - * |(cd /mnt/8g;sudo tar -xpBf -)
Get the new UUIDs with
Edit the /etc/fstab with the new UUIDs.
Install grub to the 8G disk (assume it's sdc)
sudo grub-install --boot-directory=/mnt/8g/boot /dev/sdc
Bad blocks on the target card should be recognized and
avoided, so you get a working system without a perfect