From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,6761146a935a00d6 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2004-02-07 20:11:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!news.cpqcorp.net!53ab2750!not-for-mail From: Bob Harris Newsgroups: comp.unix.tru64 Subject: Re: How is this possible? References: User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X) Message-ID: Date: Sun, 08 Feb 2004 04:11:01 GMT NNTP-Posting-Host: 16.115.204.22 X-Complaints-To: abuse@HP.com X-Trace: news.cpqcorp.net 1076213461 16.115.204.22 (Sat, 07 Feb 2004 20:11:01 PST) NNTP-Posting-Date: Sat, 07 Feb 2004 20:11:01 PST Organization: Hewlett-Packard Company Xref: archiver1.google.com comp.unix.tru64:11170 In article , Zlatko Rek wrote: > The disk is 20GB and the file is 620GB! > > $ ls -l > total 157425 > -rw-r--r-- 1 xxxxx users 7 Oct 29 2001 INPUT > -rw-r--r-- 1 xxxxx users 4084328 Feb 2 17:25 kc.bc_20000 > -rw-r--r-- 1 xxxxx users 4084328 Jan 29 15:18 kc.bc_5000 > -rw-r--r-- 1 xxxxx users 188608 Oct 29 2001 kc.bnd > lrwxr-xr-x 1 xxxxx users 8 Feb 3 10:16 kc.flo -> kc.flo-2 > -rw-r--r-- 1 xxxxx users 67109040 Jan 30 13:36 kc.flo-1 > -rw-r--r-- 1 xxxxx users 665904666240 Feb 2 17:25 kc.flo-2 > ^^^^^^^^^^^^ > $ df > Filesystem 1024-blocks Used Available Capacity Mounted on > home_domain#home 21912264 17068577 4834752 78% /home > ^^^^^^^^ > $ uname -mr > V5.1 alpha > As has been mentioned in a previous reply, the file is most likely sparse. Since this is an AdvFS file system you can do 2 things to see the sparseness. ls -s Will tell you the amount of storage actually allocated to the file vs the location of the last byte of the file. /usr/sbin/showfile -x will show you the extent information for the file telling you what storage has been allocated. There are man pages that describe both of these commands and options. There is no way to make the file smaller without rewriting it from scratch and eliminating the parts you don't want. A typical cp/tar/cpio type command will only compound your problem because these utilities will replace sparse holes with real storage. There vdump/vrestore commands are suppose to know how to read the sparse map and copy a file without filling in the holes. Check the examples in the man pages, but something like this might work for copying such a file: vdump -0f - kc.flo-2 | vrestore -xf - -D /destination/directory/ Never tried it, so I'm not sure it will do what I suggest. The dd command also has a sparse option that attempts to avoid writing blocks of zeros in a file it is copying. dd if kc.flo-2 of /target/directory/kc.flo-2 conv=sparse However, dd will read every virtual byte of the file and compare it for zeros. 620GB of reading holes and comparing it against zeros will consume huge amounts of CPU time. It would be best to use vdump/vrestore as a copy tool as it will read the extent map and just read the parts of the file that exist. Of course there is the very rude and crude approach of writing a program to read the showfile -x output and only copy the parts of the file that have storage. of course if you are going to do this, you might as well just use the fcntl( F_GETMAP ) system call and have AdvFS tell you what parts of the file are sparse in the first place (also works for sparse UFS files) Now if your goal was to transfer the file to a different systems that is not NFS connected or you want to compress it first, then you might be able to combine a compression, tar, untar, uncompress, dd sequence, and vrestore was not an option on the target system, then you might try gzip kc.flo-2 tar cf kc.flo-2.tar kc.flo-2.gz on the other end tar xf kc.flo-2.tar gunzip -c kc.flo-2.gz | dd of kc.flo-2 conv=sparse You might have to do the compression first because tar does not really like huge files. Compressing it first may keep the real size to something tar can swallow. I hope this helps. Bob Harris