diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8 index 1e908c29cf46..b3df66e06436 100644 --- a/sbin/bsdlabel/bsdlabel.8 +++ b/sbin/bsdlabel/bsdlabel.8 @@ -61,9 +61,6 @@ .Op Fl r .Op Fl n .Ar disk Ar protofile -.Nm -.Op Fl NW -.Ar disk .Pp .Nm .Fl B @@ -311,27 +308,6 @@ If is used, no data will be written to the device, and instead the disklabel that would have been written will be printed to stdout. This is useful to see how a partitioning scheme will work out for a specific disk. -.Ss Enabling and disabling writing to the disk label area -.Pp -By default, it is not possible to write to the disk label area at the beginning -of a disk. The disk driver arranges for -.Xr write 2 -and similar system calls -to return -.Er EROFS -on any attempt to do so. If you need -to write to this area (for example, to obliterate the label), use the form -.Pp -.Nm -.Fl W -.Ar disk -.Pp -To disallow writing to the label area after previously allowing it, use the -command -.Pp -.Nm -.Fl N -.Ar disk .Ss Installing bootstraps .Pp The final three forms of diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index bbcf0d08ed2c..bcb721cb4cee 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -163,20 +163,20 @@ char boot1[MAXPATHLEN]; #endif enum { - UNSPEC, EDIT, NOWRITE, READ, RESTORE, WRITE, WRITEABLE, WRITEBOOT + UNSPEC, EDIT, READ, RESTORE, WRITE, WRITEBOOT } op = UNSPEC; int rflag; int disable_write; /* set to disable writing to disk label */ -#define OPTIONS "BNRWb:enrs:w" +#define OPTIONS "BRb:enrs:w" int main(int argc, char *argv[]) { struct disklabel *lp; FILE *t; - int ch, f = 0, flag, error = 0; + int ch, f = 0, error = 0; char *name = 0; while ((ch = getopt(argc, argv, OPTIONS)) != -1) @@ -194,11 +194,6 @@ main(int argc, char *argv[]) break; #endif #endif - case 'N': - if (op != UNSPEC) - usage(); - op = NOWRITE; - break; case 'n': disable_write = 1; break; @@ -207,11 +202,6 @@ main(int argc, char *argv[]) usage(); op = RESTORE; break; - case 'W': - if (op != UNSPEC) - usage(); - op = WRITEABLE; - break; case 'e': if (op != UNSPEC) usage(); @@ -276,12 +266,6 @@ main(int argc, char *argv[]) error = edit(lp, f); break; - case NOWRITE: - flag = 0; - if (ioctl(f, DIOCWLABEL, (char *)&flag) < 0) - err(4, "ioctl DIOCWLABEL"); - break; - case READ: if (argc != 1) usage(); @@ -330,12 +314,6 @@ main(int argc, char *argv[]) error = writelabel(f, bootarea, lp); break; - case WRITEABLE: - flag = 1; - if (ioctl(f, DIOCWLABEL, (char *)&flag) < 0) - err(4, "ioctl DIOCWLABEL"); - break; - #if NUMBOOT > 0 case WRITEBOOT: { diff --git a/sbin/disklabel/disklabel.8 b/sbin/disklabel/disklabel.8 index 1e908c29cf46..b3df66e06436 100644 --- a/sbin/disklabel/disklabel.8 +++ b/sbin/disklabel/disklabel.8 @@ -61,9 +61,6 @@ .Op Fl r .Op Fl n .Ar disk Ar protofile -.Nm -.Op Fl NW -.Ar disk .Pp .Nm .Fl B @@ -311,27 +308,6 @@ If is used, no data will be written to the device, and instead the disklabel that would have been written will be printed to stdout. This is useful to see how a partitioning scheme will work out for a specific disk. -.Ss Enabling and disabling writing to the disk label area -.Pp -By default, it is not possible to write to the disk label area at the beginning -of a disk. The disk driver arranges for -.Xr write 2 -and similar system calls -to return -.Er EROFS -on any attempt to do so. If you need -to write to this area (for example, to obliterate the label), use the form -.Pp -.Nm -.Fl W -.Ar disk -.Pp -To disallow writing to the label area after previously allowing it, use the -command -.Pp -.Nm -.Fl N -.Ar disk .Ss Installing bootstraps .Pp The final three forms of diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index bbcf0d08ed2c..bcb721cb4cee 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -163,20 +163,20 @@ char boot1[MAXPATHLEN]; #endif enum { - UNSPEC, EDIT, NOWRITE, READ, RESTORE, WRITE, WRITEABLE, WRITEBOOT + UNSPEC, EDIT, READ, RESTORE, WRITE, WRITEBOOT } op = UNSPEC; int rflag; int disable_write; /* set to disable writing to disk label */ -#define OPTIONS "BNRWb:enrs:w" +#define OPTIONS "BRb:enrs:w" int main(int argc, char *argv[]) { struct disklabel *lp; FILE *t; - int ch, f = 0, flag, error = 0; + int ch, f = 0, error = 0; char *name = 0; while ((ch = getopt(argc, argv, OPTIONS)) != -1) @@ -194,11 +194,6 @@ main(int argc, char *argv[]) break; #endif #endif - case 'N': - if (op != UNSPEC) - usage(); - op = NOWRITE; - break; case 'n': disable_write = 1; break; @@ -207,11 +202,6 @@ main(int argc, char *argv[]) usage(); op = RESTORE; break; - case 'W': - if (op != UNSPEC) - usage(); - op = WRITEABLE; - break; case 'e': if (op != UNSPEC) usage(); @@ -276,12 +266,6 @@ main(int argc, char *argv[]) error = edit(lp, f); break; - case NOWRITE: - flag = 0; - if (ioctl(f, DIOCWLABEL, (char *)&flag) < 0) - err(4, "ioctl DIOCWLABEL"); - break; - case READ: if (argc != 1) usage(); @@ -330,12 +314,6 @@ main(int argc, char *argv[]) error = writelabel(f, bootarea, lp); break; - case WRITEABLE: - flag = 1; - if (ioctl(f, DIOCWLABEL, (char *)&flag) < 0) - err(4, "ioctl DIOCWLABEL"); - break; - #if NUMBOOT > 0 case WRITEBOOT: {