diff --git a/partx/partx.c b/partx/partx.c index d2fde3f4e..7c4235bb0 100644 --- a/partx/partx.c +++ b/partx/partx.c @@ -302,10 +302,15 @@ static int del_parts(int fd, const char *device, dev_t devno, } for (i = lower; i <= upper; i++) { - if (partx_del_partition(fd, i) == 0) { + rc = partx_del_partition(fd, i); + if (rc == 0) { if (verbose) printf(_("%s: partition #%d removed\n"), device, i); continue; + } else if (errno == ENXIO) { + if (verbose) + printf(_("%s: partition #%d already doesn't exist\n"), device, i); + continue; } rc = -1; if (verbose)