Operating System - HP-UX
1753479 Members
5182 Online
108794 Solutions
New Discussion

Incorrect file size reported

 
SOLVED
Go to solution
user001
Frequent Advisor

Re: Incorrect file size reported


Viktor Balogh is the champion, 100% sparse files they were and pax worked a treat.

I only half expected it to work but when it did wow was i happy.

thanks for everyones help much appreciated.

cheers.

Bob_Vance
Esteemed Contributor

Re: Incorrect file size reported

Wow.
That's interesting.
When I tested it, as I said, I could not get 'pax', 'tar', or 'fbackup' to *CREATE* an archive of sparse files that was small.
A 'du' of the archive was always as large as the sparse files showed in 'll', not 'du'.

I did the testing on both 11.23 and 11.31.

HOWEVER, when I *extracted* from the 'pax' archive, it DID restore a sparse file !!! ('tar' did not), even though the archive itself was large !?!?


So, I'm wondering how your archive got created as such a small size in the first place.

bv


((((((((((((((((((((((((((((((

Here is my testing:

create a sparse file:

## dd if=/dev/zero of=/tmp/sparsefile seek=1024000 count=1 bs=1024


Check sizes:

## ll /tmp/sparsefile ; du -k /tmp/sparsefile
-rw-r--r-- 1 root sys 1048577024 Apr 18 08:41 /tmp/sparsefile
8 /tmp/sparsefilep/sparsefile

So, 'll' reports 1G, while the actual 'du' size is 8K


Create archives with 'pax', 'tar', 'fbackup' :

## (cd /tmp ; pax -w -f pax1 sparsefile)
## (cd /tmp ; tar cf tar1 sparsefile)
## (cd /tmp ; fbackup -f fb1 -i sparsefile)


Check sizes:

## ( for F in /tmp/pax1 /tmp/tar1 /tmp/pax1
do ll $F; du -k $F
done
)
-rw-r--r-- 1 root sys 1048586240 Apr 18 09:10 /tmp/pax1
1032440 /tmp/pax1
-rw-r--r-- 1 root sys 1048586240 Apr 18 09:11 /tmp/tar1
1024016 /tmp/tar1
-rw-r--r-- 1 root sys 1048586240 Apr 18 09:10 /tmp/pax1
1032440 /tmp/pax1

All archives show 1G with BOTH 'll' and 'du'.

Now, extract:

## mkdir /tmp/td
## (cd /tmp/td ; pax -rv < /tmp/pax1 ; ll sp* ; du -sk sp* ; rm sp*)
USTAR format archive
sparsefile
-rw-r--r-- 1 root sys 1048577024 Apr 18 09:09 sparsefile
8 sparsefile

So, the recovered file *is* sparse, even though the archive was 1G !?!?!?!

)))))))))))))))))))))))))))))))))))))))))
"The lyf so short, the craft so long to lerne." - Chaucer