From 6dce849f97d32370f0ea0810f35f9dc7b1213884 Mon Sep 17 00:00:00 2001 From: Marco van Zijl Date: Sun, 4 May 2025 11:49:07 +0200 Subject: [PATCH] Update README with additional disk preparation commands for Ceph --- readme.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index a0be16a..6ada6dc 100644 --- a/readme.md +++ b/readme.md @@ -189,11 +189,26 @@ kubectl run -it --rm \ --overrides='{"spec": { "nodeSelector": {"kubernetes.io/hostname": "master3"}}}' fix ``` -Then run the following commands: +Search for the correct disk with `blkid`, set `DISK=/dev/sdX`, then run (some of) the following commands: ```bash ceph-volume lvm zap /dev/sdX --destroy wipefs -a /dev/sdX +# Zap the disk to a fresh, usable state (zap-all is important, b/c MBR has to be clean) +sgdisk --zap-all $DISK + +# Wipe portions of the disk to remove more LVM metadata that may be present +dd if=/dev/zero of="$DISK" bs=1K count=200 oflag=direct,dsync seek=0 # Clear at offset 0 +dd if=/dev/zero of="$DISK" bs=1K count=200 oflag=direct,dsync seek=$((1 * 1024**2)) # Clear at offset 1GB +dd if=/dev/zero of="$DISK" bs=1K count=200 oflag=direct,dsync seek=$((10 * 1024**2)) # Clear at offset 10GB +dd if=/dev/zero of="$DISK" bs=1K count=200 oflag=direct,dsync seek=$((100 * 1024**2)) # Clear at offset 100GB +dd if=/dev/zero of="$DISK" bs=1K count=200 oflag=direct,dsync seek=$((1000 * 1024**2)) # Clear at offset 1000GB + +# SSDs may be better cleaned with blkdiscard instead of dd +blkdiscard $DISK + +# Inform the OS of partition table changes +partprobe $DISK ``` ### Certificate lifetimes