Das df Kommando, Dateisysteme im Überblick - df Command Filsystems overview (DE/EN)

in #deutsch3 years ago

Das df Kommando, Dateisysteme im Überblick

(English Below / Enlisch Unten)

Was ist das df Kommando?
Mit dem df Kommando zeigt man auf einem Linux System an wieviel Platz auf einem Dateisystem bzw auf allen Dateisystemen des System noch frei ist. Ausserdem ist ersichtlich wieviel schon belegt ist. df ist die Abkürzung für "disk free"

Im einzelnen:

  1. Wieviel Platz ist belegt.
  2. Wieviel Platz ist noch frei.
  3. Zeigt alle Dateisysteme die auf dem System gemounted(eingehängt) sind.
  4. Ermöglicht es herauszufinden ob die Kapazität auf einer Partition oder einem Netzlaufwerk erschöpft ist.
  5. Zeigt die Anzahl der Inodes an die auf einem Linux System noch Verfügbar ist.

Syntax:

df
df /verzeichniss
df [option] [/dev/DEVICE]

Wenn ich auf meinem System df eingebe sieht das ungefähr so aus:

Dateisystem    1K-Blöcke  Benutzt Verfügbar Verw% Eingehängt auf
udev            16420144        0  16420144    0% /dev
tmpfs            3287176     9712   3277464    1% /run
/dev/sda3       47797996 13727256  31612988   31% /
tmpfs           16435872    97252  16338620    1% /dev/shm
tmpfs               5120        4      5116    1% /run/lock
tmpfs           16435872        0  16435872    0% /sys/fs/cgroup
tmpfs            3287172        4   3287168    1% /run/user/1000

Dabei heisst:
Dateisystem: Der Name des Dateisystem oder Device
1K-Blöcke: Die grösse in 1 Kliobyte Blöcken
Benutzt: Die Gesamtmenge des Speicherplatzes der Belegt ist.
Verfügbar: Die Gesamtmenge des Speicherplatzes die noch vorhanden ist und mit neuen Dateien belegt werden kann.
Verw%: Die Prozentzahl der Blöcke die vom Dateisystem benutzt werden.
Eingehängt auf: Der Mount Point im Dateisystem in dem das Dateisystem eingehängt ist.

Da in meinem System nur eine Festplatte vorhanden ist werde ich im folgenden nur diese Betrachten. Die anderen in der Liste angezeigten Dateisysteme sind interne Dateisysteme des Kernels mit denen man normalerweise nichts zu tun hat.

Wichtige Optionen für den df Befehl:
-T Typ des Dateisystems.
-H Human Readable (Kilobytes zählen 1024 Bytes)
-h Human Readable (Kilobytes zählen 1000 Bytes)
--block-size [Blockgrösse] für die Anzeige
-i Anzahl der benutzten inodes

Die Option Human readable erleichtert das Lesen der Ausgegebenen Informationen. Anstatt langer Zahlenketten werden die Zahlenangaben in Byte,Kilobyte,Megabyte,Gigabyte,Terrabyte usw angezeit. Wird die Option -H verwendet wird dabei die 1024 als Basis benutzt. Bei der Option -h basiert die Zahl der angezeigten Sektoren auf 1000 .

z.b
df -HT /dev/sda3 zeigt auf meinem System an:

Dateisystem    Typ         Größe Benutzt   Verf.     Verw%                 Eingehängt auf
/dev/sda3         ext4       49G        15G          33G      31%                      /

was besser Verständlich und in den meisten Fällen aussagekräftig genug ist.
Mit der Option --block-size kann man die angezeigte Blockgrösse Manuell vorgeben

df --block-size 16384 /dev/sda3
Dateisystem    16K-Blöcke      Benutzt      Verfügbar      Verw%      Eingehängt auf
/dev/sda3         2987375           856845        1976921         31%                 /

Die Option -i zeit die Nummer der freien und benutzten Inodes an:

Dateisystem     Inodes     IBenutzt     IFrei         IUse%          Eingehängt auf
/dev/sda3         3055616  199102      2856514      7%                /

Die Optionen Human Readable (-H oder -h) und Dateisystemtyp (-T) können auch in verbindung mit den Inodes angezeigt werden:

df -i -H -T /dev/sda3
Dateisystem      Typ     Inodes    IBenutzt    IFrei    IUse%      Eingehängt auf
/dev/sda3           ext4     3,1M         200k         2,9M    7%             /  


English Version
What is the df command?
With the df command on a Linux System you can see how much space is still free on a file system or on all file systems of the system. Furthermore you can see how much space is already used. df is the abbreviation for "disk free".

In detail:

  1. how much space is used.
  2. how much space is still free.
  3. shows all filesystems that are mounted on the system.
  4. allows to find out if the capacity on a partition or network drive is exhausted.
  5. shows the number of inodes still available on a Linux system.

Syntax:

df
df /directory
df [option] [/dev/DEVICE]

When I type df on my system it looks something like this:

file system     1K blocks     Used      Available  Managed%  Mounted on
udev                16420144         0                   16420144         0%  /dev
tmpfs              3287176           9712             3277464          1%  /run
/dev/sda3      47797996       13727256    31612988        31%  /
tmpfs              16435872        97252           16338620        1%  /dev/shm
tmpfs              5120                    4                   5116                  1%  /run/lock
tmpfs              16435872          0                   16435872        0%  /sys/fs/cgroup
tmpfs              3287172            4                   3287168           1%  /run/user/1000

Means:
File system: The name of the file system or device.
1K blocks: The size in 1 cliobyte blocks.
Used: The total amount of disk space that is occupied.
Available: The total amount of memory that is still available and can be occupied by new Files.
Used%: The percentage of blocks that are used by the file system.
Mounted On: The mount point in the file system where the file system is mounted.

Since there is only one hard disk in my system I will only look at this one in the following. The other filesystems shown in the list are internal filesystems of the kernel which you normally have nothing to do with.

Important options for the df command:

-T Filesytem Type.
-H Human Readable (KB counts 1024 Bytes)
-h Human Readable (KB counts 1000 Bytes)
--block-size [Blocksize]
-i Number of Used inodes

The Human readable option makes it easier to read the output information. Instead of long strings of numbers, the numbers are displayed in bytes, kilobytes, megabytes, gigabytes, terabytes, and so on. If the -H option is used, 1024 is used as the base. With the -h option the number of sectors displayed is based on 1000.
e.g.
df -HT /dev/sda3 displays on my system:

File system    Type    Size     Used     Avail  Used%    Mounted on
/dev/sda3      ext4      49G     15G        33G      31%         /

which is more understandable and in most cases meaningful enough.
With the option --block-size you can specify the displayed block size manually

df --block-size 16384 /dev/sda3
File system     16K blocks     Used        Available    Use%    Mounted on
/dev/sda3          2987375        856845    1976921      31%        /

The -i option displays the number of free and used inodes:

File system    Inodes       Iused        IFree          IUse%      Mounted on
/dev/sda3      3055616     199102    2856514    7%           /

The Human Readable (-H or -h) and File System Type (-T) options can also be displayed in conjunction with the inodes:

df -i -H -T /dev/sda3
File system   type    Inodes    Iused   IFree   IUse%    Mounted on
/dev/sda3     ext4    3.1M         200k    2.9M      7 %           /

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.028
BTC 57459.32
ETH 3055.56
USDT 1.00
SBD 2.30