* abnormal file size
@ 1995-05-17 4:00 Marianne
1995-05-17 4:00 ` Michael W. Walker
1995-05-17 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
0 siblings, 2 replies; 3+ messages in thread
From: Marianne @ 1995-05-17 4:00 UTC (permalink / raw)
Hello Everybody,
I hope somebody can help me with this. I have a file which looks like
it's 3.3GB on a 1GB disk. 'ls -l' give 3.3GB and whenever I try to copy,
backup, ftp the file it really come out as 3.3GB. The file is really 7MB
and 'du -k' give the right size. I've tried to fsck the disk without
success.
Thanks for any hint,
Franck.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: abnormal file size
1995-05-17 4:00 abnormal file size Marianne
@ 1995-05-17 4:00 ` Michael W. Walker
1995-05-17 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
1 sibling, 0 replies; 3+ messages in thread
From: Michael W. Walker @ 1995-05-17 4:00 UTC (permalink / raw)
In article <3pd6fa$d73@news.uni-c.dk>, Marianne <franck@dtbsun> wrote:
>Hello Everybody,
>
> I hope somebody can help me with this. I have a file which looks like
>it's 3.3GB on a 1GB disk. 'ls -l' give 3.3GB and whenever I try to copy,
>backup, ftp the file it really come out as 3.3GB. The file is really 7MB
>and 'du -k' give the right size. I've tried to fsck the disk without
>success.
>
I suspect it is a "sparse" file. If you need to copy it, but don't want the
copy to occupy additional space, use the "dd" command with conv=sparse. Eg:
dd if=original of=copy conv=sparse
if memory serves me right. See dd in man pages if this doesn't work.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: abnormal file size
1995-05-17 4:00 abnormal file size Marianne
1995-05-17 4:00 ` Michael W. Walker
@ 1995-05-17 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
1 sibling, 0 replies; 3+ messages in thread
From: Alan Rollow - Dr. File System's Home for Wayward Inodes. @ 1995-05-17 4:00 UTC (permalink / raw)
In article <3pd6fa$d73@news.uni-c.dk>, franck@dtbsun (Marianne) writes:
> I hope somebody can help me with this. I have a file which looks like
>it's 3.3GB on a 1GB disk. 'ls -l' give 3.3GB and whenever I try to copy,
>backup, ftp the file it really come out as 3.3GB. The file is really 7MB
>and 'du -k' give the right size. I've tried to fsck the disk without
>success.
Sounds like a sparse file, which is perfectly acceptable and considered
by most, a feature. See the lseek(2) manual page for information about
how such a file is created. Some database libraries will create such
files; dbm(3) for example. The quota file is also such a file depending
on the range of the user ids. Core files created from system crash dumps
are also sparse files.
When lseek(2) can be used to move past the end of the file. When data
is written at the current offset, only the data for that offset is
allocated. Space for the intervening data isn't. When this hole is
read back it provides NULs.
Most programs that move files around simply read the NULs and fill
them in, which is why gets larger when you copy it. Dump/restore do
the appropriate thing, since dump can see that no blocks are allocated.
The dd(1) program has an option to convert NULs to appropriate holes;
conv=sparse.
>
>Thanks for any hint,
>Franck.
>
>
--
Alan Rollow alan@nabeth.cxo.dec.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1995-05-17 4:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-05-17 4:00 abnormal file size Marianne
1995-05-17 4:00 ` Michael W. Walker
1995-05-17 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox