
Es heißt, dass ext3 eine Dateizeitstempelgenauigkeit von bis zu Sekunden und ext4 von bis zu Nanosekunden unterstützt.
Folgendes ist passiert: Mein alter VPS mit Ubuntu 12.04 und einem Ext3-Dateisystem hat (soweit ich mich erinnern kann) Nanosekunden immer sehr gut unterstützt, und zwar folgendermaßen:
File: `auth.log'
Size: 147744 Blocks: 304 IO Block: 4096 regular file
Device: 800h/2048d Inode: 32019 Links: 1
Access: (0640/-rw-r-----) Uid: ( 101/ syslog) Gid: ( 4/ adm)
Access: 2020-03-20 00:18:33.634687690 -0300
Modify: 2020-03-24 05:12:48.777610222 -0300
Change: 2020-03-24 05:12:48.777610222 -0300
Birth: -
mount
Auszug:
/dev/sda on / type ext3 (rw,noatime,errors=remount-ro)
stat -f
:
File: "auth.log"
ID: 5483af2794a91010 Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 3870084 Free: 272230 Available: 75643
Inodes: Total: 923520 Free: 829980
root@mail:~# df -mT
Filesystem Type 1M-blocks Used Available Use% Mounted on
/dev/sda ext3 15118 14055 296 98% /
devtmpfs devtmpfs 1973 1 1973 1% /dev
none tmpfs 395 1 395 1% /run
none tmpfs 5 0 5 0% /run/lock
none tmpfs 1973 0 1973 0% /run/shm
Jetzt habe ich einen neuen VPS gekauft, ihn auf Ubuntu 20.04 (Pre-Beta) aktualisiert, er hat ein als ext4 gemountetes Dateisystem.
File: auth.log
Size: 723967 Blocks: 1424 IO Block: 4096 regular file
Device: ca03h/51715d Inode: 398412 Links: 1
Access: (0640/-rw-r-----) Uid: ( 104/ syslog) Gid: ( 4/ adm)
Access: 2020-03-24 00:00:05.676000000 -0300
Modify: 2020-03-24 05:14:56.644000000 -0300
Change: 2020-03-24 05:14:56.644000000 -0300
Birth: -
mount
Auszug:
/dev/xvda3 on / type ext4 (rw,noatime,nobarrier,errors=remount-ro,stripe=32564)
Aber seltsamerweise stat -f
heißt es, es sei ext3:
File: "auth.log"
ID: 7e8a03105e52b018 Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 9857995 Free: 7434726 Available: 7007355
Inodes: Total: 2505120 Free: 2403794
root@mailnew:~# df -mT
Filesystem Type 1M-blocks Used Available Use% Mounted on
udev devtmpfs 430 0 430 0% /dev
tmpfs tmpfs 95 2 94 2% /run
/dev/xvda3 ext4 38508 9466 27373 26% /
tmpfs tmpfs 473 0 473 0% /dev/shm
tmpfs tmpfs 5 0 5 0% /run/lock
tmpfs tmpfs 473 0 473 0% /sys/fs/cgroup
/dev/loop0 squashfs 54 54 0 100% /snap/lxd/11348
/dev/loop1 squashfs 92 92 0 100% /snap/core/8689
/dev/xvda1 ext4 727 183 502 27% /boot
tmpfs tmpfs 95 0 95 0% /run/user/0
Meine Fragen sind:
Warum unterstützt mein altes Ext3-System eine Präzision im Nanosekundenbereich?
Warum ist das neue ext4 auf Millisekunden beschränkt? Ist es stattdessen tatsächlich als ext3 formatiert?
Wie kann ich herausfinden, was falsch ist und Nanosekunden im neuen aktivieren?
Antwort1
Die tatsächliche Unterstützung für die Auflösung von Nanosekunden gegenüber Sekunden hängt von der Größe des Inodes ab, der beim Formatieren gewählt wurde. 128-Byte-Inodes unterstützen nur die Sekundenauflösung, 256-Byte-Inodes unterstützen die Nanosekundenauflösung. Der Ext3-Dateisystemtreiber im Kernel führt das Ext4-Modul tatsächlich schon seit vielen Jahren aus und unterstützt daher die Nanosekunden-Zeitstempel.
Was die Zeitstempel mit Millisekundenauflösung betrifft, ist dies wahrscheinlich darauf zurückzuführen, dass die Virtualisierung für das Dateisystem nur eine Uhr mit ms-Auflösung bereitstellt.