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

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.

Tags:

Ubuntu