12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <!DOCTYPE html>
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Creating a Disk Image on Linux Using DD</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta charset="UTF-8">
- <meta name="keywords" content="Create SD Card Image,Create Disk Image,SD Cards,Raspberry Pi,Single Board Computer,SBC,Image,.img,DD,Linux,Debian,DD Command,DD Image,How To,Tutorial,i12bretro">
- <meta name="author" content="i12bretro">
- <meta name="description" content="Creating a Disk Image on Linux Using DD">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="revised" content="03/20/2022 12:23:29 PM" />
- <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript" src="includes/js/steps.js"></script>
- <link href="css/steps.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="gridContainer">
- <div class="topMargin"></div>
- <div id="listName" class="topMargin">
- <h1>Creating a Disk Image on Linux Using DD</h1>
- </div>
- <div></div>
- <div id="content">
- <h2>Things You Will Need</h2>
- <ul>
- <li>A USB flash drive <a href="https://amzn.to/3wkR5ju" target="_blank">https://amzn.to/3wkR5ju</a> | <a href="https://amzn.to/3qkrJ1p" target="_blank">https://amzn.to/3qkrJ1p</a> | <a href="https://amzn.to/3Nhu9b9" target="_blank">https://amzn.to/3Nhu9b9</a></li>
- <li>Or microSD card <a href="https://amzn.to/36CpShC" target="_blank">https://amzn.to/36CpShC</a> | <a href="https://amzn.to/3JqyxSP" target="_blank">https://amzn.to/3JqyxSP</a></li>
- </ul>
- <h2>Creating An Image</h2>
- <ol>
- <li>Insert the SD card or USB flash drive to make an image of</li>
- <li>Run the following commands in a terminal window:
- <div class="codeBlock"># list out disks<br />
- sudo fdisk -l<br />
- # run the following to create a .img, replace sdb with the correct source disk<br />
- sudo dd if=/dev/sdb of=~/flashstorage.img status=progress<br />
- # run the following to create a compressed img, replace sdb with the correct source disk<br />
- sudo dd if=/dev/sdb status=progress | gzip -c >~/flashstorage.img.gz</div>
- </li>
- </ol>
- <h2>Restoring An Image</h2>
- <ol>
- <li>Insert the SD card or USB flash drive to make an image of</li>
- <li>Run the following commands in a terminal window:
- <div class="codeBlock"># list out disks<br />
- sudo fdisk -l<br />
- # run the following to restore an .img to the target device<br />
- # replace sdb with the correct source disk<br />
- # MAKE ABSOLUTELY CERTAIN THE OUTPUT TARGET IS CORRECT<br />
- # OR YOU COULD POTENTIAL DAMAGE YOUR OS<br />
- # restore img<br />
- sudo dd if=~/flashstorage.img of=/dev/sdb bs=4M status=progress<br />
- # restore gzipped img<br />
- gunzip -c ~/flashstorage.img.gz | sudo dd of=/dev/sdb bs=4M status=progress</div>
- </li>
- </ol>
- </div>
- </div>
- </body>
- </html>
-
|