2

I'm just curious about why the dd command is limiting the size of a dummy file to about 2.1GB

[aesteban@localhost ~]$ dd if=/dev/zero of=test.img bs=3G count=1
0+1 records in
0+1 records out
2147479552 bytes (2.1 GB) copied, 10.0044 s, 215 MB/s
[aesteban@localhost ~]$ ls -sh test.img 
2.0G test.img

I seen above I specified 3GB but the file is only 2.1GB, any ideas ?

Thanks

angelcool.net
  • 2,505
  • 1
  • 24
  • 26
  • 1
    Which filesystem do you use ? Each of them has its own limits, FAT for example will hit the 2GB limit. And out of curiosity: what happens when you specify `bs=1G` and `count=4` ? – Marged Oct 14 '15 at 20:03
  • looks like ext4 per `df -ht`, changing the count to 2 made the file 4GB :) so it seems to be a `dd` thing. – angelcool.net Oct 14 '15 at 20:59

2 Answers2

8

I can suppose that that's a limitation of dd buffer size, just try to split it by setting bs=1Gb count=3

Sergey Sosnin
  • 1,313
  • 13
  • 30
3

In order to use files larger than 2GB, you need kernel support, filesystem support, and usually application support. If any of those requirements are not met, you can't exceed 2GB.

This answer from serverfault may be of help.

Community
  • 1
  • 1
Dan Lowe
  • 51,713
  • 20
  • 123
  • 112