diff options
Diffstat (limited to 'sbin/fdisk/fdisk.c')
-rw-r--r-- | sbin/fdisk/fdisk.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index 6cfa2b510f22..925cc68932d7 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -265,6 +265,10 @@ main(int argc, char *argv[]) int partition = -1; struct dos_partition *partp; + fprintf(stderr, + "WARNING: fdisk is deprecated and is not available in FreeBSD 15 or later.\n" + "Please use gpart instead.\n\n"); + while ((c = getopt(argc, argv, "BIab:f:ipqstuv1234")) != -1) switch (c) { case 'B': @@ -380,7 +384,8 @@ main(int argc, char *argv[]) printf("******* Working on device %s *******\n",disk); if (I_flag) { - read_s0(); + if (read_s0()) + warnx("Ignoring bad existing MBR."); reset_boot(); partp = &mboot.parts[0]; partp->dp_typ = DOSPTYP_386BSD; @@ -410,8 +415,10 @@ main(int argc, char *argv[]) else print_params(); - if (read_s0()) + if (read_s0()) { + printf("Will replace existing bad MBR\n"); init_sector0(dos_sectors); + } printf("Media sector size is %d\n", secsize); printf("Warning: BIOS sector numbering starts with sector 1\n"); @@ -1465,7 +1472,6 @@ sanitize_partition(struct dos_partition *partp) * The following choices are considered: * /dev/ad0s1a => /dev/ad0 * /dev/da0a => /dev/da0 - * /dev/vinum/root => /dev/vinum/root * A ".eli" part is removed if it exists (see geli(8)). * A ".journal" ending is removed if it exists (see gjournal(8)). */ @@ -1482,7 +1488,7 @@ get_rootdisk(void) if (statfs("/", &rootfs) == -1) err(1, "statfs(\"/\")"); - if ((rv = regcomp(&re, "^(/dev/[a-z/]+[0-9]*)([sp][0-9]+)?[a-h]?(\\.journal)?$", + if ((rv = regcomp(&re, "^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?(\\.journal)?$", REG_EXTENDED)) != 0) errx(1, "regcomp() failed (%d)", rv); strlcpy(dev, rootfs.f_mntfromname, sizeof (dev)); |