Technical article 104863

How do I add a SCSI or IDE disk that has data I want to keep?

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

Problem

I want to add a SCSI or IDE hard drive and maintain the data.

Solution

The first step is to make backups of the data if possible.

The below examples are for SCSI HD:

Obtain the following information about the SCSI hard disk before proceeding:

- host adapter type and its prefix (such as lsil, eiad, arad, alad)

- host adapter number

Note: For IDE disk, if you are attaching the second Data IDE disk to the Primary IDE controller, then you need to jumper the main IDE disk as "Master" and the Data IDE disk as "Slave".

If are attaching the second Data IDE disk to the Secondary IDE controller and if there is a ATAPI IDE CD-ROM, then you need to jumper the ATAPI CD-ROM as Slave and the Data IDE disk as "Master" or vice versa.

Check to see if OpenServer detected the IDE drive and you will see device nodes for it in /dev/rhd1*

If so then see TA 127038 otherwise proceed with 'mkdev hd' below.

IDE will check the 'wd' driver to ensure it's been detected, ie:

Error: Attempting to configure drive 1 (wd unit 0), but only 0 drives are installed.

Note: On Open Desktop 3.0, Open Server 3.0, and SCO UNIX System V/386 Version 4.2, when using dual channel host adapters, Channel A will be host adapter number 0 and Channel B will be 1.

Note: On SCO OpenServer Release 5.0.X, you will be asked for the bus id. For a dual channel host adapter Channel A will be bus id =0 and Channel B will be bus id=1. The host adapter number will be the same for either channel. For example, when trying to add a SCSI disk that is attached to a host adapter, and the host adapter is the first of its type in the system, the host adapter number is 0, regardless of the channel to which the device is attached.

- target id of the SCSI disk.

After obtaining the above information you are ready to proceed. You must be in System Maintenance mode to continue.

PART I. Adding a SCSI Hard Drive
# mkdev hd

1. Add a hard disk to IDE controller 2. Add a hard disk to SCSI controller 3. Add a hard disk to IDA controller

Choose 2.

Enter the prefix of SCSI host adapter that supports this device or press <Return> for the default of ad.

Enter the prefix.

Which xxxx SCSI host adapter supports this device? (where xxxx is the prefix you entered previously.)

Enter the host adapter number.

Note: You may not see the next prompt if your system is SCO UNIX Version 4.0, 4.1, or 4.2.

