X-Git-Url: https://git.sur5r.net/?p=bacula%2Frescue;a=blobdiff_plain;f=rescue%2Flinux%2Foldusb%2Fpartition_usb_key;fp=rescue%2Flinux%2Foldusb%2Fpartition_usb_key;h=6af5f5e949c876f21f993e1cdc4d3aa5060bbd7a;hp=0000000000000000000000000000000000000000;hb=fb21b5066e01a80263767f2406829a10dfa58303;hpb=0a3515b92eb06f0fee16cee0f189ae5aa83b4414 diff --git a/rescue/linux/oldusb/partition_usb_key b/rescue/linux/oldusb/partition_usb_key new file mode 100755 index 0000000..6af5f5e --- /dev/null +++ b/rescue/linux/oldusb/partition_usb_key @@ -0,0 +1,76 @@ +#!/bin/sh +# +# Partition the USB stick -- the stick is assumed to be at least 3GB in size +# +# First delete all existing partitions +# +. ./config + +if [ ! `whoami` = "root" ] ; then + echo "" + echo "You need to be root to run this shell script" + echo "" + exit 1 +fi +if [ "x$USB_DEV" = "x" ] ; then + if [ "x$1" = "x" ] ; then + echo "You must supply the USB device name on the command line or in USB_DEV" + exit 1 + else + USB_DEV=$1 + fi +fi +echo "This script will distroy everything on $dev" +fdisk -l $USB_DEV +echo " " +echo "Answer yes to continue " +read a +if [ "$a" != "yes" ] ; then + echo "Device $USB_DEV unchanged" + exit 1 +fi +sfdisk -l $USB_DEV >original-partitioning.txt +fdisk $USB_DEV <