Why are the 'proc' and 'sys' folders more than 100 TB in size? [closed]

These locations belong to virtual filesystems. Everything you see – folders, files, their contents – is made up on the spot whenever you try to access it. The actual size isn't even known until after you read the file (and it often can't be cached as different readers may well see different contents).

The filesystems themselves occupy nothing at all; they're just views into the kernel.

Sometimes the size is known but the data it represents is massive. For example, the core files represent the virtual address space of a process – and this address space is as large as the CPU can address; it is unbound by actual RAM/swap size. So the file will be somewhere around 248 to 264 bytes on a "64-bit" system.

So it's normal that you will get really strange numbers if you run disk usage utilities on virtual filesystems, especially if they count "apparent" (sparse) size, not the actual disk usage.


No, that's not why. Sparse files appear a certain size because the file header lists it, but they contain far less data.


One way could be that they have a large number of compressed files and are counting the size they would be when uncompressed.

Obviously this would depend on the type of file as some files compress further than others (e.g. text files) and others can't be compressed further (e.g. jpg, mp3) without losing data, but theoretically this could give the numbers your friend quotes.