Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-15-2011, 05:16 PM
|
#1
|
Member
Registered: Feb 2009
Posts: 78
Rep:
|
how do i verify rsync
I've been playing with rsync. I've copied some data from one drive to another, I don't see any errors, but when I inspect with du -s I get two different values
root@T/home/user/Desktop# du -s backups
759421964 backups
root@T:/home/user/Desktop# du -s /data/tmp.moved/
759568528 /data/tmp.moved/
root@T:/home/user/Desktop#
How can I see what's different? I've been playing with diff and find/ls, but it's not as nice/complete as I'd like.
I did the following as root:
cd sourcedir
ls -aR > ~user/original
cd backupdir
ls -aR > ~user/backup
cd ~user
diff -yW 200 original backup > diff.txt
grep \> diff.txt
grep \< diff.txt
grep \| diff.txt
all came back null
Doing the above with ls -laR got messy...
Note: the source is an XFS filesystem (on a RAID5 array, if that matters), the backup filesystem is an EXT4 filesystem.
Could the difference in size be due to the difference in filesystem architecture?
The original rsync command was:
rsync -aHvPh --delete /data/tmp.moved/ ~user/backups
hmm.... I just realized I left the trailing slash off the end of the backups directory... not sure if that would cause difference in disk usage, though... the diff of the ls -aR showed no differences.
Any ideas?
Thanks,
WT
|
|
|
03-15-2011, 05:43 PM
|
#2
|
Member
Registered: Oct 2010
Location: N. VA
Distribution: Redhat, CentOS, Solaris
Posts: 40
Rep:
|
Each file system will indeed allocate the data differently, most likely caused by how they handle journaling. Another potential cause is your source directories have expanded and retracted in size. They will still have space allocated in the directories for the deleted file names even if the directories are empty. Since rsync rebuilds the directories from scratch during the copying process, the new directories on the target no longer have that space allocated for missing files.
|
|
|
03-15-2011, 06:12 PM
|
#3
|
Member
Registered: Feb 2009
Posts: 78
Original Poster
Rep:
|
Quote:
Originally Posted by Omnicronos
Each file system will indeed allocate the data differently, most likely caused by how they handle journaling. Another potential cause is your source directories have expanded and retracted in size. They will still have space allocated in the directories for the deleted file names even if the directories are empty. Since rsync rebuilds the directories from scratch during the copying process, the new directories on the target no longer have that space allocated for missing files.
|
So, would you say that the percentage difference in the disk usage is reasonable and not a concern given your above comment? Don't worry you're not liable.
WT
Last edited by wjtaylor; 03-16-2011 at 11:19 AM.
|
|
|
03-15-2011, 06:23 PM
|
#4
|
LQ Newbie
Registered: Nov 2009
Distribution: Slackware / Arch
Posts: 10
Rep:
|
I agree with Omnicronos that it's most likely just the difference in filesystems. But if you wanted to be sure you could make a checksum before the transfer, and then verify against it afterwards.
|
|
|
03-15-2011, 07:33 PM
|
#5
|
Member
Registered: Oct 2010
Location: N. VA
Distribution: Redhat, CentOS, Solaris
Posts: 40
Rep:
|
Quote:
Originally Posted by wjtaylor
So, would you say that the percentage difference in the disk usage is reasonable and not a concern given your above comment? Don't worry your not liable.
WT
|
No worries. I doubt you are experiencing any data loss. But, as Weird0ne wisely suggested, it never hurts to verify your data with a checksum.
Quote:
rsync --checksum: Normally rsync compares the timestamp and the size of a file to determine if it has changed since the last backup. If you use --checksum rsync will ignore the time stamps and checksum any files that are the same size to determine if they are different. Obviously this adds a significant slowdown to the backup process. You wouldn't normally use this option however it is good to have if you believe your backup data has become corrupted in a way that doesn't affect the information you see in an ls -l output.
|
http://www.sanitarium.net/golug/rsync_backups_2010.html
|
|
|
All times are GMT -5. The time now is 02:19 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|