Last active
January 15, 2016 01:25
-
-
Save pi-aej/f5813dbe9da6de08ac76 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# The sed script strips off all the comments so that we can | |
# document what we're doing in-line with the actual commands | |
# Note that a blank line (commented as "defualt" will send a empty | |
# line terminated with a newline to take the fdisk default. | |
sed -e 's/\t\([\+0-9a-zA-Z]*\)[ \t].*/\1/' << EOF | fdisk /dev/sdb | |
d # delete existing partition | |
n # new partition | |
p # primary partition | |
1 # partition number 1 | |
# default - start at beginning of disk | |
# default - end of disk | |
p # print the in-memory partition table | |
w # write the partition table | |
q # and we're done | |
EOF | |
partprobe | |
umount /dev/sdb1 | |
e2fsck /dev/sdb1 | |
resize2fs /dev/sdb1 | |
mount -a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment