Skip to content

Instantly share code, notes, and snippets.

Created March 30, 2016 05:38
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanhalt/baffe5becd1914867b9caad40db73f50 to your computer and use it in GitHub Desktop.
Save vanhalt/baffe5becd1914867b9caad40db73f50 to your computer and use it in GitHub Desktop.
Kali Linux ARM (kali-2.1.2-rpi2.img) running on Raspberry 3 with a 32GB micro sd


Installation steps:

ARM download site:

If dding from OSX do the following for speed:

$ dd bs=1m if=kali-2.1.2-rpi2.img of=/dev/rdisk2
7000+0 records in
7000+0 records out
7340032000 bytes transferred in 514.267776 secs (14272782 bytes/sec) # fast!

I had a 32GB SD card, this image transform it to a 7GB memory. To fix to the following (inspired by this:

$ cd /boot

$ wget

# Check the partitions

# replace $PART_START with 125001 if fdisk -l shows:
/dev/mmcblk0p2      125001 60367871 60242871 28.7G 83 Linux

$ chmod -x

$ sh

$ reboot

After successful reboot, run:

$ resize2fs /dev/mmcblk0p2
# Taken from
# Resize the root filesystem of a newly flashed Raspbian image.
# Directly equivalent to the expand_rootfs section of raspi-config.
# No claims of originality are made.
# Mike Ray. Feb 2013. No warranty is implied. Use at your own risk.
# Run as root. Expands the root file system. After running this,
# reboot and give the resizefs-once script a few minutes to finish expanding the file system.
# Check the file system with 'df -h' once it has run and you should see a size
# close to the known size of your card.
# Get the starting offset of the root partition
PART_START=$(parted /dev/mmcblk0 -ms unit s p | grep "^2" | cut -f 2 -d:)
[ "$PART_START" ] || return 1
# Return value will likely be error for fdisk as it fails to reload the
# partition table because the root fs is mounted
fdisk /dev/mmcblk0 <<EOF
# now set up an init.d script
cat <<\EOF > /etc/init.d/resize2fs_once &&
# Provides: resize2fs_once
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5 S
# Default-Stop:
# Short-Description: Resize the root filesystem to fill partition
# Description:
. /lib/lsb/init-functions
case "$1" in
log_daemon_msg "Starting resize2fs_once" &&
resize2fs /dev/mmcblk0p2 &&
rm /etc/init.d/resize2fs_once &&
update-rc.d resize2fs_once remove &&
log_end_msg $?
echo "Usage: $0 start" >&2
exit 3
chmod +x /etc/init.d/resize2fs_once &&
update-rc.d resize2fs_once defaults &&
echo "Root partition has been resized. The filesystem will be enlarged upon the next reboot"
Copy link

ghost commented Oct 12, 2016

Nice ! Thank you !

Copy link

Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment