summaryrefslogtreecommitdiffstats
path: root/format/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'format/format.c')
-rw-r--r--format/format.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/format/format.c b/format/format.c
index b3a47cdf..6799fd43 100644
--- a/format/format.c
+++ b/format/format.c
@@ -323,22 +323,11 @@ do_format (void)
/* Erase the disks. */
if (!wipe) {
- char **parts;
-
- /* No wipe, but get rid of LVM metadata by erasing each partition. */
- parts = guestfs_list_partitions (g);
- if (parts == NULL)
- exit (EXIT_FAILURE);
-
- for (i = 0; parts[i] != NULL; ++i) {
- if (guestfs_zero (g, parts[i]) == -1)
- exit (EXIT_FAILURE);
- free (parts[i]);
- }
- free (parts);
-
- /* Then erase the partition table on each device. */
for (i = 0; devices[i] != NULL; ++i) {
+ /* erase the filesystem signatures on each device */
+ if (guestfs_wipefs (g, devices[i]) == -1)
+ exit (EXIT_FAILURE);
+ /* Then erase the partition table on each device. */
if (guestfs_zero (g, devices[i]) == -1)
exit (EXIT_FAILURE);
}