From 1ee17c38e31285dc86d87487b865dc0936533f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Wed, 20 Apr 2016 15:07:21 +0100 Subject: [PATCH] Clobber first 129 sectors of partition when deleting it. --- src/plugins/libparted/libpartedpartitiontable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/libparted/libpartedpartitiontable.cpp b/src/plugins/libparted/libpartedpartitiontable.cpp index 5b56a51..0ae992b 100644 --- a/src/plugins/libparted/libpartedpartitiontable.cpp +++ b/src/plugins/libparted/libpartedpartitiontable.cpp @@ -252,7 +252,8 @@ bool LibPartedPartitionTable::clobberFileSystem(Report& report, const Partition& if (pedPartition->type == PED_PARTITION_NORMAL || pedPartition->type == PED_PARTITION_LOGICAL) { if (ped_device_open(pedDevice())) { //reiser4 stores "ReIsEr4" at sector 128 with a sector size of 512 bytes - rval = ped_geometry_write(&pedPartition->geom, "0000000", 65536 / pedDevice()->sector_size, 1); + char zeroes[pedDevice()->sector_size*129] = {0}; + rval = ped_geometry_write(&pedPartition->geom, zeroes, 0, 129); if (!rval) report.line() << xi18nc("@info/plain", "Failed to erase filesystem signature on partition %1.", partition.deviceNode());