Meniu

No space left on device or where did my disk space disappear?

International standards bodies, such as the International Electrotechnical Commission (IEC) and the International Organization for Standardization (ISO), have created a unit of measurement to account for the difference in use between the true metric and the approximation used in the calculation.

For example, disk manufacturers use metric measurements, 1000 GB = 1 TB. However, the computer world does not work at power 10, it works at the power of two, so 1024 GB = 1 TB. This is the difference between 1 TB and 977 GB.

In essence, 1024 GB = 1 TB. This means that you can buy a 1 TB drive, but disk utilities should report it as 977 GiB to reflect that the disk utility uses a factor of 1024 for measurement, not metric (1000), as a measurement factor. .

Modern versions of instruments have already begun to use this method. For example, fdisk:

[root @ gnulinux ~] # fdisk 
Disk / dev / sda: 20 GiB, 21474836480 bytes, 41943040 sectors 
Units: sectors of 1 * 512 = 512 bytes

One user reports that the file system is full, but when I look at the diskless (df) output, I see the following:

[root @ gnulinux ~] # df -h 
Filesystem Size Used Avail Use% Mounted on 
/ dev / sda1 991M 924M 0 100% / mnt

the reported size is 991 MB, but the one used is 924 MB. When a user executes the dd command:

[root @ gnulinux mnt] $ dd if = / dev / zero of = bigfile2
dd: writing to 'bigfile2': No space left on device

the file system is outside the data blocks for storing content. However, the file system has a lot of inodes (file indicators) available. This is confirmed by using another option with the df command:

[root @ gnulinux mnt] # df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/ dev / sda1 65536 14 65522 1% / mnt

Creating root user files works because the ext4 file system has a placeholder that privileged users cannot access. Only root processes, or root properties, can write files to consume this disk space. For ext2, ext3 and ext4 file systems, you can inspect this data, stored in the file system superblock, using the tune2fs command:

[root @ gnulinux] # tune2fs -l / dev / sda1
tune2fs 1.45.4 (23-Sep-2019)
Filesystem volume name:   
Last mounted on: / mnt
Default mount options: user_xattr acl
Filesystem state: clean
Behavior errors: Continue
Filesystem OS type: Linux
Inode count: 65536
Block count: 261888
Reserved block count: 13094
Free blocks: 253029
Free inodes: 65525
First block: 0
Block size: 4096

So the reserved block parameter is by default five percent of the file system space. At 1TB the backup space is ~ 500MB.

If you had to calculate the total space used, it would be 102%, and that would mean that you used 100% of the user-accessible disk space and some of those reserved blocks.

So the "lost" disk space is hidden in the various units of measurement used to report disk capacity. How this space is reported and used also differs depending on the file system and tools used.

FlorinM

Utilizator Linux - Solus OS, pasionat de calatorii.
  • | 2708 articole

Nici un comentariu inca. Fii primul!
  • powered by Verysign