summaryrefslogtreecommitdiffstats
path: root/misc-utils/wipefs.c
diff options
context:
space:
mode:
authorKarel Zak2017-05-26 13:11:37 +0200
committerKarel Zak2017-06-28 10:28:41 +0200
commit92296e9ba2bf95259520fa7537ff8edc2aa9edbc (patch)
treef4e80ea53db450e94f9605f733be64cc7dfce90a /misc-utils/wipefs.c
parentlibblkid: allow to hide already detected signatures (diff)
downloadkernel-qcow2-util-linux-92296e9ba2bf95259520fa7537ff8edc2aa9edbc.tar.gz
kernel-qcow2-util-linux-92296e9ba2bf95259520fa7537ff8edc2aa9edbc.tar.xz
kernel-qcow2-util-linux-92296e9ba2bf95259520fa7537ff8edc2aa9edbc.zip
wipefs: print all signature permutations
The same FS/RAID/PT signature may be detected by more ways and on more places on the device. The libblkid returns only the first detected signature by default. This patch use blkid_probe_hide_range() to re-scan device for all possible permutations of the same signature. For example the default wipefs(8) output as well as --no-act output will contains primary as well as backup GPT signature now. Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/wipefs.c')
-rw-r--r--misc-utils/wipefs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c
index 87abba39b..e17d6b4a0 100644
--- a/misc-utils/wipefs.c
+++ b/misc-utils/wipefs.c
@@ -281,6 +281,10 @@ read_offsets(struct wipe_desc *wp, const char *devname)
wp = get_desc_for_probe(wp, pr);
if (!wp)
break;
+
+ /* hide last detected signature and scan again */
+ blkid_probe_hide_range(pr, wp->offset, wp->len);
+ blkid_probe_step_back(pr);
}
blkid_free_probe(pr);