When used with option \fB-a\fR, all magic strings that are visible for libblkid are
erased.
+Note that by default
+.B wipefs
+does not erase nested partition tables on non-whole disk devices. The option
+\-\-force is required.
+
.SH OPTIONS
.TP
.BR \-a , " \-\-all"
static struct wipe_desc *
do_wipe(struct wipe_desc *wp, const char *devname, int flags)
{
- int mode = O_RDWR, reread = 0;
+ int mode = O_RDWR, reread = 0, need_force = 0;
blkid_probe pr;
struct wipe_desc *w, *wp0;
int zap = (flags & WP_FL_ALL) ? 1 : wp->zap;
if (!wp->on_disk)
continue;
+ if (!(flags & WP_FL_FORCE)
+ && wp->is_parttable
+ && !blkid_probe_is_wholedisk(pr)) {
+ warnx(_("%s: ignore nested \"%s\" partition "
+ "table on non-whole disk device."), devname, wp->type);
+ need_force = 1;
+ continue;
+ }
+
if (zap) {
if (backup)
do_backup(wp, backup);
warnx(_("%s: offset 0x%jx not found"), devname, w->offset);
}
+ if (need_force)
+ warnx(_("Use the --force option to force erase."));
+
fsync(blkid_probe_get_fd(pr));
if (reread && (mode & O_EXCL))