Problem
I have installed an additional hard disk by running the "mkdev hd" utility, but the information entered for the controller and/or the disk number was incorrect.
NOTE: If your goal is simply to remove and replace a subsequent scsi
disk, this procedure is not necessary. To replace a secondary
scsi disk drive, perform shutdown, replace the disk drive and
reboot. Run mkdev hd once. Do not remove any devices as
indicated below.This information is based on a two-drive system where you want to
remove the second drive. If you have more than two drives, you
can still use this information. Simply place the correct number
for the last drive on your system when following these steps. If
you have a three-drive system, you would replace hd10 with hd20,
and all other references would require that you replace 1 with 2
to work on the third disk drive.WARNING:THIS INFORMATION IS FOR REMOVING THE LAST DISK THAT WAS ADDED
TO THE SYSTEM. DO NOT USE THIS INFORMATION TO REMOVE DISKS
IF THEY ARE NOT THE LAST DISK ADDED TO THE SYSTEM. IF DISKS
OTHER THAN THE LAST DISK NEED TO BE REMOVED, CONTACT YOUR SUPPORT
PROVIDER FOR ASSISTANCE. Solution
There are a few files that need to be removed if you want only one hard disk on the system or if you want to start the process of adding a second hard disk again.
The files are:/dev/hd1*
/dev/rhd1*
/dev/dsk/1s*
/dev/rdsk/1s*These four locations contain the special device files for the additional hard drive.
NOTE: "hd1*" is the naming convention for the second hard drive and
"hd2*" is for the 3rd hard drive and so forth. For example:/dev/hd10, /dev/hd11, /dev/hd12, /dev/hd13, /dev/hd14,
/dev/hd1a, /dev/hd1d,STEP 1: Remove all the special device files.
For both ESDI and SCSI hard disk removal, type:
# rm /dev/hd1*
# rm /dev/rhd1*
# rm /dev/dsk/1s*
# rm /dev/rdsk/1s*For SCSI hard drive, you may need to run:
# mkdev .scsiChoose to Remove a SCSI device Choose the Hard Disk Enter the proper Target ID number, Host adapter number and LUN number to remove that SCSI hard disk device.
If you have a third hard drive that you need to remove as well, repeat step 1 and replace "1" for "2". Repeat this step for all the additional hard drives you want removed.
As an added verification, edit the /etc/conf/cf.d/mscsi file.
You should have only one line item for the hard disk (listed as
"Sdsk" under the attach column). If there are excess entries
for Sdsk, remove these lines.STEP 2: Remove excess lines from the HDLIST perms file.
The file "/usr/lib/mkdev/perms/HDLIST" contains major and minor
numbers for all additional hard disks on the system. Below are
examples of this file with and without the information for an
additional hard drive.If you wish to revert back to a system that only has one hard drive, remove all the lines that contain the information for the additional hard drives from this file.
============================================================
Example of a /usr/lib/mkdev/perms/HDLIST file containing an
additional hard drive. The extra entries should be removed.
============================================================# @(#) HDLIST.src 23.2 91/08/29
#
# Copyright (C) 1991 The Santa Cruz Operation, Inc.
# All Rights Reserved.
# The information in this file is provided for the exclusive use of
# the licensees of The Santa Cruz Operation, Inc. Such users have the
# right to use, modify, and incorporate this code into other products
# for purposes authorized by the license agreement provided they include
# this notice and the associated copyright notice with any such product.
# The information in this file is provided "AS IS" without warranty.
#
#
0 /etc/conf/node.d/hd 0
1 /etc/conf/node.d/hd 64Edit the file to remove the entry for the disk you want to remove from the system.
=============================================================
Example of an edited /usr/lib/mkdev/perms/HDLIST file
=============================================================# @(#) HDLIST.src 23.2 91/08/28
#
# Copyright (C) The Santa Cruz Operation, Inc.
# All Rights Reserved.
# The information in this file is provided for the exclusive use of
# the licensees of The Santa Cruz Operation, Inc. Such users have the
# right to use, modify, and incorporate this code into other products
# for purposes authorized by the license agreement provided they include
# this notice and the associated copyright notice with any such product
# The information in this file is provided "AS IS" without warranty.
#
#
0 /etc/conf/node.d/hd 0STEP 3: The file /usr/lib/mkdev/perms/HDLIST refers to the file
/etc/conf/node.d/hd. In this file are owner and group permissions
for any additional hard disks on the system.Caution: If you wish to make a copy of the "hd" file before you do
the editing, create the copy _outside_ of the node.d directory.If you want to revert back to a system with only one hard disk, you
must remove all lines that contain the information for additional
hard disks. Remove all entries of the type listed below.hd dsk/1s0
hd hd10
hd rhd10
hd rdsk/1s0STEP 4: Now you must check the Sdsk file for extra entries. This
file is located in the /etc/conf/node.d directory. Remove all
entries of the type listed below.Sdsk dsk/1s0
Sdsk hd10
Sdsk rdsk/1s1
Sdsk rhd10NOTE: There will not always be an Sdsk entry in the /etc/conf/node.d
directory. If you do not have this entry, go to the next step.STEP 5: Now you must modify the Sdsk driver to remove the entries for the additional disk drives. Edit the /etc/conf/pack.d/Sdsk/space.c file and remove the additional disk entries between the the lines that contain the word PROBE located at the bottom of the file.
================================================================
Example of a space.c file with two disk drive entries:
================================================================/*
* Probe routine return values, the marker comments must be kept in place
* so that the mkdev script can patch up this file correctly
*/
/*_PROBE_START_*/
#define Sdsk0 155648 /* Sdsk0 */
#define Sdsk1 155649 /* Sdsk1 */
int SdskProbe[] = {Sdsk0,Sdsk1,0};
/*_PROBE_STOP_*//* End probe routine return values */Remove the define statement for Sdsk1 or the disk you want to remove from the system, and remove the same entry from the SdskProbe line.
=================================================================
Example of the space.c file after removing the Sdsk entries:
=================================================================/*
* Probe routine return values, the marker comments must be kept in place
* so that the mkdev script can patch up this file correctly
*/
/*_PROBE_START_*/
#define Sdsk0 155648 /* Sdsk0 */
int SdskProbe[] = {Sdsk0,0};
/*_PROBE_STOP_*//* End probe routine return values */STEP 6: Edit the /etc/conf/pack.d/Sdsk/device.dat file to remove the entry for the disk you want to remove from the system.
================================================================
Example of a device.dat file with an additional hard disk:
================================================================FILE_FORMAT:
version=1
Sdsk0:
INDEX=Sdsk0
PATH=node0,node1
node0=D_SUBSYS,SCSI Disk,0,D_HARDDSK_SUBSYS,,NULL
node1=D_UNIT,SCSI Drive 0,0,0,D_RANDOM_ACCESS D_NODE,NULL
D_USER_MSG=SCSI Disk Drive,0,0,,NULL
D_BLOCK_NODE = 0
D_CHAR_NODE = 0
Sdsk1:
INDEX=Sdsk1
PATH=node0,node1
node0=D_SUBSYS,SCSI Disk,0,D_HARDDSK_SUBSYS,,NULL
node1=D_UNIT,SCSI Drive 1,0,1,D_RANDOM_ACCESS D_NODE,NULL
D_USER_MSG=SCSI Disk Drive,0,0,,NULL
D_BLOCK_NODE = 64
D_CHAR_NODE = 64
D_BLOCK_NODE = 320
D_CHAR_NODE = 320===================================================================
Example of a device.dat file after removing the Sdsk1 entries:
===================================================================FILE_FORMAT:
version=1
Sdsk0:
INDEX=Sdsk0
PATH=node0,node1
node0=D_SUBSYS,SCSI Disk,0,D_HARDDSK_SUBSYS,,NULL
node1=D_UNIT,SCSI Drive 0,0,0,D_RANDOM_ACCESS D_NODE,NULL
D_USER_MSG=SCSI Disk Drive,0,0,,NULL
D_BLOCK_NODE = 0
D_CHAR_NODE = 0STEP 7: You should also remove the nodes for the filesystems that
are on the disk that you want to remove from the system. These nodes
are located in the /dev directory and consist of both the character
and block node entries. For instance, if the disk you are removing
has two filesystems then you would need to remove four nodes. As
an example, if the two filesystems are named u1 and u2, you should
remove the file nodes u1, ru1, u2 and ru2. For this example
enter the following:# rm /dev/u1 /dev/ru1 /dev/u2 /dev/ru2While this might be considered an optional step, if you are going to
add this disk back to the system and you want to use the same names
for the filesystems, divvy will not let you create filesystems with
names that already exist on the system. Additionally, it is good
administration to keep the /dev directory free of unused entries.STEP 8: If you do not want any additional hard drives, you can
stop here. Otherwise, reconfigure the system to recognize the second
hard drive by typing:# mkdev hd