#!/bin/sh
#Unmount the current partitions
umount /dev/sdb1
umount /dev/sdb2
umount /dev/sdb3
#Remove the current partitions
parted /dev/sdb -s rm 1
parted /dev/sdb -s rm 2
parted /dev/sdb -s rm 3
parted /dev/sdb -s rm 4
#Create the partitions
parted /dev/sdb -s mkpart primary 512B 32MB 
parted /dev/sdb -s mkpart primary 32MB 1300MB
parted /dev/sdb -s mkpart primary 1300MB 1800MB
parted /dev/sdb -s mkpart primary 1800MB 1928MB
#Format the partitions
mkdosfs /dev/sdb1 -n kernel
mke2fs -t ext4 /dev/sdb2 -L rootfs
mke2fs -t ext4 /dev/sdb3 -L data
mkswap /dev/sdb4 -L swap

