9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

dd のseek オプションで一瞬で大きなファイルを作る

Last updated at Posted at 2012-02-16

dd のseek オプションで一瞬でイメージが作れる
内容はなんになるかわからないけれど,ディスクイメージなどに使うのにはいい

$ time dd if=/dev/zero of=1G.img seek=1073741824 bs=1 count=1
1+0 記録始め
1+0 記録終わり
1 バイト (1 B) コピー終了, 5.9575e-05 s, 16.8 kB/s

real 0m0.011s
user 0m0.000s
sys 0m0.000s
$ ls -l 1G.img
-rw-r--r-- 1 mk mk 1073741825 2011-12-24 02:42 1G.img

これを知るまでは普通にこんな感じでやってた

$ nice -19 time dd if=/dev/zero of=1G.img bs=100M count=10
10+0 レコード入力
10+0 レコード出力
1048576000 バイト (1.0 GB) コピーされました、 9.19764 秒、 114 MB/秒
0.00user 2.27system 0:09.60elapsed 23%CPU (0avgtext+0avgdata 413664maxresident)k
0inputs+2048000outputs (0major+25912minor)pagefaults 0swaps

9
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?