I can see there are several similar threads on same.However I am running into a problem where reading an image from sd-card using dd or Win32diskimager copies whole card rather than actual image. Because of this, we are running in to a problem where we cannot copy cloned image to a card of theoretically same size (say 8G to 8G) but practically slightly lesser than 8GB.
My search lead me to How can I copy the same image to many SDs? , I was trying to use script mkimg.sh. But as I run it using command , am running into an error:
sudo bash mkimg.sh /dev/sdb sdcard.zip
e2fsck 1.42 (29-Nov-2011)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb2: 204406/394352 files (0.3% non-contiguous), 1585523/1596128 blocks
mkimg.sh: line 56: let: long.: syntax error: invalid arithmetic operator (error token is ".")
this is how err line looks :
let bytes=`resize2fs -M ${linux_partition} 2>&1 | grep -i -e "The filesystem .*is .*blocks long" | sed -e 's/.*is [^ ]* \([0-9]*\) (4k) blocks.*/\1*4096/'`
I made some trial but as am not bash expert , i am unable to understand where is error in this statment.