Last active
February 16, 2022 15:43
-
-
Save gfrn/3c1706394a6a0d260991d4d48afc9448 to your computer and use it in GitHub Desktop.
Shrink disk image by removing unused space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modprobe loop | |
losetup -f | |
losetup /dev/loop0 image.img | |
partprobe /dev/loop0 | |
gparted /dev/loop0 | |
fdisk -l /dev/loop0 | |
truncate --size=$[(XXX+1)*512] image.img | |
losetup -d /dev/loop0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment