0

Let's call the image Disk.img, taken from /dev/sda.

How do I list every file and folder with differences?

(Let's assume the time stamps of the files are incorrect.)

1

I usually mount the disk image somewhere and find all the files from it's "root" directory (the root of the mount point) issuing an sha1sum against every file it finds.

Then, change to the root directory of the FS you want to check and run sha1sum against the list of saved sums (you need to issue find from the roots so the paths to the files are the same in the sha1sum output)

It's a little greasy because missing files will cause errors and filenames with spaces or shell meta-charcters will give you trouble as well but it's about the best way I've found of finding duplicate files or detecting changes.

  • mount the image somewhere (mount -o ro /root/Disk.img /mnt/disk_img)
  • cd /mnt/disk_img && find . -type f -exec sha1sum '{}' \; > tmp/disk_img.sums
  • umount /mnt/disk_img
  • cd / && sha1sum -c /tmp/disk_img.sums

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.