标题: 在 Sun Enterprise Server 上配置外部 SCSI 磁带机(zt) [打印本页] 作者: toyou 时间: 2004-07-20 09:57 标题: 在 Sun Enterprise Server 上配置外部 SCSI 磁带机(zt) 在 Sun Enterprise Server 上配置外部 SCSI 磁带机
作者:Carl Grammer
不是每一个运行 Solaris Operating System 的地方都拥有备份解决方案的资源,它们甚至不需要这些资源,这些备份解决方案如价格昂贵的磁带自动更换机、磁带库或 Tape Silo。通常所需要的只是根文件系统、重要数据库或一个小型开发条目目代码的备份或 ufsdump。在这些情况下,像 SCSI DDS 磁带机这样的外部设备通常就已经足够。
以下信息有助于在大多数具有外部 SCSI 连接的 Sun Enterprise Server 上配置外部设备。这些信息可以应用于 Solaris 7 OS 或更新版本。
为磁带机配置 Solaris Operating System
当添加一个外部 SCSI 磁带机时,必须修改 Solaris OS 配置文件 /kernel/drv/st.conf。
Shutting down the Solaris Operating System abruptly with the
Stop-a sequence, or with the halt command, creates a condition
where running the probe command hangs the system unless you run
the reset-all command first.
如果已经运行了 reset 命令,那么在提示时用“y”响应。您将会得到和下面类似的显示:
Primary UltraSCSI bus:
Target 0
Unit 0 Disk IBM DDYST1835SUN18G S94A
Target 1
Unit 0 Disk IBM DDYST1835SUN18G S94A
Removable-Media/External SCSI bus
Target 6
Unit 0 Removable Read Only Device Disk TOSHIBA
XM6201TASUN32XCD1103
# mt -f /dev/rmt/0 status
如果以前已经配置了其他磁带机,您可能必须用 1、2 等代替 0,直到发现与新磁带机条目相关联的数字。
继续 WangDAT 磁带机的例子,mt 命令的成功响应看上去像这样:
WangDAT 4mm DAT tape drive:
sense key(0x0)= No Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
注意第一行中“tape drive”前显示的文本应该和 st.conf 文件中设备配置行中的第二个引用字段匹配。此外,注意返回的特定 sense key 通常不是个问题。
mt 可能返回类似以下内容的消息:
/dev/rmt/0: No such device or address
这表示您应该尝试将 0 替换为 1、2、3 等,就如前面提到的那样。任何其他消息可能表示 st.conf 文件中的配置有问题。编辑 st.conf 文件,并重新启动,直到 mt 命令返回合适的状态。
当 mt 命令返回合适状态时,磁带机就正确配置了,并已经准备好使用了。
有关详细信息,请查阅 mt 命令的 man 页面。
关于作者
Carl Grammer 是一名 Sun 认证系统管理员,拥有 15 年以上的 IT 从业经验。他目前受雇于一家支持电信部门的国际 IT 咨询公司。作者: toyou 时间: 2004-07-20 09:59 标题: 在 Sun Enterprise Server 上配置外部 SCSI 磁带机(zt) Configuring an External SCSI Tape Drive on a Sun Enterprise Server
By Carl Grammer
Not every shop running the Solaris Operating System has the resources -- or even the need -- for backup solutions like fancy tape auto-changers, libraries, or silos. Often all that is needed is a backup, or ufsdump, of the root file system, an important database, or the code from a small development project. In these cases, an external device such as a SCSI DDS tape drive will often suffice.
The following information should aid in configuring your external device on most Sun Enterprise servers that have an external SCSI connection. This information applies to Solaris 7 OS or later versions.
Configuring the Solaris Operating System for the Tape Drive
When adding an external SCSI tape drive, it is necessary to modify the Solaris OS configuration file /kernel/drv/st.conf.
As root, go to the /kernel/drv/ directory and make a backup of the st.conf file.
# cp st.conf st.conf.bak
Using an editor such as vi, open the file and go to the following line:
# tape-config-list=
If it has not already been uncommented, remove the # to uncomment the line.
The following section of the file consists of the configuration settings for some commonly used tape drives. They are presented as three quoted and comma-delimited fields. If you happen to be installing a drive that is on this list, scroll down to that line and uncomment it.
For example, if you are installing a WangDAT 3400, the line will look like this:
# "WangDAT Model 3400", "WangDAT 4mm DAT", "WangDAT",
If it has not already been uncommented, remove the # to uncomment the line. Also, if this is the last or the only tape drive to be configured, change the comma at the end of the line to a semicolon.
Important note: The configuration line of the last tape drive enabled (that is, the last uncommented line) must end in a semicolon. The semicolon indicates the end of the list of enabled drives. All enabled drives that appear before the last enabled drive must end in a comma. Otherwise, you will get errors when performing a reconfiguration reboot.
Scroll down to the next section of the file, to find the line in which the field preceding the equal sign (=) matches the previously noted third field in quote marks from the enabled tape drive's configuration line. Continuing with the example of the WangDAT drive, you would search for the line that begins with WangDAT, like this:
#WangDAT = 1,0x2b,0,0x659,1,0x00,0;
Uncomment this line. Note that if there is more than one matching entry, you may have to experiment to find the entry that produces the best results.
Now save the edited file.
Please note: If the st.conf file does not contain configuration information for the type of drive you are installing, it will be necessary to get the configuration entries from the manufacturer.
Determining and Setting the Drive's SCSI ID
Devices on a SCSI bus must be configured with a unique SCSI ID, often called the target ID. When adding a SCSI device, it must be assigned an unused ID. It is therefore necessary to determine which IDs are already in use on the server.
Sun Enterprise servers will typically reserve the following IDs for specific internally connected devices:
5 for Internal Tape Drive
6 for CD-ROM
7 for Host Adapter
In addition, the boot disk device will typically use ID 0, although it is not reserved for this purpose.
To determine which IDs are in use, follow the steps below:
Boot the system to the ok prompt.
Set the NVRAM auto-boot? parameter to false.
ok setenv auto-boot? false
This will save time by preventing the system from booting into the Solaris OS until you want it to.
If you used the Solaris OS halt command or the Stop-a key sequence to get to the ok prompt, run the reset command to clear all buffers and registers before entering any other commands. If you do not do this, the system may lock up.
ok reset
The system will do a hardware reset and return to the ok prompt (assuming the auto-boot? parameter is set to false).
If you plan to connect the tape drive to the external connector of the primary on-board SCSI bus, run the following command to determine the targets in use on this bus:
ok probe-scsi
On systems with OpenBoot 3.x or later, the following warning will be displayed:
Shutting down the Solaris Operating System abruptly with the
Stop-a sequence, or with the halt command, creates a condition
where running the probe command hangs the system unless you run
the reset-all command first.
If you have run the reset command, respond with "y" when prompted. You will be presented with a display similar to the following:
Primary UltraSCSI bus:
Target 0
Unit 0 Disk IBM DDYST1835SUN18G S94A
Target 1
Unit 0 Disk IBM DDYST1835SUN18G S94A
Removable-Media/External SCSI bus
Target 6
Unit 0 Removable Read Only Device Disk TOSHIBA
XM6201TASUN32XCD1103
This display indicates that targets 0, 1, and 6 are in use, and any of the unused targets may be used for the external tape drive.
Remember: Although it is not displayed here, target 7 is always reserved for the SCSI host adapter. Also, as mentioned before, target 5 is reserved for an internal tape drive. If an internal drive is not currently installed you may use target 5 for the external drive. However, if you install an internal tape drive at some point in the future, you will have to assign it to target 5, and you will be forced to reconfigure the external drive with a different target ID. For this reason, in the current scenario the recommended ID would be 4.
If you plan to connect the tape drive to the external connector that is attached to a separate SBus or PCI controller, run the following command to determine the targets in use on all SCSI controllers:
ok probe-scsi-all
A display will be presented, allowing you to determine the target IDs in use on all controllers. Once you have determined which ID you wish to use, follow the manufacturer's documentation to set the tape drive to this ID.
Attaching the Drive
When adding SCSI devices you must observe proper bus termination for proper operation. The SCSI bus must be terminated at each end. Adding devices to an external connector extends the bus and, therefore, the point of termination is also extended to the last connected device.
A typical configuration of Sun Enterprise servers has the primary SCSI bus extend to an external 68-pin connector, which is located on the rear panel. The external connector can support several different external devices with both narrow, Fast/Wide, and (often) UltraSCSI interfaces. The bus is also auto-terminating; as such, you do not need to worry about enabling or disabling termination when attaching an external device. You need only be concerned with termination of the device itself.
When attaching the external drive, make sure the server has been shut down and powered off. Also, when connecting, ensure that the tape device is not powered up. If the tape device is to be the only external device, simply attach the cable to the connector. Since it is the last device on the bus, make sure it is properly terminated. Then confirm that the device has power, turn the device on, and then turn on the server.
If other devices are already attached to the external connector, the situation gets more complicated. It is advisable that you consult the Sun Enterprise Server Owner's Guide for more detailed installation information. In any case, if you are unfamiliar with SCSI devices, bus length, bus termination, and so on, it is recommended that you read the section that discusses the external SCSI port to gain a better understanding of the requirements for attaching external devices.
Reconfiguration Reboot
Turn on the power to the tape drive and then the server. If you have set the auto-boot? parameter to false, as described above, the system will come up to the ok prompt.
Enter the boot command to perform a reconfiguration reboot, as in the following example:
ok boot -r
If the auto-boot? parameter was not set to false and the server continues to boot into the Solaris OS, log in as root and then create a file named reconfigure in the root directory.
# touch /reconfigure
Reboot the server. The system will check for the existence of the reconfigure file and perform a reconfiguration boot if it exists.
Watch for any boot messages that would indicate a problem with the st.conf file. If problems are found, make note of any line numbers displayed. If errors occur, edit the st.conf file again and perform the reconfiguration reboot again.
The reconfiguration reboot will create the necessary device entries in the /devices and /dev directories.
Testing the Drive
Once the tape device entries have been created successfully, test the tape drive with the mt command. Make sure a tape has been inserted in the drive and run the following command:
# mt -f /dev/rmt/0 status
If other tape devices have been configured in the past, you may have to replace the 0 with a 1, 2, and so on, until you find the number associated with your new drive.
Again continuing with the example of the WangDAT drive, a successful response to the mt command will look something like this:
WangDAT 4mm DAT tape drive:
sense key(0x0)= No Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
Notice that the text displayed on the first line, before "tape drive," should match the second quoted field of the device configuration line in the st.conf file. Also, note that the specific sense key returned is usually not an issue.
mt may return a message similar to the following:
/dev/rmt/0: No such device or address
This means you should try substituting the 0 with 1, 2, and so on, as mentioned previously. Any other message may indicate a problem with the configuration in the st.conf file. Edit the st.conf file and reboot until the mt command returns the proper status.
When the mt command returns the proper status, the tape drive is correctly configured and ready for use.
For more information, consult the man pages on the mt command.
About the Author
Carl Grammer is a Sun Certified System Administrator with more than 15 years of IT industry experience. He is currently employed by an international IT consulting firm supporting the telecommunications sector.作者: C.Arthur 时间: 2004-07-20 10:18 标题: 在 Sun Enterprise Server 上配置外部 SCSI 磁带机(zt) 好文作者: hcjia 时间: 2004-07-20 10:54 标题: 在 Sun Enterprise Server 上配置外部 SCSI 磁带机(zt) 好东西啊!收藏啊!作者: race 时间: 2004-07-20 11:05 标题: 在 Sun Enterprise Server 上配置外部 SCSI 磁带机(zt) 当添加一个外部 SCSI 磁带机时,必须修改 Solaris OS 配置文件 /kernel/drv/st.conf