LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2010, 12:16 PM   #1
bobby953
Member
 
Registered: Mar 2009
Posts: 41

Rep: Reputation: 15
Smile Different file size after copy


Firstly, I did perform a search on this problem in these forums, but didn't quite get what I was looking for. So I hope I don't yelled at for making a duplicate post.

So I used rsync to backup my webroot to another nix machine. du -hs gave me 1.3 G on the source machine and 1.1 G on the backup machine. I tried to compare the individual files and noticed a trend. The files on backup machine were always smaller than the files on source machine.

The source uses SATA drive, destination uses IDE. So this time I rsynced locally to another folder on the source machine. Same size anomaly. So i did a simple cp file ~/file and same size anomaly. So it's not a rsync issue.

I took a file and ran md5sum on both, the source file and destination file. To my surprise, even though the file size was different, they had the same md5sum.

Now, let it be known that the source machine is a production server and the dir i rsynced was being used, serving pages to the web. I googled about this and came up with stuff like open descriptors and holes. I don't understand this stuff and was wondering if this was really the case. What are those if it is the case? And my backup copy is 100% identical right? There are thousands of files and I ran md5sum only on couple. Can I take comfort that when time comes, I can restore using my backup without any problems?

Thanks a lot in advance.
 
Old 02-27-2010, 01:17 PM   #2
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,078

Rep: Reputation: 195Reputation: 195
Take a look at the --apparent-size option on du. See if running du with that gives you the same values on both machines.


Also try using stat on some of the files on each machine to see what block size is reported and how many blocks they are using.

Code:
mike@continuity:~$ stat /etc/bash.bashrc  | grep Block
  Size: 8577      	Blocks: 24         IO Block: 4096   regular file
 
Old 02-27-2010, 02:46 PM   #3
BeacoN
Member
 
Registered: Nov 2008
Distribution: Linux Mint
Posts: 56

Rep: Reputation: 17
bobby,

I'm not sure about the exact problem here, but I have read of having problems estimating drive size from the shell in certain situations. (Something about some readings being approximate).

If you get the same md5 for each I wouldn't worry. You might want to open one or two files to make sure they do what you wanted them to do-and I wouldn't worry about it.
 
Old 02-27-2010, 03:33 PM   #4
bobby953
Member
 
Registered: Mar 2009
Posts: 41

Original Poster
Rep: Reputation: 15
Thanks arizonagroovejet. Here is the output:

Source / Destination on same machine, so the question of different hardware, such as hard disk doesn't arise.

Source:
[root@peweb1 modules]# stat zmodule.contact.php | grep Blocks
Size: 4593 Blocks: 24 IO Block: 4096 regular file

Destination
[root@peweb1 modules]# stat zmodule.contact.php | grep Blocks
Size: 4593 Blocks: 16 IO Block: 4096 regular file


Source:
[root@peweb1 www]# du -hs
1.3G .

Destination:
[root@peweb1 www1]# du -hs
1.1G .


Source:
[root@peweb1 www]# du --apparent-size -hs
987M .

Destination:
[root@peweb1 www1]# du --apparent-size -hs
986M .

Ouch... so close... now only if they weren't off by 1MB. But yeah, pretty close... what do you think happened to the 1MB?


BeacoN, thanks, but I can't test the the files from functionality perspective, because the files are php files and are part of the entire source code for an e-commerce site.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dd copy; destination drive size wheelsg Linux - Hardware 5 11-11-2008 01:21 PM
ReiserFS 2Gb maximum file size limit? Cannot copy files bigger than 2Gb ihtus SUSE / openSUSE 2 10-26-2007 10:21 AM
any ideas to reduce log file size or make log file size managed? George2 Programming 2 08-13-2006 07:55 AM
"File size limit exceeded" during copy h3xis Linux - Networking 2 06-17-2006 02:24 PM
file system size larger than fysical size:superblock or partition table corrupt klizon Linux - General 0 06-18-2004 05:18 PM


All times are GMT -5. The time now is 07:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration