SPARC

在 OK 提示符下识别引导设备

在 OK 提示符下识别引导设备:

ok> printenv boot-device
boot-device = rootdisk mirrordisk

此处的主引导设备设置为设备别名“rootdisk”。
备用引导设备是使用 devalias mirrordisk 指定的。
因此,系统首先查找别名为 rootdisk 的磁盘,如果它不可引导,则查找第二个磁盘,例如:镜像磁盘。
使用 devalias 命令查看引导设备的物理设备路径:

ok> devalias screen /pci@1f,0/SUNW,m64B@13
net /pci@1f,0/network@c,1
cdrom2 /pci@1f,0/ide@d/cdrom@2,0:f
cdrom1 /pci@1f,0/ide@d/cdrom@1,0:f
cdrom /pci@1f,0/ide@d/cdrom@1,0:f
rootdisk /pci@1f,0/ide@d/disk@0,0                 -- the physical path to the 'rootdisk' alias
mirrordisk /pci@1f,0/ide@d/disk@3,0               -- the physical path to the 'mirrordisk' alias
disk2 /pci@1f,0/ide@d/disk@2,0
disk1 /pci@1f,0/ide@d/disk@1,0
disk0 /pci@1f,0/ide@d/disk@0,0
ide /pci@1f,0/ide@d
floppy /pci@1f,0/isa@7/dma/floppy
ttyb /pci@1f,0/isa@7/serial@0,2e8
ttya /pci@1f,0/isa@7/serial@0,3f8
name aliases

注意:这里的物理设备是 rootdisk /pci@1f,0/ide@d/disk@0,0。
如果引导设备设置错误,我们可以从 CDROM 或者单用户模式引导,以从操作系统命令行识别正确的引导设备。

使用操作系统命令行识别引导设备

使用 eeprom 命令
我们还可以使用操作系统命令找出引导设备。
使用 eeprom 命令查找引导设备:

# eeprom | grep boot-device
boot-device=rootdisk mirror-disk

其中:主引导设备再次是一个devalias“rootdisk”,所以为了找出主引导盘的物理路径,请使用:

# prtconf -vp | grep 'rootdisk':
         rootdisk:  '/pci@1f,0/ide@d/disk@0,0'

要查找 rootdisk 的逻辑设备名称,我们可以使用 format 命令:

# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0 [ST320414A cyl 39533 alt 2 hd 16 sec 63]
/pci@1f,0/ide@d/dad@0,0                                 -- the logical device c0t0d0 is the same physical device as the 'rootdisk' alias from prtconf -vp
1. c0t2d0 [DEFAULT cyl 39533 alt 2 hd 16 sec 63]
/pci@1f,0/ide@d/dad@2,0

同样可以找到镜像磁盘物理路径。

如何在 Solaris 中识别引导设备

在一般的生产环境中,我们会发现操作系统根磁盘被镜像以避免任何单点故障。
在某些情况下,了解如何查找主要和备用引导设备以进行故障排除非常重要。
我们可以在 OK 提示符下(如果是 SPARC 机器)或者在操作系统启动时识别引导设备。

之路 on it Road.com

x86/x64

x86 机器使用 BIOS 而不是 OBP,因此为了在 SPARC 机器中复制 eeprom 的功能,x86 系统在启动时使用文件 /boot/solaris/bootenv.rc。
要从 eeprom 找出主引导盘和备用引导盘:

# eeprom |grep boot
bootpath=/pci@0,0/pci15ad,1976@10/sd@0,0:a
altbootpath=/pci@0,0/pci15ad,1976@10/sd@1,0:a

此外,当系统启动时,我们可以看到 2 个不同的启动选项可供选择。
下面是 veritas 卷管理器下镜像启动磁盘的屏幕截图。

日期:2020-09-17 00:15:10 来源:oir作者:oir