Advertisement
Guest User

Cloning SD cards notes

a guest
May 29th, 2025
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. # Creating the Backup
  2. 1. Download 'win32diskimager'
  3. 2. install it
  4. 3. run it
  5.  
  6. In the imager:
  7. 1. click the folder icon
  8. 2. select a folder to create the image in
  9. 3. type an image name
  10.  
  11. Then:
  12. 1. click the 'Read' button
  13.  
  14. Be patient this will take a good while depending on SD card size and speed.
  15.  
  16. ## Shrinking Image size with PiShsrink
  17.  
  18. ### Installation
  19. #### Windows preperation
  20. 1. Install WLS 2 on windows using this command:
  21.  
  22. ```powershell
  23. wls --install
  24. ```
  25.  
  26. 2. Go to the microsoft store and install 'Ubuntu' and 'windows terminal'
  27. 3. Launch ubuntu and follow the prompts
  28. 4. it will ask you to restart do it
  29. 5. Upon restart you should see a terminal pop up that installs ubuntu (if not start ubuntu app or open an ubuntu shell in 'windows teminal' by right clicking the new tab
  30. #### Pishrink
  31. 1. Go to 'https://github.com/Drewsif/PiShrink' and donwload the script
  32. 2. Extract it
  33. 3. Copy paste the contents to the image directory (the folder you saved the image file in)
  34. 4. Open an ubuntu shell using the windows terminal
  35. 5. type the following commands
  36. ```bash
  37. sudo apt update
  38. sudo apt install parted
  39. ```
  40.  
  41. #### Usage
  42. 1. Launch a new ubuntu shell
  43. 2. cd to the directory of your image and pishrink files (my case external drive e:)
  44. 3. Type the following commands
  45. ```bash
  46. cd ./
  47. cd mnt
  48. cd e/ #your drive letter
  49. ls #view the folders
  50. cd 'Mainsail sd clone' #your image containing folder
  51. ```
  52. Your directory should now be:
  53. ```bash
  54. user@desktop-a35sdf:/mnt/e/mainsail sd clone
  55. ```
  56. 4. Now run this command:
  57. ```bash
  58. sudo ./ pishrink.sh image_file_name.img
  59. ```
  60. Let the script do its thing and don't close the terminal, restart the computer or remove the drive
  61.  
  62. When done you should see a message stating the following:
  63. `pishrink.sh: Shrunk image_file_name.img fom 60G to 7.6G`
  64.  
  65. ## Restoration
  66.  
  67. 1. Get a fresh SD card that's the same capacity or more
  68. 2. Format it to fat32 (for Nintendo switch use guiformat tool)
  69. 3. Boot win32diskimager
  70. 4. Select the image file
  71. 5. Select the new SD card drive
  72. 6. Click write
  73.  
  74. Be patient.
  75.  
  76. # Do not remove the SD when imager or script is running
  77. # Make sure the PC is plugged in before you attempt this and charged above 70%
  78. # Do not format the SD when the system asks
  79. # Do not power off the PC
  80.  
  81. ==Source:== https://www.youtube.com/watch?v=77vOeofG0Kg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement