Sunday, 21 October 2018

How to identify the boot device (primary and alternate) in Solaris By Devan

How to identify the boot device (primary and alternate) in Solaris

In a general production environment you’ll find the OS root disk is mirrored to avoid any single point of failures. Its is important to know how to find the primary and alternate boot device to troubleshoot in some cases. You can either identify the boot device from the OK prompt (in case of a SPARC machine) or when the OS is booted up.

SPARC

Identifying boot device at OK prompt

To identify the boot device at OK prompt :
ok> printenv boot-device

boot-device = rootdisk mirrordisk
Here the primary boot device is set to a device alias, “rootdisk”. The alternate boot device is specified using the devalias mirrordisk. So the system first looks for the disk with alias rootdisk and if its not bootable it goes for the 2nd disk i.e. the mirrordisk. Use the devalias command to see the physical device path for the boot-device:
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
Note : Here the physical device is rootdisk /pci@1f,0/ide@d/disk@0,0. In case if boot-device is set wrong, we can either boot from CDROM or in single user mode to identify the correct boot device from the OS command line.

Identifying boot device using OS command line

Using the eeprom command
We can also find out the boot device using the operating system commands. Use the eeprom command to find the boot device :
# eeprom | grep boot-device
boot-device=rootdisk mirror-disk
Here, again the primary boot-device is a devalias “rootdisk”, So in order to find out the physical path of the primary boot disk use :
# prtconf -vp | grep 'rootdisk':
         rootdisk:  '/pci@1f,0/ide@d/disk@0,0'
To find the logical device name of the rootdisk, we can use the format command :
# 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
Similarly you can find the mirrordisk physical path.

x86 / x64

x86 machines uses BIOS instead of the OBP so to duplicate the functionality of eeprom in SPARC machine, x86 systems uses a file /boot/solaris/bootenv.rc at boot time. To find out the primary and alternate boot disk from 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
Also when the system is booted up you can see the 2 different boot options to select from. Below is a screen shot of mirrored boot disk under veritas volume manager.
boot menu in BIOS x86 solaris

No comments:

Post a Comment