From ea30fc962049226e869171f69c6ab1879f9e7085 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Mon, 11 Dec 2023 11:43:05 -0600 Subject: image-tools: T5806: remove partition and disk signatures in cleanup --- python/vyos/system/disk.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python/vyos/system/disk.py') diff --git a/python/vyos/system/disk.py b/python/vyos/system/disk.py index f8e0fd1bf..b8a2c0f35 100644 --- a/python/vyos/system/disk.py +++ b/python/vyos/system/disk.py @@ -31,12 +31,17 @@ class DiskDetails: def disk_cleanup(drive_path: str) -> None: """Clean up disk partition table (MBR and GPT) + Remove partition and device signatures. Zeroize primary and secondary headers - first and last 17408 bytes (512 bytes * 34 LBA) on a drive Args: drive_path (str): path to a drive that needs to be cleaned """ + partitions: list[str] = partition_list(drive_path) + for partition in partitions: + run(f'wipefs -af {partition}') + run(f'wipefs -af {drive_path}') run(f'sgdisk -Z {drive_path}') -- cgit v1.2.3