Home

clean_disks.sh




Purpose

clean_disks.sh can be used to wipe one or more disks.  IT WILL DESTROY ALL DATA ON THESE DISKS!


Back to top

License


# CDDL HEADER START
#
# The contents of this file and the script are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END


Back to top

History


Version
Releasedate
         Description
1.00
07/2004



Back to top

Operating system

Solaris


Back to top

Language / type

Kornshell Script


Back to top

Prerequisites

only the format command; you must be root to execute this script


Back to top

Usage


bash-2.05# ./clean_disks.sh -h
[07.02.2005 21:25:29] clean_disks.sh started on Mon Feb  7 21:25:29 MET 2005

  clean_disks.sh 1.00 - wipe out disks

  Usage: clean_disks.sh [-v] [-q] [-h] [-l logfile] [-y|-n] [-x]
                        [-N count] [-x exclude_disk] [-X xserveraddr]

  Parameter:

      -N - "count" is the no of writes (def.:3)
      -x - do not wipe the disk "exclude_disk"
      -X - start every format in an xterm a on the xserver "xserveraddr"

      -v - turn verbose mode on
      -q - turn quiet mode on
      -h - show usage
      -l - set the logfile
      -y - assume yes to all questions
      -n - assume no to all questions


[07.02.2005 21:25:29] The log file used was "/var/tmp/clean_disks.sh.LOG.9201.TEMP"
[07.02.2005 21:25:29] clean_disks.sh ended on Mon Feb  7 21:25:29 MET 2005.
[07.02.2005 21:25:29] The RC is 1.
bash-2.05#



Back to top

Examples

# clean all disks; start the format for wipeing in an xterm on the X Server sol9:0

./clean_disks.sh -X sol9:0

# clean all disks except c1t0d0s0; start the format for wipeing in an xterm on the X Server sol9:0

./clean_disks.sh -X sol9:0 -x c1t0d0s0

# clean all disks except c1t0d0s0 and c1t10d0s0 ;start the format for wipeing in an xterm on the X Server sol9:0

./clean_disks.sh -X sol9:0 -x c1t0d0s0 -x c1t1d0s0


Back to top

Notes

CAUTION: THIS SCRIPT DESTROYS ALL DATA ON THE DISKS!!!


Back to top

Download


Download clean_disks.sh



Back to top