Re: How to compare filesystem contents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/07/2010 11:05 AM, Andrew Junev wrote:
...
> Is there an easy way to check which files are there on the old
> filesystem, that do not exist on the new one?

cd /newdisk
find . -type f | sort >/tmp/newdisk.lst
cd /olddisk
find . -type f | sort >/tmp/olddisk.lst

diff /tmp/olddisk.lst /tmp/newdisk.lst

If you want to check if files are identical, you can do:

cd /newdisk
find . -type f -exec md5sum "{}" \; | sort >/tmp/newmd5.lst
cd /olddisk
find . -type f -exec md5sum "{}" \; | sort >/tmp/oldmd5.lst
diff /tmp/newmd5.lst /tmp/oldmd5.lst

The two lists need to be sorted as the
file order might be different between the
two file systems.

Maybe cp had problems recognizing sparse files
correctly?

Mogens
-- 
Mogens Kjaer, Carlsberg A/S, Computer Department
Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark
Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25
Email: mk@xxxxxx Homepage: http://www.crc.dk
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux