.TP
.B "\-e, \-\-ifexists"
Silently skip devices that do not exist.
+The
+.I /etc/fstab
+mount option
+.BI nofail
+may be also used to skip non-existing device.
+
.TP
.B "\-f, \-\-fixpgsz"
Reinitialize (exec /sbin/mkswap) the swap space if its page size does not
while ((fstab = getmntent(fp)) != NULL) {
const char *special;
- int skip = 0;
+ int skip = 0, nofail = ifexists;
int pri = priority;
char *opt, *opts;
pri = atoi(opt+4);
if (strcmp(opt, "noauto") == 0)
skip = 1;
+ if (strcmp(opt, "nofail") == 0)
+ nofail = 1;
}
free(opts);
special = fsprobe_get_devname_by_spec(fstab->mnt_fsname);
if (!special) {
- if (!ifexists)
+ if (!nofail)
status |= cannot_find(fstab->mnt_fsname);
continue;
}
if (!is_in_proc_swaps(special) &&
- (!ifexists || !access(special, R_OK)))
+ (!nofail || !access(special, R_OK)))
status |= do_swapon(special, pri, CANONIC);
free((void *) special);