ext3 vs ext4 - mesmo tamanho de disco, menos espaço em disco utilizável sob ext4 comparando com ext3. porque?

3

Os arquivos copiados do sistema de arquivos ext3 não se encaixam no sistema de arquivos ext4 do mesmo tamanho.

Como reproduzir:

crie dois arquivos de 1 GB,

dispositivo de loop de configuração para cada,

crie um sistema de arquivos, um ext3, um ext4,

montar,

arquivos rsync de / usr / lib para a pasta ext3 até ficarem completos,

tente rsync arquivos da pasta ext3 para o ext4, mas isso falha devido ao espaço em disco.

Eu esperaria que todos os arquivos da pasta ext3 se encaixem na pasta ext4

(veja log, o próximo arquivo a ser copiado é maior que o espaço disponível e ainda resta mais alguns arquivos para copiar)

Alguém pode explicar por quê? ou melhor o que fazer para obter o mesmo ou mais espaço em disco usando o ext4?

este é o sistema debian8

root@blackoil:~#  uname -a
Linux blackoil 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt7-1 (2015-03-01) x86_64 GNU/Linux


root@blackoil:~# dd if=/dev/zero of=e3fs bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 6.07722 s, 173 MB/s


root@blackoil:~# dd if=/dev/zero of=e4fs bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 6.21495 s, 169 MB/s



root@blackoil:~# losetup /dev/loop3 e3fs
root@blackoil:~# losetup /dev/loop4 e4fs
root@blackoil:~# mkfs.ext3 -m 0 /dev/loop3



mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done                            
Creating filesystem with 256000 4k blocks and 64000 inodes
Filesystem UUID: 8871cd27-5c82-4fa9-acaa-11c2ca200d08
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done



root@blackoil:~# mkfs.ext4 /dev/loop4
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done                            
Creating filesystem with 256000 4k blocks and 64000 inodes
Filesystem UUID: 71b69de9-0858-4189-8e1f-907efd61f51d
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done



root@blackoil:~# mkdir -p /mnt/e3
root@blackoil:~# mkdir -p /mnt/e4



root@blackoil:~# dumpe2fs /dev/loop3
dumpe2fs 1.42.12 (29-Aug-2014)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          8871cd27-5c82-4fa9-acaa-11c2ca200d08
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              64000
Block count:              256000
Reserved block count:     0
Free blocks:              247557
Free inodes:              63989
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      62
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8000
Inode blocks per group:   500
Filesystem created:       Mon Jul 20 15:21:53 2015
Last mount time:          n/a
Last write time:          Mon Jul 20 15:21:53 2015
Mount count:              0
Maximum mount count:      -1
Last checked:             Mon Jul 20 15:21:53 2015
Check interval:           0 (<none>)
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      a35b09fe-b755-49b6-a94d-eb8f2960e5a6
Journal backup:           inode blocks
Journal features:         (none)
Journal size:             16M
Journal length:           4096
Journal sequence:         0x00000001
Journal start:            0



root@blackoil:~# dumpe2fs /dev/loop4
dumpe2fs 1.42.12 (29-Aug-2014)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          71b69de9-0858-4189-8e1f-907efd61f51d
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              64000
Block count:              256000
Reserved block count:     12800
Free blocks:              247562
Free inodes:              63989
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      62
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8000
Inode blocks per group:   500
Flex block group size:    16
Filesystem created:       Mon Jul 20 15:22:16 2015
Last mount time:          n/a
Last write time:          Mon Jul 20 15:22:16 2015
Mount count:              0
Maximum mount count:      -1
Last checked:             Mon Jul 20 15:22:16 2015
Check interval:           0 (<none>)
Lifetime writes:          16 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      33846c93-9d1a-4117-a7c8-1566e96e8e73
Journal backup:           inode blocks
Journal features:         (none)
Journal size:             16M
Journal length:           4096
Journal sequence:         0x00000001
Journal start:            0




