Last-modified: 2013-08-05 (月) 01:39:49
dd/基本操作

概要

ddの基本操作。

手順

  1. 前準備
    Everything is expanded.Everything is shortened.
      1
      2
      3
    
     
    -
    |
    
    umount [パス]
    #OSによって自動マウントポイントはまちまち(/mnt, /media, /Volumes, etc...)
    #既にマウント済みのものはdfで確認できる
    
  2. 実行
    Everything is expanded.Everything is shortened.
      1
      2
      3
      4
      5
      6
      7
    
    -
    |
    -
    -
    |
    -
    -
    
    dd if=[入力] of=[出力] ibs=[1度に読み込むバイトサイズ] obs=[1度に書き込むバイトサイズ] count=[ibs何個分のサイズをコピーする]
     
    # 例1./dev/sdbを/mnt/hoge/20130805.imgへコピー
    dd if=/dev/sdb of=/mnt/hoge/20130805.img
     
    # 例2./dev/sdbを512バイトずつ、15,728,640個分(512*15,728,640=7.5GB)、/mnt/hoge/20130805.imgへコピー    
    dd if=/dev/sdb of=/mnt/hoge/20130805.img ibs=512 count=15728640

検証時の環境

参考