Por que diretórios com muitos arquivos diferentes ocupam mais espaço no meu SSD externo do que no meu disco raiz?

0

Eu tenho um disco raiz (SSD) em um MacBook Pro e um SSD externo. Eu tenho alguns diretórios que contêm muitos milhares de arquivos de imagem, e ao copiar estes para o SSD externo, notei que o que ocupa 22GB no meu disco de raiz leva mais de 130GB no meu SSD externo.

Aqui está um exemplo de saída

Disco Raiz:

$ du -h -d 1 .
451M    ./bbox_train

$ ls -lsh MARS/0001/'
16 -rw-r--r--@ 1 john  staff   5.5K Aug  7  2016 0001C6T0187F073.jpg
16 -rw-r--r--@ 1 john  staff   5.6K Aug  7  2016 0001C6T0187F074.jpg
16 -rw-r--r--@ 1 john  staff   5.4K Aug  7  2016 0001C6T0187F075.jpg
16 -rw-r--r--@ 1 john  staff   5.4K Aug  7  2016 0001C6T0187F076.jpg
16 -rw-r--r--@ 1 john  staff   5.2K Aug  7  2016 0001C6T0187F077.jpg
16 -rw-r--r--@ 1 john  staff   5.4K Aug  7  2016 0001C6T0187F078.jpg
16 -rw-r--r--@ 1 john  staff   5.4K Aug  7  2016 0001C6T0187F079.jpg
16 -rw-r--r--@ 1 john  staff   5.3K Aug  7  2016 0001C6T0187F080.jpg
16 -rw-r--r--@ 1 john  staff   5.3K Aug  7  2016 0001C6T0187F081.jpg
16 -rw-r--r--@ 1 john  staff   5.4K Aug  7  2016 0001C6T0187F082.jpg
16 -rw-r--r--@ 1 john  staff   5.4K Aug  7  2016 0001C6T0187F083.jpg
16 -rw-r--r--@ 1 john  staff   5.7K Aug  7  2016 0001C6T0187F084.jpg
16 -rw-r--r--@ 1 john  staff   5.4K Aug  7  2016 0001C6T0187F085.jpg
16 -rw-r--r--@ 1 john  staff   5.5K Aug  7  2016 0001C6T0187F086.jpg
16 -rw-r--r--@ 1 john  staff   5.4K Aug  7  2016 0001C6T0187F087.jpg
16 -rw-r--r--@ 1 john  staff   5.4K Aug  7  2016 0001C6T0187F088.jpg
16 -rw-r--r--@ 1 john  staff   5.4K Aug  7  2016 0001C6T0187F089.jpg
16 -rw-r--r--@ 1 john  staff   5.2K Aug  7  2016 0001C6T0187F090.jpg
16 -rw-r--r--@ 1 john  staff   5.0K Aug  7  2016 0001C6T0187F091.jpg

$ ls -1 bbox_train/0001 | wc -l
    9378

Drive externo:

$ ls -lsh MARS/bbox_train/0001
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 17:59 0001C6T0187F069.jpg
256 -rwxrwxrwx@ 1 john  staff   5.7K Aug 15 17:59 0001C6T0187F070.jpg
256 -rwxrwxrwx@ 1 john  staff   5.6K Aug 15 17:59 0001C6T0187F071.jpg
256 -rwxrwxrwx@ 1 john  staff   5.6K Aug 15 17:59 0001C6T0187F072.jpg
256 -rwxrwxrwx@ 1 john  staff   5.5K Aug 15 17:59 0001C6T0187F073.jpg
256 -rwxrwxrwx@ 1 john  staff   5.6K Aug 15 17:59 0001C6T0187F074.jpg
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 17:59 0001C6T0187F075.jpg
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 17:59 0001C6T0187F076.jpg
256 -rwxrwxrwx@ 1 john  staff   5.2K Aug 15 17:59 0001C6T0187F077.jpg
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 18:00 0001C6T0187F078.jpg
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 18:00 0001C6T0187F079.jpg
256 -rwxrwxrwx@ 1 john  staff   5.3K Aug 15 17:59 0001C6T0187F080.jpg
256 -rwxrwxrwx@ 1 john  staff   5.3K Aug 15 17:59 0001C6T0187F081.jpg
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 17:59 0001C6T0187F082.jpg
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 17:59 0001C6T0187F083.jpg
256 -rwxrwxrwx@ 1 john  staff   5.7K Aug 15 17:59 0001C6T0187F084.jpg
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 18:00 0001C6T0187F085.jpg
256 -rwxrwxrwx@ 1 john  staff   5.5K Aug 15 18:00 0001C6T0187F086.jpg
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 18:00 0001C6T0187F087.jpg
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 17:59 0001C6T0187F088.jpg
256 -rwxrwxrwx@ 1 john  staff   5.4K Aug 15 17:59 0001C6T0187F089.jpg
256 -rwxrwxrwx@ 1 john  staff   5.2K Aug 15 17:59 0001C6T0187F090.jpg
256 -rwxrwxrwx@ 1 john  staff   5.0K Aug 15 18:00 0001C6T0187F091.jpg

$ du -h -d  1 .
 14G    ./bbox_train

$ ls -1 bbox_train/0001 | wc -l
    9378

para que eles tenham o mesmo número de arquivos e os arquivos tenham o mesmo tamanho, mas os diretórios têm tamanhos massivamente diferentes. Percebo que o número de blocos usados como reportado por ls -s é diferente, 16 vs 256, o que está acontecendo aqui?

editar -

$ sudo fdisk -d /dev/disk3s2
-185273100,-185273100,0xF4,-,1012,244,52,1012,244,52
-185273100,-185273100,0xF4,-,1012,244,52,1012,244,52
-185273100,-185273100,0xF4,-,1012,244,52,1012,244,52
-185273100,-185273100,0xF4,-,1012,244,52,1012,244,52
    
por John Allard 16.08.2018 / 03:46

0 respostas