0525.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Creating a Disk Image on Linux Using DD</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <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">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Creating a Disk Image on Linux Using DD">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="03/20/2022 12:23:29 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Creating a Disk Image on Linux Using DD</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>Things You Will Need</h2>
  26. <ul>
  27. <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>
  28. <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>
  29. </ul>
  30. <h2>Creating An Image</h2>
  31. <ol>
  32. <li>Insert the SD card or USB flash drive to make an image of</li>
  33. <li>Run the following commands in a terminal window:
  34. <div class="codeBlock"># list out disks<br />
  35. sudo fdisk -l<br />
  36. # run the following to create a .img, replace sdb with the correct source disk<br />
  37. sudo dd if=/dev/sdb of=~/flashstorage.img status=progress<br />
  38. # run the following to create a compressed img, replace sdb with the correct source disk<br />
  39. sudo dd if=/dev/sdb status=progress | gzip -c &gt;~/flashstorage.img.gz</div>
  40. </li>
  41. </ol>
  42. <h2>Restoring An Image</h2>
  43. <ol>
  44. <li>Insert the SD card or USB flash drive to make an image of</li>
  45. <li>Run the following commands in a terminal window:
  46. <div class="codeBlock"># list out disks<br />
  47. sudo fdisk -l<br />
  48. # run the following to restore an .img to the target device<br />
  49. # replace sdb with the correct source disk<br />
  50. # MAKE ABSOLUTELY CERTAIN THE OUTPUT TARGET IS CORRECT<br />
  51. # OR YOU COULD POTENTIAL DAMAGE YOUR OS<br />
  52. # restore img<br />
  53. sudo dd if=~/flashstorage.img of=/dev/sdb bs=4M status=progress<br />
  54. # restore gzipped img<br />
  55. gunzip -c ~/flashstorage.img.gz | sudo dd of=/dev/sdb bs=4M status=progress</div>
  56. </li>
  57. </ol>
  58. </div>
  59. </div>
  60. </body>
  61. </html>