ddでは面倒くさいので truncateコマンドを使う
dd if=/dev/urandom of=hoge.bin bs=100K count=1 status=none truncate -s 200K hoge.bin
これで後ろ100KBがスパースになっているファイルが作成可能
dd でやるときはこんな感じになる
dd if=/dev/urandom of=hoge.bin bs=100K count=1 status=none dd if=/dev/zero of=hoge.bin bs=1 count=1 conv=notrunc status=none seek=$((200*1024-1))
bs=1 count=1 で/dev/zero を1バイト書きこむが、書き込む前に一番ケツまでシークする。