Linux-Based Community / Regional
1833062 Members
2809 Online
110049 Solutions
New Discussion

Rhel 5 core files size increases dramatically when moved

 
Terry L Johnson
Frequent Advisor

Rhel 5 core files size increases dramatically when moved

?
4 REPLIES 4
Ivan Ferreira
Honored Contributor

Re: Rhel 5 core files size increases dramatically when moved

I think that information is missing here....
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Kapil Jha
Honored Contributor

Re: Rhel 5 core files size increases dramatically when moved

It was amazing question "?"

We need more information what/where/how?

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Matti_Kurkela
Honored Contributor

Re: Rhel 5 core files size increases dramatically when moved

Moved from where? To where? Which command(s) were used in the move? Which command(s) were used to detect the size increase?

If the size seen by "ls -l" is larger than the size seen by "du", what you're seeing is a sparse file.

Unix filesystems often have a property called "sparse files": if a file contains a long string of zero bytes, the filesystem can replace the whole string with a short mark, effectively "insert xxxxxx zero bytes here". This is effectively the grandfather of on-disk file compression schemes.

When a file is loaded, the filesystem automatically expands these to real zero bytes, so the application using the file will never see any difference.

Using the "sparse file" functionality requires that the program writing the file specifically wants to use it. When a kernel is dumping a core file to disk, the program to be dumped may have allocated large blocks of memory, but not actually used (neither read or written) much of it yet. The kernel knows where the unused portions are, and can easily use the sparse file functionality to skip over them. This will reduce the size of the core file, often significantly.

If the core file is later copied using a program that does not replicate the "sparse" property, the runs of zero bytes will be expanded to full size.

An example of a sparse file:
$ dd if=/dev/zero of=/tmp/test bs=1k seek=10000000 count=1

$ ls -lh /tmp/test
-rw-r--r-- 1 mkurkela mkurkela 9.6G 2010-03-17 08:18 /tmp/test

$ du -h /tmp/test
16K /tmp/test

A sparse file containing 9.6G of zero bytes takes up just 16K on disk. With a different filesystem type, it might take up even less disk space.

MK
MK
Steven E. Protter
Exalted Contributor

Re: Rhel 5 core files size increases dramatically when moved

Shalom,

A little detail would help. Perhaps the file handle is still open on these core files.

Who owns them?

Lots more data needed to help.

SEP
70 Points to Linux Olympus with a Penguin on top.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com