matzewe01 wrote:,
Der Unterschied zwischen der Angabe auf fdisk und df beruht auf dem Unterschied GIB zu GB + Partitionstabelle.
Nein. Die Partitionstabelle existiert wie bereits erwähnt nur einmal bzw. zweimal im Bootsektor.
Ich habe doch oben demonstiert, dass die Anzahl der echten bytes des Devices nicht der Anzahl Bytes entspricht die df ausgibt. df gibt nur die nutzbaren bytes aus (nach abzug des Overheads durch das Dateisystem), fdisk die physikalischen.
Also nochmal mit Erklärung:
Code: Select all
# dd if=/dev/zero of=file bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 26.0325 s, 41.2 MB/s
wir erstellen also ein Block Devices, dass genau 1073741824 (1024^3) Bytes hat.
Code: Select all
# mkfs.ext3 file
mke2fs 1.41.3 (12-Oct-2008)
file is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# mount -o loop file /mnt/tmp
weiterhin formatieren wir diese Devices mit ext3 und mounten es.
Code: Select all
# df /mnt/tmp -B1
Filesystem 1B-blocks Used Available Use% Mounted on
/dev/loop0 1056858112 34906112 968265728 4% /mnt/tmp
Hier geben wir uns die genaue Anzahl Bytes des Dateisystems aus: 1056858112 Bytes.
1056858112 bytes < 1073741824 bytes (+ 1,59 %) (Dateisystemgröße 1 GB)
Da hier keine Umrechnung G/M/K stattgefunden hat, gibt es auch keine Fehler. Eine Partitionstabelle sowieso nicht, da es sich ja um keine Partition handelt.
zum Vergleich nochmal reiserfs3.6
Code: Select all
# df /mnt/tmp -B1
Filesystem 1B-blocks Used Available Use% Mounted on
/dev/loop0 1073704960 33628160 1040076800 4% /mnt/tmp
1073704960 bytes < 1073741824 bytes (~ +/- 0 %) (Dateisystemgröße 1 GB)