root@blackoil:~# mount /dev/loop3 /mnt/e3
root@blackoil:~# mount /dev/loop4 /mnt/e4


root@blackoil:~# rsync -a /usr/lib /mnt/e3
rsync: recv_generator: mkdir "/mnt/e3/lib/python2.6/xml/sax" failed: No space left on device (28)
*** Skipping any contents from this failed directory ***
rsync: write failed on "/mnt/e3/lib/python2.6/httplib.py": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.1]


root@blackoil:~# df |grep '/mnt/e'
/dev/loop3            991512    991512         0 100% /mnt/e3
/dev/loop4            991512      1264    922664   1% /mnt/e4

root@blackoil:~# cd /mnt/e3

root@blackoil:/mnt/e3# rsync -a . /mnt/e4
rsync: write failed on "/mnt/e4/lib/pepperflashplugin-nonfree/libpepflashplayer.so": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.1]

root@blackoil:/mnt/e3# df | grep '/mnt/e'
/dev/loop3            991512    991512         0 100% /mnt/e3
/dev/loop4            991512    959372         0 100% /mnt/e4
root@blackoil:/mnt/e3# df -i | grep '/mnt/e'
/dev/loop3            64000    8939    55061   14% /mnt/e3
/dev/loop4            64000    8531    55469   14% /mnt/e4

root@blackoil:/mnt/e3# rsync -av . /mnt/e4
sending incremental file list
lib/pepperflashplugin-nonfree/
lib/pepperflashplugin-nonfree/libpepflashplayer.so
lib/pepperflashplugin-nonfree/manifest.json
lib/pepperflashplugin-nonfree/pubkey-google.txt
lib/pkgconfig/dbus-python.pc
lib/pkgconfig/geoclue-2.0.pc
lib/pkgconfig/gnome-system-tools.pc
lib/pkgconfig/keybinder.pc
lib/pkgconfig/libgdiplus.pc
lib/pkgconfig/libquvi-scripts.pc
lib/pkgconfig/libwnck-1.0.pc
lib/pkgconfig/libxfce4menu-0.1.pc
lib/pkgconfig/libxklavier.pc
lib/pkgconfig/notify-python.pc
lib/pkgconfig/pm-utils.pc
lib/pkgconfig/tomboy-addins.pc
lib/pkgconfig/unique-1.0.pc
lib/pkgconfig/xkbcomp.pc
lib/pkgconfig/xorg-wacom.pc
lib/pm-utils/

( ......   some removed due to 30000 lines limit posting question)

rsync: write failed on "/mnt/e4/lib/pepperflashplugin-nonfree/libpepflashplayer.so": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.1]

root@blackoil:/mnt/e3# df |grep 'mnt/e'
/dev/loop3            991512    991512         0 100% /mnt/e3
/dev/loop4            991512    959372         0 100% /mnt/e4

root@blackoil:/mnt/e3# ls -l /mnt/e4/lib/pepperflashplugin-nonfree/libpepflashplayer.so
ls: cannot access /mnt/e4/lib/pepperflashplugin-nonfree
/libpepflashplayer.so: No such file or directory


root@blackoil:/mnt/e3# ls -l lib/pepperflashplugin-nonfree/libpepflashplayer.so
-rw-r--r-- 1 root root 17370752 Mar 14 09:08 lib/pepperflashplugin-nonfree/libpepflashplayer.so


root@blackoil:/mnt/e3# mount |grep 'mnt/e'
/dev/loop3 on /mnt/e3 type ext3 (rw,relatime,data=ordered)
/dev/loop4 on /mnt/e4 type ext4 (rw,relatime,data=ordered)
    
por lepoitr 20.07.2015 / 16:05

1 resposta

0

Está na sua contagem de blocos de reserva:

ext3: Contagem em bloco: 256000 Contagem de blocos reservados: 0

ext4: Contagem em bloco: 256000 Contagem de blocos reservados: 12800

a correção: # tune2fs -m 0 e4fs

    
por 20.07.2015 / 19:33