Skip to main content
added 11 characters in body
Source Link
Zanna
  • 3.7k
  • 1
  • 20
  • 28

It is well-known that empty text files have zero bytes:

enter image description here

However, each of them contains metadata, which according to my research, is stored in inodes, and do use space.

Given this, it seems logical to me that it is possible to fill a disk by purely creating empty text files. Is this correct? If so, how many empty text files would I need to fill in a disk of, say, 1GB?


To do some checks, I run df -i but this apparently shows the % of inodsinodes being used(?) rather than how much they weightweigh.

Filesystem Inodes IUsed IFree IUse% Mounted on udev 947470 556 946914 1% /dev tmpfs 952593 805 951788 1% /run /dev/sda2 28786688 667980 28118708 3% / tmpfs 952593 25 952568 1% /dev/shm tmpfs 952593 5 952588 1% /run/lock tmpfs 952593 16 952577 1% /sys/fs/cgroup /dev/sda1 0 0 0 - /boot/efi tmpfs 952593 25 952568 1% /run/user/1000 /home/lucho/.Private 28786688 667980 28118708 3% /home/lucho 

It is well-known that empty text files have zero bytes:

enter image description here

However, each of them contains metadata, which according to my research, is stored in inodes, and do use space.

Given this, it seems logical to me that it is possible to fill a disk by purely creating empty text files. Is this correct? If so, how many empty text files would I need to fill in a disk of, say, 1GB?


To do some checks, I run df -i but this shows the % of inods being used(?) rather than how much they weight.

Filesystem Inodes IUsed IFree IUse% Mounted on udev 947470 556 946914 1% /dev tmpfs 952593 805 951788 1% /run /dev/sda2 28786688 667980 28118708 3% / tmpfs 952593 25 952568 1% /dev/shm tmpfs 952593 5 952588 1% /run/lock tmpfs 952593 16 952577 1% /sys/fs/cgroup /dev/sda1 0 0 0 - /boot/efi tmpfs 952593 25 952568 1% /run/user/1000 /home/lucho/.Private 28786688 667980 28118708 3% /home/lucho 

It is well-known that empty text files have zero bytes:

enter image description here

However, each of them contains metadata, which according to my research, is stored in inodes, and do use space.

Given this, it seems logical to me that it is possible to fill a disk by purely creating empty text files. Is this correct? If so, how many empty text files would I need to fill in a disk of, say, 1GB?


To do some checks, I run df -i but this apparently shows the % of inodes being used(?) rather than how much they weigh.

Filesystem Inodes IUsed IFree IUse% Mounted on udev 947470 556 946914 1% /dev tmpfs 952593 805 951788 1% /run /dev/sda2 28786688 667980 28118708 3% / tmpfs 952593 25 952568 1% /dev/shm tmpfs 952593 5 952588 1% /run/lock tmpfs 952593 16 952577 1% /sys/fs/cgroup /dev/sda1 0 0 0 - /boot/efi tmpfs 952593 25 952568 1% /run/user/1000 /home/lucho/.Private 28786688 667980 28118708 3% /home/lucho 
Tweeted twitter.com/StackUnix/status/885440999379484673
Source Link
luchonacho
  • 863
  • 3
  • 11
  • 31

Can I run out of disk space by creating a very large number of empty files?

It is well-known that empty text files have zero bytes:

enter image description here

However, each of them contains metadata, which according to my research, is stored in inodes, and do use space.

Given this, it seems logical to me that it is possible to fill a disk by purely creating empty text files. Is this correct? If so, how many empty text files would I need to fill in a disk of, say, 1GB?


To do some checks, I run df -i but this shows the % of inods being used(?) rather than how much they weight.

Filesystem Inodes IUsed IFree IUse% Mounted on udev 947470 556 946914 1% /dev tmpfs 952593 805 951788 1% /run /dev/sda2 28786688 667980 28118708 3% / tmpfs 952593 25 952568 1% /dev/shm tmpfs 952593 5 952588 1% /run/lock tmpfs 952593 16 952577 1% /sys/fs/cgroup /dev/sda1 0 0 0 - /boot/efi tmpfs 952593 25 952568 1% /run/user/1000 /home/lucho/.Private 28786688 667980 28118708 3% /home/lucho