What is it
RPI-Wiggle is a script which expands the smaller image that has been written to a larger SDCard and then expands the filesystem to the full size of the SDCard. However, it backs off just a bit to ensure that when you make a backup a copy of that SDCard, you can then save it to a like sized SDCard.
Raspbian OS comes with a tool which does this called raspi-config, but when it expands, it uses the full size of the SDCard which when backed up many times results in an image that can't be then written to like sized SDcards. This means you have no way to restore it except to use a larger SDCard (If you are already at 32GB, your out of luck). You can use Linux to repartition the filesystems, but the rpi-wiggle script keeps you in the Windows world for the many that don't have Linux.
You would use this script instead of the function built into the raspi-config.Related Content:
How does it work.
Basically it does the same thing the raspi-config does... it looks at the current SDCard and then caculates the size of the card. This script then calculates the end of that card and backs off the number a bit to make it slightly smaller.
It then uses the fdisk command to set the size of the SDCard filesystems.
When completed with that, it creates a reboot command which will run once when the system is rebooted. REBOOTING IS REQUIRED.
The script stops with a prompt for the user to press ENTER to reboot the system
When the system reboots, the run once script is then executed and uses the resize2fs function to expand the file system of the unmounted /root filesystem to complete the process. This part of the script can take minutes depending on how large the the SDCard you are expanding to. For example, a 16GB card took long enough that the screen saver blank actually turned the monitor off requiring the use of a key on the keyboard to get the screen back on.
When that is completed, the once run script is removed and the boot process continue to the Login prompt. You are done at the point.Sample before: This was an 8GB image on a 16GB SDcard
rootfs 7.4G 1.7G 5.3G 24% /
/dev/root 7.4G 1.7G 5.3G 24% /
rootfs 15G 1.7G 12G 13% /
/dev/root 15G 1.7G 12G 13% /
- This script has been tested on Rasbian Wheezy (2012-08-16-wheezy-raspbian). It has been tested on upgraded firmware versions as well.
- Should ONLY be run on an SDCard where the image has not already been expanded. IF you have already expanded the system using the raspi-config utility, you can't use this script. Reducing the filesystem requires a different process.
- This has only been tested using the command line. No idea if it will work or what will happen if you are using the GUI (Startx).
Technically, this script should not destroy anything. If it attempts to change the size to something that is not there, it won't do it. Resizing down can't work without removing the filesystem first, but this script will not attempt to do that. Regardless....
USE AT YOUR OWN RISK. If you have anything important on the SDcard you can't be without, save it to another source first.
Where is the scriptNormally, I create a directory called /src to put scripts like this into. If you have this or something similar, cd to that directory and then...
You can also download the script and place it into /boot if you are mounting this in your windows box. Permissions do not need to be set since it will be run as root.
How to use the script
THIS SCRIPT SHOULD ONLY BE RUN ONCE.
Running the script more than once could lead to the system attempting to make the image smaller... This won't work and will have unknown consequences.
- cd to the source directory you put the script into
- Execute the following commands
- When the script finishes, (this part is very quick)... Press Enter to have the system reboot.
- When the system reboots, you can watch the screen. There will come a point where the following text will show:
DO NOT INTERRUPT THE PROCESS... just let it run.
This will take a while depending on the size of the SDcard you are expanding to. A 16GB card was taking a good 7+ minutes. A 32GB hard will take significantly more.
Checking the status
To see if it is still working... you look at the activity light on the Raspberry Pi. It will either be on solid or on most of the time flickering. If it goes out for a long period of time... something is wrong.
When it completes...
When it is done, the light will go out and then blink as normal as the system continues on with the boot process.
You will end up at the Login prompt and the process will be complete.
At that point, it is done with no further steps to complete.
Login as normal and you should now have the root filesystem expanded to use the new size of the SDCard you put it on.