summaryrefslogtreecommitdiffstats
path: root/sbin/scsiformat
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1997-03-02 11:21:07 +0000
committerjoerg <joerg@FreeBSD.org>1997-03-02 11:21:07 +0000
commit99d2db84f9086a1af137f5fa302fb6b0483859a3 (patch)
tree5667233dc1e8777aab5e6f57cf1451999bc43beb /sbin/scsiformat
parent6e3189294315b7854f8329d000a4e48bcada2ef8 (diff)
downloadFreeBSD-src-99d2db84f9086a1af137f5fa302fb6b0483859a3.zip
FreeBSD-src-99d2db84f9086a1af137f5fa302fb6b0483859a3.tar.gz
Avoid the ``Three seconds until format begins'' construct. It's
inconsistent with the remaining unix utilities, so replace it by something better suited. Learned from: The Unix Hater's Handbook :-)
Diffstat (limited to 'sbin/scsiformat')
-rw-r--r--sbin/scsiformat/scsiformat.811
-rw-r--r--sbin/scsiformat/scsiformat.sh27
2 files changed, 23 insertions, 15 deletions
diff --git a/sbin/scsiformat/scsiformat.8 b/sbin/scsiformat/scsiformat.8
index d0f18c1..ba15f65 100644
--- a/sbin/scsiformat/scsiformat.8
+++ b/sbin/scsiformat/scsiformat.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)scsiformat.8 5.1 (Berkeley) 6/5/93
-.\" $Id$
+.\" $Id: scsiformat.8,v 1.7 1997/02/22 14:33:17 peter Exp $
.\"
.Dd June 5, 1993
.Dt SCSIFORMAT 8
@@ -40,7 +40,7 @@
.Nd format SCSI disks and show SCSI parameters
.Sh SYNOPSIS
.Nm scsiformat
-.Op Fl qw
+.Op Fl qyw
.Op Fl p Ar page-control
.Ar device-name
.Sh DESCRIPTION
@@ -81,6 +81,13 @@ shows which parameters are variable.
Quiet; suppress the mode page output. Only the inquiry string will be
printed, so the operator can ensure he's going to format the intended
drive.
+.It Fl y
+Yes; do format without asking any question. If this option is not
+provided,
+.Nm scsiformat
+will ask back before actually starting to format the device. At this
+point, hitting the interrupt key (normally Control-C) will abort the
+program.
.It Fl w
Do actually format; by default, only the disk parameters will be
displayed.
diff --git a/sbin/scsiformat/scsiformat.sh b/sbin/scsiformat/scsiformat.sh
index 3518e29..8039255 100644
--- a/sbin/scsiformat/scsiformat.sh
+++ b/sbin/scsiformat/scsiformat.sh
@@ -26,30 +26,32 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
-# $Id$
-#
-# scsiformat [-qw] [-p page-control] raw-device-name
+# $Id: scsiformat.sh,v 1.4 1997/02/22 14:33:17 peter Exp $
#
PATH="/sbin:/usr/sbin:/bin:/usr/bin"; export PATH
READONLY=yes
+DOIT=no
QUIET=no
RAW=
PAGE=0
usage()
{
- echo "usage: scsiformat [-qw] [-p page-control] raw-device-name" 1>&2
+ echo "usage: scsiformat [-qyw] [-p page-control] raw-device-name" 1>&2
exit 2
}
-while getopts "qwp:" option
+while getopts "qwyp:" option
do
case $option in
q)
QUIET=yes
;;
+ y)
+ DOIT=yes
+ ;;
w)
READONLY=no
;;
@@ -130,14 +132,13 @@ fi # !quiet
if [ "$READONLY" = "no" ]
then
- # grace period, last chance to hit INTR
- echo -n "Three seconds until format begins."
- sleep 1
- echo -n "."
- sleep 1
- echo -n "."
- sleep 1
+ if [ "$DOIT" != "yes" ]
+ then
+ echo "This will destroy all data on this drive!"
+ echo -n "Hit return to continue, or INTR (^C) to abort: "
+ read dummy
+ fi
# formatting may take a huge amount of time, set timeout to 2 hours
- echo " Formatting... this may take a while."
+ echo "Formatting... this may take a while."
scsi -s 7200 -f $RAW -c "4 0 0 0 0 0"
fi
OpenPOWER on IntegriCloud