Jump to content

rsync and du: size discrepancy after synchronizing


Recommended Posts

Hello,

 

In short the rsync backup of /home/users1 into /home2/users1

are not the same size using du -c --blocksize=1

(no linux pc at hand, but from memory I tried lots of du flags)

 

I decided at last to learn rsync to backup /home/user1 which is ext3

to another IDE HD using as root rsync --delete --archive (and some other flags)

into an empty destination directory, under mdv 2007

 

The directory /home/users1 contains about 3.7 Gb and is about 20 Mb

bigger than the backup /home2/users1 (both using ext3)

Files are all sort: pictures, tar.gz, lots of rpm, pdf, html, lots of hidden directories.

most files by users1, some by root. Very few or no links (hardlinks or not)

 

I did a reverser rsync from home2 into home using --dry-run, and it looks ok.

SO, why is there a size discrepancy?

Is this to do with sparcity of files?

Is this to do with journaling?

Do I need to run e2fsck? Have I got space taken by dead files?

I am using badly du? (I used konqueror directories information size, there is also a size difference)

I have read man pages for rsync and du, but I must have missed something

Have you got any pointers or suggestion of what to do

(apart from using cp -R, or rsync --checksum which I may try...)

 

Thanks

Edited by emmanuel_uk
Link to comment
Share on other sites

Is there any particular reason why you're using rsync to keep the partitions in sync? There's a much easier way creating a Raid 1 array for both these partitions, and then letting it manage itself.

 

I've done this, here is my link on converting existing partitions to Raid 1 arrays:

 

http://linuxsolutions.org/index.php?option...5&Itemid=26

 

I've moved stuff from one disk to another in this howto, and found size discrepancies, but it wasn't anything to worry about. Maybe your rsync is similar in terms of results. I also was using du to check it all.

Link to comment
Share on other sites

tahnks Ianw1974

 

Is there any particular reason why you're using rsync to keep the partitions in sync?

Well, had enough of cp, plus cp builds up file like firefox cache each time I backup, also rsync faster, also the synchronisation is nice.

Excluding files or list is nearly impossible with cp -R.

Wanted the delete function on the target directory

Anyhow wanted to learn rsync

Always heard (apart from raid1) that it was a good backup method.

(have played with dd and cp for backup purposes, so now rsync)

 

My mobo is raid 1 capable, but with the partition scheme I have

it is too late for a raid 1. I played with raid 0 at first, but had 1 or 2 loss of data (as expected), due to HD leaving the mount point randomly only three times over ~ 6 mths, so did not want to do raid 1 anyway

Also raid 1 really decrease amount of space available on a non-server home system, sparcity is high, so no point of doing a raid1.

 

I've moved stuff from one disk to another in this howto, and found size discrepancies, but it wasn't anything to worry about

Interesting you noticed this as well

Well I am worried... am sure it is something I do not understand not an OS problem. Do not like this discrepancy.

I really wonder if it an inode story or journal

 

What I am going to do is

rsync into /home2/user1

then

cp -R into /home2/user1_bis

compare size

Most likely will be the same for /home2/user1 and /home2/user1_bis

but 20 Mo less than /home/user1

then probably investigate a bash way to compare two du outputs

directory by directory

Link to comment
Share on other sites

rsync --recursive --archive --verbose --update --delete --stats --human-readable /home/ /home2/

 

Well, not using du correctly. The expected answer is when using flag b

(I must say I know a bit about filesystem, but flag b is counterintuive if not thinking hard)

 

compare

du -cks /home/user1/.Skype; du -cks /home2/user1/.Skype

1656 /home/user1/.Skype

1656 total

1664 /home2/user1/.Skype

1664 total

to

du -bcks /home/user1/.Skype; du -bcks /home2/user1/.Skype

1525 /home/user1/.Skype

1525 total

1525 /home2/user1/.Skype

1525 total

 

--apparent-size or -b

print apparent sizes, rather than disk usage; although the

apparent size is usually smaller, it may be larger due to holes

in (‘sparse') files, internal fragmentation, indirect blocks,

and the like

 

I still have discrepancies on the total of all the directories. To do with one symlink I think

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...