0

I have a root disk (SSD) on a MacBook Pro and an external SSD. I have some directories that contain many thousands of image files, and while copying these to the external SSD, I noticed that what takes up 22GB on my root disk takes over 130GB on my external SSD.

Here's an example output

Root Disk:

$ 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

External Drive:

$ 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

so they have the same number of files and the files have the same size but the directories are massively different sizes. I notice that the number of blocks used as reported by ls -s is different, 16 vs 256, what's going on here?

edit -

$ 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
  • Please connect your USB drive and post the output of sudo fdsik -l – Winnie Tigger Aug 16 '18 at 5:30
  • @WinnieTigger I updated the comment, I'm on OSX so I had to do sudo fdisk -d /dev/disk3s2 instead but I believe it's equivalent – John Allard Aug 16 '18 at 17:30
  • check the cluster size and the file system used on each. also check out unix.stackexchange.com/questions/14409/… – ron Aug 16 '18 at 17:39
  • @JohnAllard My intention was to list your devices. I didn't know that MAC-OS do not support the -l parameter. Than with the device info I would suggest to use tune2fs -l /YOUR/DEVICE | grep Block. Than you can compare the block-size of the drives as Ron stated in his comment. Hopefully MAC-OS contains tune2fs. – Winnie Tigger Aug 17 '18 at 6:11
  • @WinnieTigger Last time I checked, macOS doesn't support EXT filesystems at all. It was HFS+, but now they use APFS. Still a Unixy filesystem, but not the Linuxy kind – Fox Aug 17 '18 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.