0525.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  12. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  13. <script type="text/javascript" src="includes/js/steps.js"></script>
  14. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  15. </head>
  16. <body>
  17. <div id="gridContainer">
  18. <div class="topMargin"></div>
  19. <div id="listName" class="topMargin">
  20. <h1>Creating a Disk Image on Linux Using DD</h1>
  21. </div>
  22. <div></div>
  23. <div id="content">
  24. <h2>Creating An Image</h2>
  25. <ol>
  26. <li>Insert the SD card or USB flash drive to make an image of</li>
  27. <li>Run the following commands in a terminal window:
  28. <div class="codeBlock"># list out disks<br />
  29. sudo fdisk -l<br />
  30. # run the following to create a .img, replace sdb with the correct source disk<br />
  31. sudo dd if=/dev/sdb of=~/flashstorage.img status=progress<br />
  32. # run the following to create a compressed img, replace sdb with the correct source disk<br />
  33. sudo dd if=/dev/sdb status=progress | gzip -c &gt;~/flashstorage.img.gz</div>
  34. </li>
  35. </ol>
  36. <h2>Restoring An Image</h2>
  37. <ol>
  38. <li>Insert the SD card or USB flash drive to make an image of</li>
  39. <li>Run the following commands in a terminal window:
  40. <div class="codeBlock"># list out disks<br />
  41. sudo fdisk -l<br />
  42. # run the following to restore an .img to the target device<br />
  43. # replace sdb with the correct source disk<br />
  44. # MAKE ABSOLUTELY CERTAIN THE OUTPUT TARGET IS CORRECT<br />
  45. # OR YOU COULD POTENTIAL DAMAGE YOUR OS<br />
  46. # restore img<br />
  47. sudo dd if=~/flashstorage.img of=/dev/sdb bs=4M status=progress<br />
  48. # restore gzipped img<br />
  49. gunzip -c ~/flashstorage.img.gz | sudo dd of=/dev/sdb bs=4M status=progress</div>
  50. </li>
  51. </ol>
  52. </div>
  53. </div>
  54. </body>
  55. </html>