1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-26 11:47:31 +00:00

fdisk: Make confusing fdisk messages a little less ambiguous

We print an error when we can't read the MBR. Add minimal messages about
continuing anyway.

PR: 167036
Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2024-10-11 10:13:08 -06:00
parent 1107834090
commit 2af5769e34

View File

@ -380,7 +380,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 +411,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");