Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 205583 - [RHEL4 U4] MD5SUM's do not match after copy of symlinked directory
[RHEL4 U4] MD5SUM's do not match after copy of symlinked directory
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: coreutils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Depends On:
  Show dependency treegraph
Reported: 2006-09-07 09:51 EDT by Joshua Giles
Modified: 2007-11-16 20:14 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-09-07 12:33:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
RHEL4 script (932 bytes, application/x-shellscript)
2006-09-07 09:52 EDT, Joshua Giles
no flags Details
RHEL3 script (947 bytes, application/x-shellscript)
2006-09-07 09:53 EDT, Joshua Giles
no flags Details
The copied directories md5sum (976.13 KB, application/octet-stream)
2006-09-07 10:56 EDT, Joshua Giles
no flags Details
The soft linked directories md5sum listing (976.13 KB, application/octet-stream)
2006-09-07 10:57 EDT, Joshua Giles
no flags Details
Original source md5sum (976.13 KB, application/octet-stream)
2006-09-07 10:58 EDT, Joshua Giles
no flags Details

  None (edit)
Description Joshua Giles 2006-09-07 09:51:05 EDT
Description of problem:

I've got scripts that I want to use for kernel compilation, however I am
seeing md5sum failures on RHEL4.  I've pulled the relevant parts of my
script(s) into two scripts which are attached.  The scripts get a
kernel.src.rpm from porkchop (wget) then install and build-prep followed
by a cp from the symlink (pointing to the prepared kernel) to a new
directory.  Finally the md5sum is calculated for the symlinked, copied
and original directories.  The symlinked file reports a different md5sum
than the other directories.

The failure occurs with 2.6 (U2, U3) but not on 2.4 (RHEL3) machines.  Also, if
I use sum instead of md5sum I don't see the errors.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce: 
1. Install RHEL 4 U4 and start script(s) above (requires rpmbuild and probably
Actual results:
MD5SUMs do not match.

Expected results:

Additional info:

Erm, I may be doing something wrong but I would expect behavior to be 
consistent across OS'es.  Also, this is most likely not an md5sum problem but I
thought it would be a good place to start.
Comment 1 Joshua Giles 2006-09-07 09:52:37 EDT
Created attachment 135757 [details]
RHEL4 script
Comment 2 Joshua Giles 2006-09-07 09:53:26 EDT
Created attachment 135759 [details]
RHEL3 script
Comment 3 Tim Waugh 2006-09-07 10:08:54 EDT
Seeing as the md5sum input is just a directory listing, perhaps you could attach
the actual directory listings themselves rather than asking me to compile a
kernel to get them.. :-)
Comment 4 Joshua Giles 2006-09-07 10:56:34 EDT
Created attachment 135771 [details]
The copied directories md5sum
Comment 5 Joshua Giles 2006-09-07 10:57:24 EDT
Created attachment 135772 [details]
The soft linked directories md5sum listing
Comment 6 Joshua Giles 2006-09-07 10:58:07 EDT
Created attachment 135773 [details]
Original source md5sum
Comment 7 Joshua Giles 2006-09-07 10:59:30 EDT
 diff -burN copy.md5sum src-link.md5sum
--- copy.md5sum 2006-09-06 11:16:08.000000000 -0400
+++ src-link.md5sum     2006-09-06 11:16:09.000000000 -0400
@@ -13752,7 +13752,7 @@
 -rw-r--r--  1 root root 1794 Oct 18  2004 uuid.h

-total 300
+total 296
 drwxr-xr-x   3 root root  4096 Oct 18  2004 acpi
 drwxr-xr-x   2 root root  4096 Sep  6 11:14 asm-alpha
 drwxr-xr-x  24 root root  4096 Oct 18  2004 asm-arm
@@ -13778,7 +13778,7 @@
 drwxr-xr-x   2 root root  4096 Oct 18  2004 asm-v850
 drwxr-xr-x   2 root root  4096 Sep  6 11:14 asm-x86_64
 drwxr-xr-x   2 root root  4096 Sep  6 11:14 keys
-drwxr-xr-x  18 root root 24576 Sep  6 11:15 linux
+drwxr-xr-x  18 root root 20480 Sep  6 11:15 linux
 drwxr-xr-x   2 root root  4096 Oct 18  2004 math-emu
 drwxr-xr-x   2 root root  4096 Oct 18  2004 media
 drwxr-xr-x   2 root root  4096 Oct 18  2004 mtd

It's always the linux directory that is different.
Comment 8 Tim Waugh 2006-09-07 12:33:31 EDT
So one or more files or directories are taking up different numbers of blocks. 
I expect there is a sparse file or some such thing, or else the directories from
the build directory are larger due to having had to accommodate the built object
files etc.

Please file a more specific test case if you think there really is a bug.
Comment 9 Joshua Giles 2006-09-07 13:58:35 EDT
I'm not sure I understand you.  How is one to tell if you have data corruption
or some other problem(s) if you see an md5sum failure?  Is md5sum useless in
certain cases?  Also, this is a different behavior from RHEL3; Por que?  

How do I help investigate the real reason for failure?
Comment 10 Tim Waugh 2006-09-08 04:32:01 EDT
You got different md5sums because you fed md5sum different inputs -- as
demonstrated by the diff in comment #7.  You are md5summing the output of 'ls
-lR' (for some reason!).

Note You need to log in before you can comment on or make changes to this bug.