From f4370f63d1f40479564d5457859d69c03449bf0c Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 9 May 2022 16:55:19 +0000 Subject: [PATCH] disk: Use wipefs(8) to remove any previous signatures wipefs(8) is a lot smarter than me trying to erase the first couple of blocks. Signed-off-by: Michael Tremer --- src/python/disk.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/python/disk.py b/src/python/disk.py index 0450b4f..916cce3 100644 --- a/src/python/disk.py +++ b/src/python/disk.py @@ -387,10 +387,8 @@ class Partition(object): """ log.info("Wiping %s (%s)..." % (self.name, self.path)) - zero = bytearray(1024) - - with open(self.path, "wb") as f: - f.write(zero) + # Wipes any previous signatures from this disk + self.bricklayer.command(["wipefs", "--all", self.path]) def format(self): """ -- 2.47.2