We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2a86bc commit 38b3ba0Copy full SHA for 38b3ba0
scripts/cleanup-nvme.sh
@@ -0,0 +1,15 @@
1
+#!/bin/bash
2
+
3
+DISK="/dev/nvme0n1"
4
5
+# Zap the disk to a fresh, usable state (zap-all is important, b/c MBR has to be clean)
6
+sgdisk --zap-all $DISK
7
8
+# Wipe a large portion of the beginning of the disk to remove more LVM metadata that may be present
9
+dd if=/dev/zero of="$DISK" bs=1M count=100 oflag=direct,dsync
10
11
+# SSDs may be better cleaned with blkdiscard instead of dd
12
+blkdiscard $DISK
13
14
+# Inform the OS of partition table changes
15
+partprobe $DISK
0 commit comments