I have one strange problem. When I copy file from source to destination using scp, file size decreased in destination side. I can see that copy progress is successful in source side. But when I check file size using
command file size is 10 time smaller.
First I looked into network. But there wasn't any network interrupt. So I changed destination directory to /tmp in scp copy command. After that I checked file size on destination side and it was correct size. Then I copied file from /tmp to /backup on destination side and checked file size. File size was 0k very strange.
I think there's some disk issues in the server. Also checked zfs filesystem using
They are all fine. Have you seen this issue ever?
How did you determine that the size of the copy was zero?
On a ZFS filesystem, copying file1 to file2 might share disk block allocations between the two files until some bytes in one of the files is overwritten. In that case a du -s file1 file2 might show 0 blocks allocated to file2 while du -s file2 file1 might show 0 blocks allocated to file1, and du -s file1 followed by du -s file2 (in separate invocations of du) would show the same (non-0) size for both files.
I used du -sh command to determine the size of the copy. I just found that file size in destination directory is increasing. It was 0K about 30 min ago and now it's 7.2M. So that means I need to check disk read write performance, right?
---------- Post updated at 02:41 PM ---------- Previous update was at 11:45 AM ----------
I found that this issue appeared on only disk from SunStorage M2500M2 array.
I used du -sh command to determine the size of the copy. I just found that file size in destination directory is increasing. It was 0K about 30 min ago and now it's 7.2M. So that means I need to check disk read write performance, right?
---------- Post updated at 02:41 PM ---------- Previous update was at 11:45 AM ----------
I found that this issue appeared on only disk from SunStorage M2500M2 array.
Did you read what I said in post #2 in this thread?
You haven't told us anything that would allow us to guess what, if anything, is wrong:
How big is the source_file?
Exactly what command are you using to copy the file?
Exactly what du command did you use to check the destination_file size? Why didn't you use ls -l instead of du to check the destination_file size?
Are the source and destination files on the same filesystem?
Did the command you are using to copy the file complete? If so, what was its exit status? What diagnostic messages did it produce?
Are the sizes from du -s destination_file and ls -l destination_file consistent?
Are any diagnostics being written to the system consoles (or error logs) while the file is being copied on the source system and on the destination system? (Any diagnostics; not just disk problems.)
What operating systems (including versions) are being run on the source and destination systems?
What makes you think you have disk read/write performance problems as opposed to network performance problems?
Yeah, read your post, sorry for not enough details. Here are some details.
1. Source file size is 10mb. Actually there are many files with the size greater than 10GB. But I chose 10mb sized one file as test.
2. I'm using cp and scp both. scp -C source_file oracle@remote_host:/path/to/dir
cp source_file /path/to/destination
3. I used du -sh command to see file size. ls -l command shows the size same as source file. But du -sh command shows different size. I think that ls -l command is showing only file size info in the header and du -sh command is showing size on the disk.
4. Yes, source and destination filesystem are same. I'm using Solaris ZFS filesystem
5. Yes, command completed without error.
6. du -sh and ls -ltr results are different. Please see 3th answer.
7. Already checked if there's any log. But I didn't see any log.
8. Solaris 10 runs on both source and dest server.
9. If I copy files from source server to local disk of the remote server it copies file without issue. All file sizes are correct.
If I copy file from source server to sunstorage disk of the remote server, copied file size is decreased. That means this issue is related to SunStorage.
---------- Post updated at 01:51 PM ---------- Previous update was at 11:27 AM ----------
I'm checking storage and will share the result here.
Check if your zfs filesystem in question is using compression and/or deduplication.
That can cause confusion with du, if you are not aware that it is turned on.
GNU du has --apparent-size which can be usefull on zfs filesystems and is present as gdu on Solaris 11 and later.
Also you might want to run md5sum or cksum to check if the files are the same on source and destination.
Check if your zfs filesystem in question is using compression and/or deduplication.
That can cause confusion with du, if you are not aware that it is turned on.
GNU du has --apparent-size which can be usefull on zfs filesystems and is present as gdu on Solaris 11 and later.
Also you might want to run md5sum or cksum to check if the files are the same on source and destination.
Hope that helps
Regards
Peasant.
Deduplication is what I was talking about in post #2 in this thread. But comparing the source and destination is going to fail if du is showing that the destination is growing over time after the copy completes.
I asked for the EXACT du command that was being used to look at the size of the destination file and was told that the command used was:
which will not tell you the number of blocks allocated to any particular file; it gives you the number of disk blocks allocated to all files in the file hierarchy rooted in the current working directory that are in the same filesystem as the current working directory.
The fact that ls -l shows the correct file size is a clear indicatory that the copy completed successfully and if:
is showing destination_file with in initial allocation of 0 blocks after the copy completes and an increasing allocation as time passes, it means that new blocks are being allocated to destination_file as blocks in source_file and/or destination_file are being changed after the copy completed.
Hi,
I have a shell script which is having copy command. My need is to copy all the files in a directory into its subdirectory.
My directory structure is like this.
Dir1
file1.txt
file2.txt
file3.txt
subDir1
subDir1 is a subdirectory in Dir1.
Now I... (2 Replies)
Hi experts
cp bin root src /mnt
but not copy bin/bigfile
any help?
( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum)
Thanks (6 Replies)
Hi,
Gretings,
While viewing the contents of a file using more/cat in Reflection,
I am neither able to see the text beyond the width of screen, nor able to type it as well.
I have tried changing windows settings also, but of no vail.
Even if I cat/more a file and try to copy its contents, it... (1 Reply)
Hi,
I have an excel file generated by system in windows. I am zipping it, transfering to unix and unzipping there. But i'm getting below output while unzipping.
$ /usr/bin/unzip -a 123.zip -d .
Archive: 123.zip
inflating: ./123/Index.xls
When i copy this unzipped xls file to... (0 Replies)
Hello, more of a windows wscript guy. However I took a new position that requires me to support some solaris servers. So... issue is that I need to copy all lines from a file to a temporary file and then copy them back into the original file starting at line 1. Reason I need to do this is... (5 Replies)
Hi,
I was copying a bunch of files from one folder to another.. while copy command was running i pressed 'ctrl C'...now these files are not present in the parent directory nor in the target folder... :eek:
Where can find these files...
Is there any way to get this files back.. :confused:... (2 Replies)
Hi
my OS is solaris 9 , we have requirement to copy 1 file from solaris box to windows machine , so which utility or commands any idea will be appreciated
Regards (3 Replies)
Hi,
- on a solaris box what is the best utility to copy a whole file system from one place to other? - the aim of the operation is to place the contents of
the whole file system to other file system within the discs
cp ? - cpio? - tar?
- what about file systemes containing symbolic links ?... (1 Reply)
Hello,
I try to copy a small file e.g. /etc/hosts from my workstation to my office Pc via serial cable on Port b. (/dev/term/b)
But I donīt now how!
On the Pc I can only use the HyperTerm on NT because this is the released software. There is an option to send or receive data but i have no idea... (11 Replies)