Size difference when copying LARGE file
by 0ktalmagik » Mon, 05 Jun 2006 07:59:11 GMT
Hi, Im trying to take a database backup. one of the files is 26 GB. I
am using cp -pr to create a backup copy of the database. after the
copying is complete, if i do du -hrs on the folders i saw a difference
of 2GB.
The weird fact is that the BACKUP folder was 2 GB more than the
original one!
when i did du -hrs * inside each of the 2 folders and compared the
output, i found the culprit. it was a file temp.dbf which was 26 GB on
the source(original) folder and 28 GB in the BACKUP folder. I tried the
copy procedure twice and I am getting the same result.
does anyone have any explanation for this. please let me know. I want
to make sure everything is right here in the copy.
PS:- Solaris SPARC 23 BIT.
Thanks
Re: Size difference when copying LARGE file
by Cydrome Leader » Mon, 05 Jun 2006 09:27:33 GMT
Are you copying a live file, or something in use by the database?
What does ls -l show for file size for original and copy?
Re: Size difference when copying LARGE file
by jgp » Wed, 07 Jun 2006 06:24:01 GMT
In article < XXXX@XXXXX.COM >,
What does "ls -ls" show for the original and the copy?
Database files are frequently sparse, they have holes that have
never been written to and don't occupy actual disk space. Eg:
% dd if=/dev/zero of=t1 bs=1k count=1 seek=10k
% cp t1 t2
% ls -ls t1 t2
40 -rw-r--r-- 1 jgp 10486784 Jun 5 17:17 t1
10256 -rw-r--r-- 1 jgp 10486784 Jun 5 17:18 t2
% du -s t1 t2
40 t1
10256 t2
t1 is only 40k on disk even though the final byte is at lseek
position 10486784. One copied it grows to 10M since the holes
get filled in.
I believe ufsdump/ufsrestore are the only tools standard tools that
preserve holes in files.
Star ( http://www.**--****.com/ ) handles them.
--
Jim Prescott - Computing and Networking Group XXXX@XXXXX.COM
School of Engineering and Applied Sciences, University of Rochester, NY
Re: Size difference when copying LARGE file
by js » Wed, 07 Jun 2006 07:01:12 GMT
In article <e627dh$ XXXX@XXXXX.COM >,
If you use a pre S-2.6 or a recent Solaris, star is able to correctly copy
holes too. With star there is no need to be root in order to do this (at least
not on a recent Solaris version - the old Solaris hole interface forces you to
be root too).
--
EMail: XXXX@XXXXX.COM (home) Jg Schilling D-13353 Berlin
XXXX@XXXXX.COM (uni)
XXXX@XXXXX.COM (work) Blog: http://www.**--****.com/
URL: http://www.**--****.com/ ://ftp.berlios.de/pub/schily
Similar Threads:
1.Size difference when copying a large file in solaris
Hi, Im trying to take a database backup. one of the files is 26 GB. I
am using cp -pr to create a backup copy of the database. after the
copying is complete, if i do du -hrs on the folders i saw a difference
of 2GB.
The weird fact is that the BACKUP folder was 2 GB more than the
original one!
when i did du -hrs * inside each of the 2 folders and compared the
output, i found the culprit. it was a file temp.dbf which was 26 GB on
the source(original) folder and 28 GB in the BACKUP folder. I tried the
copy procedure twice and I am getting the same result.
does anyone have any explanation for this. please let me know. I want
to make sure everything is right here in the copy.
PS:- Solaris SPARC 32 BIT.
Thanks
2.Why the difference in block size after copy?
Hi,
I am curious as to why the total number of blocks differ between the
source file and the copied file? I copied a file and put it on the same
disk as the source file. Sizes are same in terms of bytes, but not in
blocks. Is this normal?
John
3.File size difference when nulling a file
I'm currently using the > /myfile.log command to reset the file size
to 0 byte. However, this > command does not necessary work for all
logs. Sometimes the file size is not set to 0 instead lots of empty
spaces are pipe into the file instead. When this happen, the file size
show using "ls -l /myfile.log" and "du -sk" show dispute size. Anyone
has any idea why the diff in file size using the 2 different command?
4.tar file with size 9GB returns "File too large"
When I use root to tar up some filesystems in AIX 4.3.3 ML10, for
those files with 9GB or more will return "File too large" and fail to
tar that files. fsize already set = -1. Any help?
5.Large File size & Send file
6. cp -r and -R difference and other for copy files
7. difference in files being copied by scp from Unix to VMS
8. Difference between copy to and copy from nfs mounted disk