From: Michael Tremer Date: Mon, 9 May 2022 16:55:19 +0000 (+0000) Subject: disk: Use wipefs(8) to remove any previous signatures X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4370f63d1f40479564d5457859d69c03449bf0c;p=people%2Fms%2Fbricklayer.git 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 --- 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): """