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]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux