How to Backup and Shrink Images from My SD Card [Raspberry Pi Armbian]

HomeOther ContentHow to Backup and Shrink Images from My SD Card [Raspberry Pi Armbian]
How to Backup and Shrink Images from My SD Card [Raspberry Pi Armbian]
How to Backup and Shrink Images from My SD Card [Raspberry Pi Armbian]
#Compact #Backup #Reduce #SDCards

Full steps can be found at https://i12bretro.github.io/tutorials/0735.html

————————————————– ——————-
What is Win32DiskImager?
————————————————– ——————-
[Win32DiskImager] is designed to write a raw disk image to a removable device or save a removable device to a raw image file. It is very useful for embedded development, namely Arm development projects (Android, Ubuntu on Arm, etc.). – https://sourceforge.net/projects/win32diskimager/

————————————————– ——————-
Things you will need
————————————————– ——————-
– A microSD card to back up https://amzn.to/36CpShC https://amzn.to/3CXJngt https://amzn.to/3JqyxSP
– A VirtualBox VM based on Linux https://youtu.be/V4pNO3amhV4 https://youtu.be/wIa07KhkQOg https://youtu.be/mmTCh1NG3AM

————————————————– ——————-
Creating the base image
————————————————– ——————-
01. Insert SD card into Windows PC
02. Download Win32DiskImager https://sourceforge.net/projects/win32diskimager/files/Archive/Win32DiskImager-1.0.0-binary.zip/download
03. Extract the downloaded .zip file
04. Run Win32DiskImager.exe
05. Select the SD card from the Device drop-down list
06. Click the folder icon Browse to a location to save the SD card image Enter a file name Click Open
07. Click the Play button at the bottom of the application window
08. Wait for the image contents of the SD card to be read

————————————————– ——————-
What is PiShrink?
————————————————– ——————-
PiShrink is a bash script that automatically shrinks a pi image which will then be resized to the maximum SD card size on startup. This will get the image back onto the SD card faster and the reduced images will be better compressed. Additionally, the reduced image can be compressed with gzip and xz to create an even smaller image. Parallel image compression using multiple cores is supported. – https://github.com/Drewsif/PiShrink

————————————————– ——————-
Shrink image partitions
————————————————– ——————-
01. Launch VirtualBox
02. Select shared folders of Linux based VM settings
03. Click the Add Share icon on the right
04. Click the Folder Path Other… drop-down list. Navigate to the folder containing the Win32DiskImager .img file.
05. Check the Automount box, set the mount point to /host and check the Make permanent box. Click OK.
06. Right-click Start VM
07. Log in to the guest operating system
08. Launch a terminal and run the following commands
# installation prerequisites
sudo apt install separate xz-utils
# download the pishrink script
wget -O ./pishrink.sh https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
# Make the script executable
chmod x ./pishrink.sh
# run pishrink on the .img file
sudo ./pishrink.sh -v /host/%imagename.img%
09. PiShrink should finish in just a minute or two
10. If no errors occurred, shut down the VM

————————————————– ——————-
Compress the image further
————————————————– ——————-
01. Download and install 7-zip https://www.7-zip.org/download.html
02. Right click on the reduced 7-Zip .img file Add to Archive…
03. Set Archive Format to xz and Compression Level to 9 – Ultra Click OK
04. Wait for 7-Zip to compress the .img file

### Connect with me and others ###
Discord: https://discord.com/invite/EzenvmSHW8
Reddit: https://reddit.com/r/i12bretro
Twitter: https://twitter.com/i12bretro

Please take the opportunity to connect and share this video with your friends and family if you find it useful.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *