电脑技术学习

Sun Enterprise Server 配置外部 SCSI 磁带机

dn001


不是每一个运行 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。

作为 root 来到 /kernel/drv/ 目录下,并建立 st.conf 文件的一个备份。
# cp st.conf st.conf.bak
使用编辑器(如 vi)打开该文件,定位到下面的行:

# tape-config-list=
如果它还没有取消注释,那么删除 # 来取消该行的注释。
该文件的以下部分包括对一些常用磁带机的配置设置。它们以三个用引号括起来、且以逗号分开的字段形式出现。如果碰巧正在安装列表中有的磁带机,那么可以滚动到相应行,并取消其注释。

例如,如果正在安装一个 WangDAT 3400,那么,这一行应该像这样:

# "WangDAT Model 3400", "WangDAT 4mm DAT", "WangDAT",

如果它还没有被取消注释,删除 #,取消对该行的注释。另外,如果这是要配置的最后一个或者唯一的磁带机,那么将该行末尾的逗号改为分号。

重要提示:所启用的最后一个磁带机的配置行(也就是最后一个非注释行)必须以一个分号结束。分号表示被启用的磁带机列表的结束。所有出现在最后一个被启用的磁带机前的启用磁带机都以逗号结束。否则,在执行重配置重新启动时将会出现错误。

滚动到该文件的下一部分,找到一行,其中位于等号“=”前的字段匹配前面提到的已启用磁带机配置行中的第三个引号中的字段。继续 WangDAT 磁带机的例子,寻找以 WangDAT 开头的行,像这样:

#WangDAT = 1,0x2b,0,0x659,1,0x00,0;

取消该行的注释。注意,如果存在超过一个匹配项,那么可能需要找到产生最佳结果的那项。

现在保存编辑过的文件。
请注意:如果 st.conf 文件不包含正在安装的磁带机类型的配置信息,那么就需要从制造商获取配置条目。

确定和设置磁带机的 SCSI ID
SCSI 总线上的设备必须配置一个唯一的 SCSI ID,这经常被称为目标 ID。当添加一个 SCSI 设备时,必须分配一个未用的 ID。因此必须确定服务器上哪个 ID 已经被使用。

一般情况下,Sun Enterprise 服务器将保留以下 ID 供特定的内部连接设备使用:

5 用于内部磁带机
6 用于光驱
7 用于主机适配器
另外,一般情况下,启动磁盘设备将使用 ID 0,尽管并没有为此目的而保留该 ID。

为了确定哪个 ID 正在使用,按照以下步骤进行:

启动系统到 ok 提示。

设置 NVRAM auto-boot? 参数为 false。

ok setenv auto-boot? false
通过阻止系统启动进入 Solaris OS 来节省时间,直到您需要这样做。

如果您使用 Solaris OS 的 halt 命令或 Stop-a 键序列进入到 ok 提示,那么要在输入任何其他命令前运行 reset 命令来清除所有缓存和寄存器。如果不这样做,系统会被锁住。

ok reset
系统将重置硬件,并返回到 ok 提示(假设 auto-boot? 参数被设置为 false)。

如果计划将磁带机连接到主 on-board SCSI 总线的外部连接器,那么运行以下命令来确定在这条总线上正在使用的目标:

ok probe-scsi
在用 OpenBoot 3.x 或更新版本的系统上,将会显示以下警告:

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

该显示指出目标 0、1 和 6 正在使用,任何未使用的目标都可以被用于外部磁带机。

记住:尽管这里没有显示,目标 7 总是被保留用于 SCSI 主机适配器。另外,就如前面提到的那样,目标 5 被保留用于内部磁带机。如果内部磁带机当前没有安装,那么可以将目标 5 用于外部磁带机。然而,如果将来某个时候要安装内部磁带机,必须将其分配给目标 5,您将被迫用一个不同的目标 ID 重新配置外部磁带机。由于这个原因,在当前情况下推荐使用 4 作为 ID。

如果您计划将磁带机连接到附属于一个单独 SBus 或 PCI 控制器的外部连接器,可运行以下命令来确定在所有 SCSI 控制器上使用的目标:

ok probe-scsi-all
此时将出现一个屏幕,允许您确定所有控制器上正在使用的目标 ID。一旦确定了希望使用哪个 ID,按照制造商文档将磁带机设置为该 ID。

连接磁带机
在添加 SCSI 设备时,对于合适的操作,您必须遵守适当的总线终结。SCSI 总线的每一端都必须被终结。添加设备到一个外部连接器扩展了总线,因此,终结点也被扩展到了最后一个连接设备。

Sun Enterprise 服务器的一个典型配置是拥有扩展为外部 68 针连接器的主 SCSI 总线,此连接器位于后面板上。外部连接器具有 narrow、Fast/Wide 和 (通常的)UltraSCSI 接口,能够支持几种不同的外部设备。总线也是自动终结的;同样,在连接外部设备时,您也不需要担心启用或禁用终结。您只需要关心设备本身的终结。

在连接外部磁带机时,确保服务器已经关闭并切断电源。另外,连接时,确保磁带机没有加电。如果磁带机将是唯一的外部设备,则简单地将电缆连接到适配器。因为它是总线上的最后一个设备,所以确认它被适当终结。然后,确认设备连接了电源,开启设备,然后开启服务器。

如果其他设备已经连接到外部连接器上,情况就变得比较复杂了。建议查阅 Sun Enterprise Server Owner's Guide 来获取更详细的安装信息。在任何情况下,如果您对 SCSI 设备、总线长度、总线终结等不熟悉,那么推荐您阅读有关 SCSI 端口的部分来更好地理解连接外部设备的需求。

重配置重启动
打开磁带机电源,然后打开服务器电源。如果如上所述,已经将 auto-boot? 参数设置为 false,那么系统将进入到 ok 提示。

输入 boot 命令,执行重配置重启动,就像下面的例子:

ok boot -r
如果 auto-boot? 参数没有设置为 false,并且服务器继续启动进入 Solaris OS,则登录为 root,在根目录中创建一个名称为 reconfigure 的文件。

# touch /reconfigure
重新启动服务器,系统将检查 reconfigure 文件是否存在,如果它存在,则执行重配置启动。

注意任何指示 st.conf 文件问题的启动消息。如果发现问题,记下显示的行号。如果发生错误,则再次编辑 st.conf 文件,然后再执行重配置重启动。

重配置重启动将在 /devices 和 /dev 目录中创建必要的设备条目。
测试磁带机
一旦磁带机条目已经成功创建,用 mt 命令测试磁带机。确认磁带已经插入到磁带机中,运行以下命令:

# 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 页面。


------------------------------------------------------------------------------------------

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.

-----------------------------------------------------------------------------------------
注:“当添加一个外部 SCSI 磁带机时,必须修改 Solaris OS 配置文件 /kernel/drv/st.conf ”

这句话不是必须的,SUN对磁带机兼容还是很好的,不修改这个文件一般都可以识别到磁带机。对于这个文件的修改,不是参考这个安装指南,而是参照磁带机的安装手册。

HP的DDS磁带机上面也带跳线,需要开盖才能找到,对于SGI、IBM、SUN等机器有不同的跳线办法,实际使用中,不做跳线修改也能识别。

标签: