Use the DD command to create a 10 MB (10*1024*1024=10485760 bytes) size file named testfile_10MB
dd if=/dev/zero of=testfile_10MB bs=10485760 count=1
Byte sized tech know-how.
Use the DD command to create a 10 MB (10*1024*1024=10485760 bytes) size file named testfile_10MB
dd if=/dev/zero of=testfile_10MB bs=10485760 count=1
Copyright © 2024 Txt
I’d suggest you put the ‘bs=’ equal to that of your disk block size. That’ll help easier syncing… I don’t know why, but I suggest that is the best option.
dd if=/dev/zero of=test-dumb-file bs=1K count=100
and adjust via the ‘count=’ option
YMMV, I guess
I agree with Carb0n..
my reason is the bs size limit that i encountered making a 4GB file
dd if=/dev/zero bs=4G count=1
yields a 2GB file.. that too silently ! Imagine using it in a script and getting a wrong size !
dd if=/dev/zero bs=1K count=4M
yields a 4GB file.. just like I wanted
oops.. above commands need a of=foo .. sorry missed that
If you are limited to 4GB this may be because you have some 32bit limitation somewhere (OS architecture,or dd version compiled for 32bit only)
If the source code deal with signed integer, then the range will be from -2Gb to +2Gb which is a range of 4Gb (32bit) but in this case you may encounter limitation to 2Gb when creating your file.
2^32=4294967296