title: Cloning a Bootable SD Card from Linux Using dd command
body: <p>I have a Raspberry Pi with the default, store-bought operating systems on it. I want to wipe the SD card clean so that I can put in a new operating system, but I want to preserve the original OS in a backup disc image. I planned to store it in a .bin file. The SD card has two partitions.</p>
  
  <p>I used the following command to figure out which drive is the SD card.</p>
  
  <pre><code>sudo dmesg | tail
  </code></pre>
  
  <p>--output--</p>
  
  <pre><code>[ 2954.642182] sd 3:0:0:0: [sdb] Attached SCSI removable disk _
  [ 2955.149750] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
  </code></pre>
  
  <p>I believe this tells me that it is under dev/sdb2, but I also tried dev/sdb, ~/dev/sdb and ~/dev/sdb2. I used the following command to create the image:</p>
  
  <pre><code>dd if="dev/sdb2" of="~/Desktop/Pi Backup/Pi.bin"
  </code></pre>
  
  <p>But when I try to do this it returns the error message</p>
  
  <pre><code>dd: opening `dev/sdb2': No such file or directory
  </code></pre>
  
  <p>I'm running Linux Mint, Cinnamon.</p>
  
  <p>Any help is appreciated.</p>