I booted Ubuntu on a live USB and ran:
dd if=/dev/sda1 of=/mnt/usb/backup.img bs=30M oflag=sync
I then performed a comparison (using 'md5sum') of the above input partition and output img, but they did not match. Delving further, I found the img was shorter by 1 byte hence the mismatch! 'cmp' of the two returns "EOF on image".
HDD image file checksum does not match with device checksum mentions that dd stopped at EOF and this is normal behaviour, but I am still unclear on the entire situation...
My questions are:
1- What does EOF means in the context of a partition? I think I understand EOF in the context of a file but this is different as I would expect to find EOF at the end of the partition only.
2- Is restoring the dd img (dd if=/mnt/usb/backup.img if=/dev/sda1) safe?
3- What is in that last byte?