The following parameters will be used to configure xxxx
SCSI host adapter z.  Change these parameters y/n
(where xxxx is the prefix you entered previously and z
is the host adapter #.)

You are now being shown the setup parameters. If they are correct choose n. If you need to change them choose y, enter the hardware details about the host adapter card and confirm that you want to save these values.

Note: For SCO OpenServer Release 5 only you will be prompted for a bus id.

What SCSI bus is this device attached to?
Enter bus id.
What is the target id for this device?
Enter target id.
What is the LUN?
Enter 0.

You are about to add the following SCSI device:

   Host Adapter Type     Device   Adapter    Id   Lun    Bus
---------------------------------------------------------------
       xxxx               Sdsk     0         1     0      0
(where xxxx is the prefix added previously)

(It is assumed the host adapter is 0, target id of scsi disk is 1, lun is always 0 and in this case the bus id was 0.)

Relink kernel?

If the configuration is correct, choose y for yes.

Do you want the kernel to boot by default?

Choose yes.
Do you want the kernel environment rebuilt?
Choose yes.
Note: This adds the entry into /etc/conf/cf.d/mscsi.  If you wanted to
  repeat the exercise or remove the disk then this file can be
  manually edited and the line removed.  The kernel would then to be
  relinked and the server rebooted.
You must now reboot the system and enter System Maintenance
mode again.  You must run 'mkdev hd' again and enter the same
parameters as you did previously. You will then see this
message:

During installation you may choose to overwrite all or part of the present contents of your hard disk. Continue y/n

Choose y.

1. Display Partition Table 2. Use Entire Disk for Unix 3. Use Rest of Disk for Unix 4. Create Unix Partition 5. Activate Partition 6. Delete Partition 7. Create Partition

Enter choice or q to quit

IMPORTANT NOTICE: DO NOT CHOOSE ANYTHING BUT 1 OR Q TO QUIT OR YOU WILL OVERWRITE THE CONTENTS OF YOUR HARD DISK.

Choose q to quit.

1. Scan entire Unix partition 2. Scan a specified range of blocks 3. Scan a specified filesystem 4. List current bad block table 5. Add entries to bad block table 6. Delete entries from bad block table 7. Clear bad block table 8. Re-allocate bad blocks

Enter choice or q to quit

IMPORTANT NOTICE: CHOOSING ANYTHING BUT Q TO QUIT MAY OVERWRITE THE DATA.

Choose q to quit.

Enter the number of bad blocks to allocate space for or press Return to use existing value of ???

IMPORTANT NOTICE: CHOOSE RETURN TO ACCEPT EXISTING VALUE OR YOU WILL REMOVE ALL FILESYSTEMS IN THE PARTITION.

You will now be brought into divvy. For those adding a drive with multiple partitions proceed to Part II.

You must now choose the "n" option to name the filesystems. After naming each filesystem choose "q" to quit and "i" to install. You have now added the hard drive to the system.

IMPORTANT NOTICE: DO NOT CHOOSE ANYTHING BUT NAME OR YOU WILL WIPE OUT THE DATA.

Proceed to Part III if you wish to have filesystems automatically mounted when entering multiuser mode.

PART II. Multiple Partitions ONLY

You now have the divvy table of the active partition. You must choose "q" to quit and "e" to exit. You must now run the divvy command for each individual partition on the disk. Use the following guidelines to determine which partition.

# fdisk -f /dev/rhd00 - Show the partition table for the disk
Note:
# divvy -i /dev/hdxx  - Will Install new device nodes on the target
                        partition.  This process can be aborted.

Let's assume this is the first disk on the system:

# divvy /dev/hd0a - This is the ACTIVE partition in Fdisk.
# divvy /dev/hd01 - This command will bring up the divvy table
                  for the first partition on the disk. You can
                  then choose "n" to name all the filesystems
                  on this partition. When you have finished
                  type "q" to quit and "i" to install.

IMPORTANT NOTICE: DO NOT CHOOSE ANYTHING BUT N FOR NAME OR YOU WILL WIPE OUT YOUR DATA.

# divvy /dev/hd02 - This command will bring up the divvy table
                  for the second partition on the disk. You
                  can now name the filesystems on this partition.
# divvy /dev/hd03 - for the third partition.
# divvy /dev/hd04 - for the fourth partition

For a second disk the procedure is the same except for the device node.

# divvy /dev/hd1a - for the ACTIVE partition on the second disk.
# divvy /dev/hd11 - for the first partition on the second disk.
# divvy /dev/hd12 - for the second partition on the second disk
                  and so on.

You have now added the disk to your system with the data intact. If you want the filesytems to automount, proceed to Part III.

PART III. Automounting Filesystems

Follow this procedure if you want your filesystems to be automatically mounted when entering multiuser mode.

If you don't want to always auto-mount and just need to access the data on the disk then proceed to Part IV.

# mkdev fs

1. Add a new filesystem to system 2. Remove a filesystem

Choose 1.

Enter a device name and press <return> or q to quit

Enter the name of the filesystem you named in divvy. For example, "u1".

Device name modified to /dev/u1
Do you wish to continue? y/n
Choose y.

Enter a directory name and press <return> or q to quit:

Enter u1.

Directory was modified to /u1 Do you wish to continue y/n

Choose y.
When entering multiuser mode:

1. Always mount /dev/u1 2. Never mount /dev/u1 3. Prompt before mounting /dev/u1

Enter your choice.

Do you want users to mount this filesystem? y/n

Enter your choice.
If you chose "y" to always mount and "y" to allow users to
mount the filesystem, it will be automatically mounted upon
entering multiuser mode. At this point you must either manually
mount the filesystem for this session or reboot and enter
multiuser mode.
PART IV. Mounting the Filesystems
To mount the filesystem, either:

a) If you've configured the filesystems as Auto-mounting above then simply reboot.

b) If you just want to access the filesystems then use:

# mount /dev/<filesystem label> /mountpoint
eg. mount /dev/u /u

This assumes you've created a mount point (empty directory called /u with 'mkdir /u'.

If the mount is only temporary then mount to /mnt, a pre-existing
mount point.

If you are unable to mount the filesystem then the filesystem may need 'fsck' ran, eg:

# fsck -ofull -y /dev/u

From the Xinuos technical article database, record 104863. Reproduced with permission. The original is at www.sco.com/ta/104863, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.