A Simple Way to Wipe Multiple Disks Using the Solaris OSEric Straavaldsen, April 2007 IntroductionThis tech tip provides two procedures to securely wipe large numbers of disks when you are running the Solaris Operating System. The Trusted Solaris disk wiping guidelines provide a simple procedure for wiping disks. However, I found that it takes so long to wipe a disk, that it can be painful to implement the procedure on 143-Gbyte disks. Even implementing the procedure on two boot disks can be quite a chore. But a feature of the Note: The following procedures have been tried only on Solaris 8 and 10 boot CDs on the following SPARC systems:
Creating a File to Use as Input to the format CommandYou can use this procedure to wipe two boots disks. If you need to wipe more than two disks, or you want to use a shell script to further automate the process, see the next procedure: Using a Script to Further Automate the Process. 1. First, create a file that contains contents similar to the following example, which will wipe two boot disks. disk 0 defect primary quit analyze purge quit defect both quit analyze purge quit disk 1 defect primary quit analyze purge quit defect both quit analyze purge quit It will take a very long time to run the file. Consider doing it over a weekend. Alternatively, you could create the following file instead. This file will take less time to wipe two disks, but it will miss items on the defect list: Caution: Using the following file might expose some sensitive data. So be aware of the risk. disk 0 analyze purge quit disk 1 analyze purge quit
2. Then simply use the following command, which instructs format -f <path_to_file> Using a Script to Further Automate the ProcessSince I rapidly got tired of creating files to wipe boot drives, I worked out the following script, which can be run from the command line of a Solaris boot CD or DVD. Caution:
/bin/ksh touch /tmp/wipescript DISKS=`prtconf | grep sd,\ instance | grep -v "driver not attached" | wc -l` DISKS=$(($DISKS-2)) while [ $DISKS -ge 0 ] do echo disk >> /tmp/wipescript echo $DISKS >> /tmp/wipescript echo analyze >> /tmp/wipescript echo purge >> /tmp/wipescript echo quit >> /tmp/wipescript DISKS=$(($DISKS-1)) done Alternatively, if you want a more secure version of the script that takes longer but does a more complete cleaning of the disk, use the following script instead: /bin/ksh touch /tmp/wipescript DISKS=`prtconf | grep sd,\ instance | grep -v "driver not attached" | wc -l` DISKS=$(($DISKS-2)) while [ $DISKS -ge 0 ] do echo disk >> /tmp/wipescript echo $DISKS >> /tmp/wipescript defect >> /tmp/wipescript primary >> /tmp/wipescript quit >> /tmp/wipescript analyze >> /tmp/wipescript purge >> /tmp/wipescript quit >> /tmp/wipescript defect >> /tmp/wipescript both >> /tmp/wipescript quit >> /tmp/wipescript analyze >> /tmp/wipescript purge >> /tmp/wipescript quit >> /tmp/wipescript disk >> /tmp/wipescript DISKS=$(($DISKS-1)) done format -f /tmp/wipescript Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
BigAdmin SubscriptionsBigAdmin Areas
BigAdmin Sun Center
BigAdmin Topics | |||