Operating System - HP-UX
1748209 Members
2788 Online
108759 Solutions
New Discussion юеВ

Re: Incorrect file size reported

 
SOLVED
Go to solution
user001
Frequent Advisor

Incorrect file size reported


Hello,
I have the following disk layout
vg00
lvol1
/mnt1
vg01
lvol2
/mnt2

I'm trying to copy all the data from /mnt1 to /mnt2, i've noticed when copying an 800mb tar archive from /mnt1 it reports the file is 2GB on /mnt2. All files copied from /mnt1 to /mnt2 seem to have this problem.

11.31
vxfs v6
20GB lv's

Any ideas. This is driving me insane, /mnt1 is about 10GB but because its making them large on /mnt2 i'm unable to copy the entire contents.

Any help would be great.
Thank you.
11 REPLIES 11
Viktor Balogh
Honored Contributor
Solution

Re: Incorrect file size reported

how did you copy it? I think these are sparse files, that's why you end up with much bigger files on /mnt2.

use dd or pax to move them, see also this thread:

http://h30499.www3.hp.com/t5/System-Administration/How-can-I-copy-a-sparse-file/m-p/4859869#M396243

****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: Incorrect file size reported

here is a way of identifying a sparse file:

http://h30499.www3.hp.com/t5/System-Administration/Find-sparse-file/m-p/3875418#M279127

****
Unix operates with beer.
user001
Frequent Advisor

Re: Incorrect file size reported


i tried dd but it never ended :(

dd if=/dev/vg00/lvol1 of=/dev/vg01/lvol2 vs=1024

this seem to go forever, the new partition is slightly larger but that shouldn't be a problem. Is there a way to monitor dd?

i have tried cpio, mv, cp, fbackup, snapshot + those commands (in case).

i wasn't aware of pax, i noticed someone else commented that it doesn't support files larger than 2GB?

Thanks for the help.
Viktor Balogh
Honored Contributor

Re: Incorrect file size reported

> i tried dd but it never ended :(

or you just couldn't wait till the end of it. :)
you can also copy it on a file level like this:

# dd if=/mnt1/file1 of=/mnt2/file1 bs=1024

AFAIK dd can handle files >2gig
****
Unix operates with beer.
user001
Frequent Advisor

Re: Incorrect file size reported


I left it run over night, i thought this would have been enough for dd.

I'll give pax a try first, this sounds like it could do the job. failing that i'll try dd again.

i'll update the thread / points tomorrow when i get to try it out.

thanks for the suggestions.
Dennis Handly
Acclaimed Contributor

Re: Incorrect file size reported

>I've noticed when copying an 800mb tar archive from /mnt1 it reports the file is 2GB on /mnt2.

Hmm. I wouldn't expect tar to be smart enough to create sparse files?

>I noticed someone else commented that it doesn't support files larger than 2GB?

No, pax(1) can support > 8 Gb. After all, after fbackup(1m) is obsoleted, pax is its replacement.
Dennis Handly
Acclaimed Contributor

Re: Incorrect file size reported

>I tried dd(1) but it never ended :(
dd if=/dev/vg00/lvol1 of=/dev/vg01/lvol2 vs=1024

Your blocksize is too small. Try bs=1024k
Bob_Vance
Esteemed Contributor

Re: Incorrect file size reported

Hmmm.
From my testing, it seems that neither 'tar' , 'fbackup', nor pax support sparse files.
I'm surprised a little.

Just for grins, why don't you untar (watch out for absolute pathnames -- be sure to use the -C option) the tar archive into /mnt2 and see what the stuff *looks* like and actually *is*.


bv
"The lyf so short, the craft so long to lerne." - Chaucer
Hein van den Heuvel
Honored Contributor

Re: Incorrect file size reported

Can we take a few steps back and get a clear problem statement with details?


>> I'm trying to copy all the data from /mnt1 to /mnt2,

Which tool(s) used for the copy? cp? details?

>> i've noticed when copying an 800mb tar archive from /mnt1 it reports the file is 2GB on /mnt2.

Best I know there is no tool called 'it' on HPUX, although that would be neat to maximize confusion!

So what tool did you use to report the size? ls? du? df? options used for those?
Did you try alternatives? What did they all report?

hth,
Hein.



All files copied from /mnt1 to /mnt2 seem to have this problem.