Huge file issue of NFS
Two servers,
One is installed CentOS4.3(2.6.9-34), named "A";
The other is install RedHat7.3(2.4.19) named "B"
In "A", I used 'dd' command to create two huge files(38GB and 19GB) in '/test' directory:
# dd if=/dev/urandom of=/test/hugefile bs=10M count=3800
# dd if=/dev/urandom of=/test/hugefile2 bs=10M count=1900
"B" has a shared directory "shares",then I mount this "shares" to A's "NFS_Test":
# mount xxx.xxx.xxx.xxx:/shares /NFS_test
I wrote the following script to cp and compare files:
#!/bin/bash
# NFStest
#THIS WILL COPY $1 TO $2
#THEN COMPARE WITH DIFF, AND PUT THE RESULTS IN $3
#1ST COPY 1 TO 2
cp -v $1 $2 >> $3
sleep 100
#then compare them using diff
diff -s $1 $2 >> $3
while :
do
#then copy $2 to $1.tmp
cp -v $2 $1.tmp >>$3
sleep 100
#then compare $1 with $1.tmp
diff -s $1 $1.tmp >> $3
#then copy $1.tmp to $2
cp -v $1.tmp $2 >>$3
sleep 100
#then compare using diff
diff -s $1.tmp $2 >>$3
#then compare $1 and $2
diff -s $1 $2 >> $3
done
Here,
$1 is the source. (A: /test/hugefile, hugefile1)
$2 is the destination.(A: /NFS_test)
$3 is the log where everything is pumped into.
At this time. I run the script in two console simultaneously:
# ./NFStest /test/hugefile /NFS_test/hugefile.copy /nfstest.log
# ./NFStest /test/hugefile1 /NFS_test/hugefile1.copy /nfstest1.log
After more than two hours, I read the "nfstest1.log", it showed that hugefile1 and hugefile1.copy are different!
In the early test, I created a 160G file, and run the script in only one console, the result of 'diff' said them are same even this testing was running about a week!
How could this "diff" happen? Please help me.
Thanks and regards,
Phillip
|