mirror of
https://github.com/kneutron/ansitest.git
synced 2025-01-16 04:42:55 +08:00
Update mkgpt.sh
This commit is contained in:
parent
d443903566
commit
bc1f503efa
@ -2,8 +2,13 @@
|
||||
|
||||
# DEPENDS: smartctl, parted, fdisk
|
||||
|
||||
echo "Parameter: Supply short device name [sdb], etc"
|
||||
echo "MAKE SURE you supply the right disk device - author takes NO RESPONSIBILITY for data loss!"
|
||||
echo "Use at your own risk!"
|
||||
argg=$1
|
||||
|
||||
[ $(which parted |wc -l) -gt 0 ] || apt-get install -y parted
|
||||
|
||||
#source ~/bin/failexit.mrg
|
||||
# failexit.mrg
|
||||
function failexit () {
|
||||
@ -17,9 +22,11 @@ fdisk -l /dev/$argg
|
||||
|
||||
ls -l /dev/disk/by-id |grep $argg
|
||||
|
||||
echo "THIS WILL DESTRUCTIVELY APPLY A GPT LABEL - ARE YOU SURE - PK OR ^C"
|
||||
echo "THIS WILL DESTRUCTIVELY APPLY A GPT LABEL to /dev/$argg - ARE YOU SURE - Enter to proceed OR ^C"
|
||||
read
|
||||
|
||||
parted -s /dev/$argg mklabel gpt || failexit 99 "! Failed to apply GPT label to /dev/$argg"
|
||||
|
||||
fdisk -l /dev/$argg
|
||||
|
||||
exit;
|
||||
|
Loading…
x
Reference in New Issue
Block a user