Browse Source

clean-up script for ceph-disks and data

Change-Id: I85898be92781e1fef2293b42186d00f06f600014
kranthikirang 2 weeks ago
parent
commit
6304cb2785
1 changed files with 22 additions and 0 deletions
  1. 22
    0
      tools/wipe-ceph-disks.sh

+ 22
- 0
tools/wipe-ceph-disks.sh View File

@@ -0,0 +1,22 @@
1
+#!/bin/bash
2
+
3
+if ([[ -z $1 ]] || [[ $1 == "help" ]] || [[ $1 == "--help" ]] || [[ $1 == "-h" ]]); then
4
+  echo "Must pass the disk labels as an string argument with spaces"
5
+  echo "Exmaple: ./wipe-ceph-disks.sh \"b c d e\""
6
+  exit 1
7
+fi
8
+
9
+read -p "Are you sure you wish to proceed format disks $1?" input
10
+case $input in
11
+    [Yy]*)
12
+        for disk in $@; do
13
+           sudo parted -s /dev/sd$disk mklabel gpt
14
+        done
15
+        sudo rm -rf /var/lib/openstack-helm/ceph
16
+        sudo rm -rf /var/lib/ceph/journal/*
17
+        ;;
18
+     *)
19
+        echo Exitting.
20
+        exit 1
21
+esac
22
+

Loading…
Cancel
Save