Skip to content

Instantly share code, notes, and snippets.

View ndmgrphc's full-sized avatar

Aaron P. ndmgrphc

View GitHub Profile
@dkebler
dkebler / rock64shrink.sh
Last active March 4, 2023 22:45
Bash Script for Shrinking/Truncating a disk image
#!/bin/bash
# WARNING this script could easily trash a image or worse a device. DO NOT USE IT WITH A DEVICE
# It will make a copy of the image to work on by default unless you use the -o option
# which you should NOT unless your image is much bigger than >16GB
# In other words test it on a disk image file that could be damaged.
# Use the -h option to see list of options
# You MUST use -t to do the last step truncation