在SPARC服务器上,通常情况下我们会使用SVM做系统盘镜像。有时需要知道OS是从哪块盘上启动的。使用eeprom来查看boot-device的设置并不能准确地知道这个信息,boot-device中只是设置了缺省的启动顺序,而管理员是可以在ok状态下使用boot命令来指定启动设备的。
OS启动后,启动路径可以通过prtconf命令来查看。
root@node1:/ #> prtconf -vp | grep bootpath
bootpath: '/pci@0/pci@0/pci@2/scsi@0/disk@0,0:a'
通过bootpath就可以确定OS是从哪块盘上启动的。
root@node1:/ #> ls -ltr /dev/dsk | grep '/pci@0/pci@0/pci@2/scsi@0/'
lrwxrwxrwx 1 root root 47 Nov 8 16:28 c1t0d0s0 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@0,0:a
lrwxrwxrwx 1 root root 47 Nov 8 16:28 c1t0d0s1 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@0,0:b
lrwxrwxrwx 1 root root 47 Nov 8 16:28 c1t0d0s2 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@0,0:c
lrwxrwxrwx 1 root root 47 Nov 8 16:28 c1t0d0s3 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@0,0:d
lrwxrwxrwx 1 root root 47 Nov 8 16:28 c1t0d0s4 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@0,0:e
lrwxrwxrwx 1 root root 47 Nov 8 16:28 c1t0d0s5 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@0,0:f
lrwxrwxrwx 1 root root 47 Nov 8 16:28 c1t0d0s6 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@0,0:g
lrwxrwxrwx 1 root root 47 Nov 8 16:28 c1t0d0s7 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@0,0:h
lrwxrwxrwx 1 root root 47 Nov 23 15:24 c1t1d0s0 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@1,0:a
lrwxrwxrwx 1 root root 47 Nov 23 15:24 c1t1d0s1 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@1,0:b
lrwxrwxrwx 1 root root 47 Nov 23 15:24 c1t1d0s2 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@1,0:c
lrwxrwxrwx 1 root root 47 Nov 23 15:24 c1t1d0s3 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@1,0:d
lrwxrwxrwx 1 root root 47 Nov 23 15:24 c1t1d0s4 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@1,0:e
lrwxrwxrwx 1 root root 47 Nov 23 15:24 c1t1d0s5 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@1,0:f
lrwxrwxrwx 1 root root 47 Nov 23 15:24 c1t1d0s6 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@1,0:g
lrwxrwxrwx 1 root root 47 Nov 23 15:24 c1t1d0s7 -> ../../devices/pci@0/pci@0/pci@2/scsi@0/sd@1,0:h
从这里可以看到c1t0d0s0就是启动盘。(需要把第一步输出中的disk换成sd)
此外,prtconf中还包含了OBP中系统和用户定义的别名信息:
root@node1:/ #> prtconf -vp | grep pci
bootpath: '/pci@0/pci@0/pci@2/scsi@0/disk@0,0:a'
pci-mem64?: 'true'
nvramrc: 'devalias bootdisk1 /pci@0/pci@0/pci@2/scsi@0/disk@0,0:a devalias bootdisk2 /pci@0/pci@0/pci@2/scsi@0/disk@1,0:a devalias net /pci@0/pci@0/pci@1/pci@0/pci@2/network@0'
net: '/pci@0/pci@0/pci@1/pci@0/pci@2/network@0'
bootdisk2: '/pci@0/pci@0/pci@2/scsi@0/disk@1,0:a'
bootdisk1: '/pci@0/pci@0/pci@2/scsi@0/disk@0,0:a'
net3: '/pci@0/pci@0/pci@1/pci@0/pci@3/network@0,1'
net2: '/pci@0/pci@0/pci@1/pci@0/pci@3/network@0'
net1: '/pci@0/pci@0/pci@1/pci@0/pci@2/network@0,1'
net0: '/pci@0/pci@0/pci@1/pci@0/pci@2/network@0'
cdrom: '/pci@0/pci@0/pci@1/pci@0/pci@1/pci@0/usb@0,2/storage@2/disk@0:f'
disk3: '/pci@0/pci@0/pci@2/scsi@0/disk@3'
disk2: '/pci@0/pci@0/pci@2/scsi@0/disk@2'
disk1: '/pci@0/pci@0/pci@2/scsi@0/disk@1'
disk0: '/pci@0/pci@0/pci@2/scsi@0/disk@0'
disk: '/pci@0/pci@0/pci@2/scsi@0/disk@0'
scsi: '/pci@0/pci@0/pci@2/scsi@0'
name: 'pci'
compatible: 'SUNW,sun4v-pci'……