PiShrink is a bash script that automatically shrink a pi image that will then resize to the max size of the SD card on boot. This will make putting the image back onto the SD card faster and the shrunk images will compress better.
sudo pishrink.sh [-s] imagefile.img [newimagefile.img]
If the -s option is given the script will skip the autoexpanding part of the process. If you specify the newimagefile.img parameter, the script will make a copy of imagefile.img and work off that. You will need enough space to make a full copy of the image to use that option.
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh chmod +x pishrink.sh sudo mv pishrink.sh /usr/local/bin
curiosthedeadcat followed these instructions for setting this up in Windows. You will need a linux virtual machine.
- Install Ubuntu w/ VMPlayer via this link: https://www.htpcguides.com/install-ubuntu-virtual-machine-with-vmplayer-on-windows/
- Create a shared folder between Ubuntu and Windows: http://theholmesoffice.com/how-to-share-folders-between-windows-and-ubuntu-using-vmware-player/
- Copy both the .img and pishrink files into it.
- Go into Terminal within the directory both the pishrink and .img files are stored
- Enter command: sudo ./pishrink.sh [filename.img]
- Enter Password (if required)
Edit: Recent issues with Ubuntu 16.04.4 not recognizing the sudo vmware-config-tools.pl command forced me to track down this method to located a shared folder, originally found at https://askubuntu.com/questions/762755/no-vmhgfs-file-system-installed-to-use-use-shared-folder: $ sudo apt-get install git $ git clone https://github.com/rasa/vmware-tools-patches.git $ cd vmware-tools-patches $ sudo ./patched-open-vm-tools.sh