Last active
November 12, 2015 22:56
-
-
Save raspberrypisig/db240138116c7806f46b to your computer and use it in GitHub Desktop.
Expand filesystem to fill up SD card on raspberry pi on non-raspbian distros like kali linux
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
sudo su | |
cat <<EOF > /etc/init.d/resize2fs_once | |
#!/bin/sh | |
### BEGIN INIT INFO | |
# 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: | |
### END INIT INFO | |
. /lib/lsb/init-functions | |
case "$1" in | |
start) | |
log_daemon_msg "Starting resize2fs_once" && | |
resize2fs /dev/root && | |
rm /etc/init.d/resize2fs_once && | |
update-rc.d resize2fs_once remove && | |
log_end_msg $? | |
;; | |
*) | |
echo "Usage: $0 start" >&2 | |
exit 3 | |
;; | |
esac | |
EOF | |
chmod +x /etc/init.d/resize2fs_once | |
update-rc.d resize2fs_once defaults |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment