3

After experiencing a DDoS attack, somehow /proc/kcore is very huge, I use a small PHP class to check the current disk space, and how many has been used.

It shows the following:

Total Disk Space: 39.2 GB
Used Disk Space: 98 GB
Free Disk Space: 811.6 MB

My question: Is it safe to delete the /proc/kcore file? Or is there a solution on getting it to an normal size.

The filesize of /proc/kcore is 140.737.486.266.368 bytes

I have hosted my server at DigitalOcean.

2
  • Which OS and version are you using?
    – K7AAY
    Jan 16, 2014 at 20:03
  • I use Ubuntu 12.04
    – Love2Code
    Jan 16, 2014 at 20:05

1 Answer 1

9

Nothing in /proc is "real", it's a virtual filesystem that allows you to see inside the kernel. When you read or write from any of these files you're talking directly with the kernel, not actually creating files on disk. From man proc:

/proc/kcore

This file represents the physical memory of the system and is stored in the ELF core file format. With this pseudo-file, and an unstripped kernel (/usr/src/linux/vmlinux) binary, GDB can be used to examine the current state of any kernel data structures.

The total length of the file is the size of physical memory (RAM) plus 4KB.

I'm not sure how true the last line is; on my laptop /proc/kcore shows up as 128TB! It's more likely the size of the address space used by the kernel or something.

Regardless, if you need more disk space you need to look at the real filesystems. Take a look at the output of df -h to see where your space is running low. You can also then use the du command to see in more detail where space is really being used.

Interestingly, if you run du -h /proc/kcore you'll see it says 0. :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .