Skip to content

Instantly share code, notes, and snippets.

@checko
Created December 4, 2014 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save checko/2532242d43f507650b76 to your computer and use it in GitHub Desktop.
Save checko/2532242d43f507650b76 to your computer and use it in GitHub Desktop.
test, create partitions
#!/bin/bash
create_partition()
{
local part_type=$1
local part_num=$2
local part_size=$3
echo -n "create_partition($part_type, $part_num, $part_size)..."
case $part_type in
p|e|l);;
*)
echo $part_type not supported!;;
esac
echo "n
$part_type
$part_num
$part_size
wq " | fdisk -c -u /dev/sdc
}
create_partition p 1 +32M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment