By default when Kali Linux for the Rapsberry Pi is installed the file system will only expand to occupy 3GB of storage, in my case I have a 16GB Micro SD card in my Raspberry Pi 2 with most of its capacity unused. One can easily expand the file system by making use of a script that automatically does the job for you. File system after install.
1 | df -h |
I should note I did not create the script and found it at the following address http://www.raspberryvi.org/wiki/doku.php/raspi-expand-rootfs but it has proven useful. Download the script into the boot directory. Locally hosted.
1 | wget -O /boot/raspi-expand-rootfs.sh http://dl.linhost.info/file1/raspi-expand-rootfs.sh |
Now we make the script executable.
1 | chmod +x /boot/raspi-expand-rootfs.sh |
And execute the script. Don’t be scared by the output.
1 | sh /boot/raspi-expand-rootfs.sh |
It is necessary to reboot the OS for the changes to take effect.
1 | reboot |
Once again us the df command to verify the file system successfully expanded.
1 | df -h |
If you like you can remove the script from the /boot directory.
1 | rm /boot/raspi-expand-rootfs.sh |
— May 4, 2015