Ilare
Ilare

Reputation: 13

dd partition image differs

What variables can produce different md5sum of the same dd image of a partition? If I execute this code over two storages (same size, brand and geometry) why I obtain different "partition.image" files:

sfdisk /dev/sda < /partition.table
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt/
tar -xf somefiles.tar -C /mnt/
umount /mnt
dd if=/dev/sda1 of=/partition.image

P.S. tar is preserving all files timings!

Upvotes: 1

Views: 443

Answers (2)

link141
link141

Reputation: 161

When you make a new ext4 filesystem with the mkfs utility, it generates a unique UUID between invocations(unless you pass the -U option with an explicit UUID). Since the UUID is stored in the superblock of the file system, the images you generate between different runs of the above code will not be bit-for-bit identical.

Sources: http://wiki.debian.org/fstab#UUIDs https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#The_Super_Block

Upvotes: 1

Chris
Chris

Reputation: 1448

Time of creation, access etc. And that's good - no two images, created at different storages should be the same. Or otherwise, you could have something called "collision".

Upvotes: 0

Related Questions