summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/sys/write.27
-rw-r--r--sbin/bsdlabel/bsdlabel.85
-rw-r--r--sbin/disklabel/disklabel.85
3 files changed, 15 insertions, 2 deletions
diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2
index d8a4177..729a4d0 100644
--- a/lib/libc/sys/write.2
+++ b/lib/libc/sys/write.2
@@ -171,6 +171,13 @@ A signal interrupted the write before it could be completed.
.It Bq Er EAGAIN
The file was marked for non-blocking I/O,
and no data could be written immediately.
+.It Bq Er EROFS
+An attempt was made to write over a disk label area at the beginning
+of a slice.
+Use
+.Xr disklabel 8
+.Fl W
+to enable writing on the disk label area.
.El
.Pp
In addition,
diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8
index 32ed01c..7c71bd7 100644
--- a/sbin/bsdlabel/bsdlabel.8
+++ b/sbin/bsdlabel/bsdlabel.8
@@ -314,7 +314,10 @@ 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 silently ignores any attempt to do so. If you need
+of a disk. The disk driver arranges for
+.Xr write 2
+and similar system calls
+to return 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
diff --git a/sbin/disklabel/disklabel.8 b/sbin/disklabel/disklabel.8
index 32ed01c..7c71bd7 100644
--- a/sbin/disklabel/disklabel.8
+++ b/sbin/disklabel/disklabel.8
@@ -314,7 +314,10 @@ 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 silently ignores any attempt to do so. If you need
+of a disk. The disk driver arranges for
+.Xr write 2
+and similar system calls
+to return 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
OpenPOWER on IntegriCloud