Image SD Card
From KlavoWiki
To write an image of your Raspberry Pi's SD card.
mkdir /mount/smb
mount -t cifs -o workgroup=workgroup,username=myusername,password=mypassword,vers=3.0 "//192.168.1.37/Temp-Area" /mount/smb/ dd if=/dev/mmcblk0 of="/mount/smb/duplicate_20170830-1122.img" bs=1M count=1600
umount /mount/smb rmdir /mount/smb
If you are using the default image size before expansion the count size is 1600.
Hint:
fdisk -l /dev/mmcblk0
The end sector size multiplied * 512 will tell you the size in bytes. Then divide by 2048 to get your count size. Make sure you round up to the next whole number.