GRUB and the Solaris 10 1/06 OS: The New Bootloader for x86 PlatformsShudong Zhou and Jan Setje-Eiler, December 2005 This paper describes the boot architecture for the Solaris 10 1/06 Operating System on x86 platforms, as well as the user experience. Please note: Some of the details in this paper may change without notice. Refer to man pages and Solaris OS administration documents for supported interfaces. The new bootloader described in this document is available prior to the formal release of the Solaris 10 1/06 OS from either the OpenSolaris Project or the Solaris Express program. 1. Introduction to the Boot ProcessWhen an x86-based system powers on, the BIOS initializes the CPU, memory, and platform hardware. Upon completion, the BIOS loads the initial bootstrap software (that is, the bootloader) from the configured boot device and hands control over to the bootloader. The Solaris 10 3/05 OS and earlier releases use a Sun-developed bootloader that includes an interactive shell and a menu-driven device configuration assistant based on realmode drivers. Starting with the Solaris 10 1/06 release, the open source GRUB or GNU GRand Unified Bootloader (see reference 1) is used as the bootloader. The initial delivery is based on GRUB version 0.95 and will be updated as newer versions become available. The Solaris kernel is fully compliant with the Multiboot Specification (reference 2); hence, the Solaris OS can be booted via any bootloader implementing the Multiboot Specification. The switch to GRUB brings several benefits to Solaris customers.
Finally, by adopting a bootloader developed by the open source community, Sun's customers can leverage the considerable GRUB experience gained within that community. 2. Booting the Solaris OS With GRUBOnce GRUB gains control, it displays a menu on the console asking
the user to choose an OS instance to boot. The user may pick a menu
item, modify a menu item using the built-in editor, or manually load
an OS kernel in command mode. To boot the Solaris OS, GRUB must load
a The multiboot program is responsible for assembling core kernel
modules in memory by reading the Once the kernel gains control, it will initialize CPU, memory, and
I/O devices, and it will mount the root file system on the device as
specified by the 3. InstallationThe Solaris OS may be installed from CD, DVD, and net install servers. The Solaris 10 1/06 release differs from the Solaris 10 3/05 release in several ways:
When booting the install miniroot, a GRUB menu is displayed. A user may interactively edit boot options (see section 4.2). After GRUB loads the Solaris OS, the following install menu is displayed:
The Device Configuration Assistant and associated interactive shell, which users are familiar with from the Solaris 10 3/05 OS and earlier, are no longer present. Users wishing to add drivers required during install (for example, host adapter drivers) should choose option 5 and supply an ITU (Install Time Update) floppy or CD/DVD. Option 6 is available for system recovery. It provides quick access to a root prompt without going through system identification. This option is identical to booting a Solaris Failsafe session (see section 4.4). 4. Managing the Boot Subsystem4.1 BIOS It is generally a good idea to update the BIOS firmware to the latest revision before installing the Solaris OS. This is typically accomplished by visiting the support page for the vendor that manufactured the computer. Compared to the Solaris 10 3/05 release, the Solaris 10 1/06 OS uses a different subset of BIOS features. In particular, the kernel makes use of more information from the Advanced Configuration and Power Management Interface (ACPI) table, using the parser from Intel's ACPI CA software. On systems that do not conform to BIOS 2.0 specifications, the syslog may contain messages related to parsing the ACPI table, such as: ACPI-0725: *** Warning: Type override - [4s] had invalid type (DEB_[\200IODB
Such messages are harmless and do not impact normal system operation.
If ACPI errors prevent normal system boot, the user can disable the
ACPI parser by setting kernel .. -B ...,acpi-user-options=2 In this case, the system assumes a set of standard ISA devices is present, including a keyboard, a mouse, two serial ports, and a parallel port. 4.2 Boot Options To boot the Solaris OS, a user may specify the kernel to load,
options to be passed to the kernel (see Specifying kernel name and kernel options via # eeprom boot-file="kernel/unix -v"
To specify the same thing on the GRUB menu, modify the kernel /platform/i86pc/multiboot to: kernel /platform/i86pc/multiboot kernel/unix -v
See Properties other than kernel /platform/i86pc/multiboot -B prop1=val1[,prop2=val2...]
To configure the serial console on kernel /platform/i86pc/multiboot -B console=ttya
If the property value contains commas, the value should be quoted.
The following GRUB command sets the Solaris console to kernel /platform/i86pc/multiboot -B console=ttya,ttya-mode="115200,8,n,1,-"
In short, specifying 4.3 Boot Archive The boot archive refers to the file The content of the boot archive is specified in
4.4 The Failsafe Menu Entry New to the Solaris 10 1/06 OS is a file, Suppose you add a new package containing a faulty driver, and the
system panics at boot time. Upon reboot, you can pick the Solaris
failsafe menu entry. While in the failsafe session, mount the root
file system on The file 4.5 Keeping the System Bootable To ensure that the system remains bootable, the GRUB boot blocks, the GRUB menu, and the boot archive must be up-to-date. The GRUB boot blocks reside in the Solaris partition. If the boot
blocks become corrupt, they should be reinstalled using the
The GRUB menu resides in The boot archive must be updated as the root file system is
modified. In cases of system failure (power failure or kernel panic)
immediately following a kernel file update, the boot archive may be
out of sync with the root file system. In such cases, the
5. Multiboot SetupIf other bootable partitions exist, the Solaris install program attempts to add GRUB entries for them. At the time of this writing, Microsoft Windows and diagnostic partitions are recognized. Users may add other operating systems by editing the GRUB menu directly. Suppose you have a system with the Solaris OS, Linux, and Windows laid out on the same disk as follows: fdisk partition 0: Windows
fdisk partition 1: Linux
fdisk partition 2:
slice 0 Solaris 9
slice 3 Solaris 10 1/06The GRUB menu should look like: #---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris 10 1/06
root (hd0,2,d)
kernel /platform/i86pc/multiboot
module /platform/i86pc/boot_archive
#---------------------END BOOTADM--------------------
title Solaris 9
root (hd0,2,a)
chainloader +1
makeactive
title Linux
root (hd0,1)
kernel <from Linux's GRUB menu...>
initrd <from Linux's GRUB menu...>
title Windows
root (hd0,0)
chainloader +1
Note that the Solaris GRUB as obtained from sources other than Sun does not currently recognize Solaris on-disk VTOC and UFS formats. Sun has submitted changes to the GRUB project
to support this; until they have been integrated, only the Solaris
GRUB will work. If Linux installed GRUB on the master
boot block, you will not be able to get to the Solaris OS even if you
make the Solaris partition the active partition. In this case, you
can chainload from the Linux GRUB by modifying the menu on Linux.
Alternatively, you can replace the master boot sector with the
Solaris GRUB in the above example, by using the installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t2d0s3 Before the Solaris VTOC and UFS implementation is propagated to the standard GRUB release, only the Solaris version of GRUB will work. 6. Netboot and Diskless ClientsBooting from a network typically requires a DHCP server configured for PXE clients and a boot server providing TFTP service. If there is no PXE/DHCP server available (or the BIOS does not contain PXE code), it is possible to load GRUB from floppy, CD-ROM, or a local disk, configure the network manually in the GRUB menu, and boot the Solaris OS from a file server. See Appendix B for additional details. Setting up the DHCP server is a site-specific task and is left to the local network administrator. See the Sun BluePrints document, “Configuring JumpStart Servers to Provision Sun x86-64 Systems”: http://www.sun.com/blueprints/0205/819-1692.pdf. To boot the Solaris OS, the DHCP server must respond to the BIOS PXE
request with the IP address of the file server and the name of the
boot file ( 6.1 Net Install Server The After running 6.2. Diskless Clients The After running The boot archive of diskless clients is automatically updated upon shutdown of the client. If the client's boot archive is out of date when the client is down, the archive can be updated from the server side with the following: # bootadm update-archive -R /export/root/<hostname> This works on both SPARC and x86 platform-based servers, serving x86 clients. 7. Legacy Issues7.1 The Solaris x86 Boot Partition For x86 systems, the Solaris boot partition is a very small (about 10MB) primary With modern systems, there is no longer a need for a boot partition. From the
Solaris 10 1/06 OS onward, users no longer have the option to create a boot partition. When upgrading from
an old release, an existing x86 boot partition may be retained to
keep the system bootable without manual intervention. In such cases,
the x86 boot partition is mounted at 7.2 Realmode Drivers Prior to the Solaris 10 1/06 OS, realmode drivers were run as part of the boot process. It is possible that some existing kernel drivers implicitly depend on a corresponding realmode driver to place hardware in a specific state. Since realmode drivers are no longer part of the GRUB-based boot, such a kernel driver may not function properly. If you run into such a case, please report the problem to the driver vendor so that the kernel driver will be fixed. Appendix A. GRUB BasicsThis appendix describes the basic concepts of GRUB. Some of the details in this appendix may change without notice. Refer to GRUB documentation for more detailed information. A.1 Device Naming The primary purpose of a bootloader is to load data from a storage device to system memory. To work with GRUB, it is necessary to understand how GRUB names devices. The floppy disk is named as: (fd0) -- first, second floppy GRUB can only reference a single network interface: (nd) -- network interface And this is almost always the interface the BIOS probed and configured via DHCP. It is also possible to configure a network interface by booting GRUB from floppy or other local media (see Appendix B). Hard disk names start with (hd0) -- first bios disk (also the BIOS boot disk 0x81) (hd1) -- second bios disk (BIOS disk 0x81) (hd0,1) -- first bios disk, second primary partition (hd0,0,a) -- first bios disk, first fdisk partition, Solaris/BSD slice 0 and 1 Be aware that BIOS disk numbering may change when BIOS configuration is modified. Hence, the GRUB menu may become invalid if you change the BIOS boot disk order or modify the disk configuration. To handle boot issues related to disk renumbering in BIOS, it's essential to know the disk naming conventions. A.2 Functional Components The functional GRUB components include Note that you cannot use The GRUB shell, although present in A.3 The GRUB Menu The default menu file is default 0 timeout 10 serial --unit=0 --speed=9600 terminal serial #---------- ADDED BY BOOTADM - DO NOT EDIT ---------- title Solaris root (hd0,0,a) kernel /platform/i86pc/multiboot -B console=ttya module /platform/i86pc/boot_archive #---------------------END BOOTADM-------------------- #---------- ADDED BY BOOTADM - DO NOT EDIT ---------- title Solaris failsafe root (hd0,0,a) kernel /boot/multiboot -B console=ttya -s module /boot/x86.miniroot.safe #---------------------END BOOTADM--------------------
The To explicitly specify a 64-bit kernel, modify the GRUB kernel command to: kernel /platform/i86pc/multiboot kernel/amd64/unix Likewise, the following command boots the 32-bit kernel: kernel /platform/i86pc/multiboot kernel/unix A.4 GRUB Command Mode You can boot the OS by typing commands at the GRUB prompt. To get the GRUB prompt, hit 'c' at the GRUB menu. Type 'help' for a list of available commands. Hitting Esc returns to the menu. You can also hit 'e' to edit an existing menu item. When done with editing, hit 'b' to boot the system with the modified GRUB entry. Appendix B. Network DeploymentThis appendix describes the best practices of deploying the Solaris OS on x86 platforms via the network. Some of the details in this appendix may change without notice. Refer to man pages and Solaris administration documents for supported interfaces. B.1 Overview of Solaris Network Deployment The idea behind deploying the Solaris OS over the network is to place Solaris OS images in a centralized location. Any machine connected to the network may boot and install the release of choice with little or no involvement of the administrator. The installation process can even be done in a hands-off manner via Solaris JumpStart software. Booting from the network typically requires a DHCP server
configured for PXE clients and a file server providing Booting the Solaris OS using PXE works as follows:
In a typical deployment scenario, In the following sections, we will elaborate on the DHCP server setup, client requirements, and several different deployment scenarios. B.2 The DHCP Service When a client sends a DHCP request, the server is informed of the client's ID (typically Ethernet address), the "class" of the request, and the subnet the client resides in. The Solaris DHCP server forms the response-based macros matching the client request:
The class macro is named by a "class string" embedded in
the DHCP request. On x86 platforms, BIOS always makes a DHCP request
with the class The network macro is named by the IP address of the subnet. If a
macro The IP macro is named by an IP address. It is rarely used in the context of booting the Solaris OS on x86 platforms. The client macro is named by the client's type (01 for ether) and
MAC address in uppercase letters. For a client with Ethernet address
Suppose we have a client in subnet The DHCP server has matching macros: - PXEClient BootSrvA: 129.146.87.194 BootFile: pxegrub - 129.146.87.0 Router: 129.146.87.1 NISdmain: sunsoft.eng.sun.com - 01000039FCF2EF BootFile: 01000039FCF2EF The actual DHCP response will be as follows: BootSrvA: 129.146.87.194 BootFile: 01000039FCF2EF Router: 129.146.87.1 NISdmain: sunsoft.eng.sun.com
Note that the B.3. The Simplest Netboot Setup For the bare minimum, you need a server and a client. The server
should have a running DHCP server and a Solaris distribution image
available. The client machine is connected to the same subnet as the
server capable of supporting a PXE boot request. Here are steps for server
setup, assuming the server's IP address is a. Go to the Tools directory of the Solaris distribution image and run: # add_install_client -d -e 0:0:39:fc:f2:ef i86pc
b. Create a client macro name BootSrvA: 192.168.0.123 BootFile: 01000039FCF2EF
You can do this either from the Now you can boot the client and install the Solaris OS. B.4. Net Install Without PXE/DHCP It is possible to load GRUB from floppy, CD-ROM, or a local disk,
configure the network manually in GRUB, and download
The standard GRUB grub> ifconfig --address=192.168.0.02 --gateway=192.168.0.1 --mask=255.255.255.0 --server=192.168.123.110 grub> root (nd) grub> kernel /multiboot.I86PC.Solaris_10-1 kernel/unix -B install_media=192.168.123.110:/export/setje/boot_74L2 grub> module /x86.miniroot grub> boot
Of course, the Make sure you edit <format floppy> # mount -F pcfs /dev/diskette /mnt (you may have to disable vold prior to doing this) # cd /boot/grub # /sbin/installgrub stage1 stage2 /dev/rdiskette stage1 written to boot sector on floppy first 2 sectors of stage2 written on floppy
Edit
title Solaris
ifconfig --address=192.168.0.2 --gateway=192.168.0.1
--mask=255.255.255.0 --server=192.168.123.110
root (nd)
kernel /multiboot.I86PC.Solaris_11-1 kernel/unix -B
install_media=192.168.123.110:/export/setje/boot_74L2
module /x86.miniroot
B.5. Managing Multiple Solaris Images In the presence of multiple Solaris images, you need a way to pick which release or build to install for each client. Here are some possible ways to do this.
Case (a) is the standard way of managing the boot server. The
network admin does a one-time setup of DHCP service for each client.
After that, the client user logs in the
boot server and runs Case (b) requires the use of DHCP option 150 to supply the GRUB
menu file. When the user selects a release/build for a client, the
DHCP configuration is modified to set option 150 to the menu file
containing the selected release/build. Note that the menu file for
each release/build must be created a priori on the boot server. If
the selected release/build does not use
Case (c) works only for releases or builds based on B.6. Automated Deployment Sequence Automated deployment often performs the following sequence:
At the end of the deployment, the machine sits idle, waiting for user action. In most cases, the initial netboot can be initiated manually by pressing F12 (or some other key sequence, depending on the platform). However, some systems do not support BIOS serial console redirection, and requiring the user to be at the physical console is unreasonable. Also, some BIOSes provides a very short time window for requesting netboot, making it a poor user experience. One workaround is to boot from floppy to net, then rewrite the floppy to boot to disk. This method is no longer viable as newer platforms no longer ship with floppy drives. We recommend loading GRUB from disk. Add the following menu
entry in # bootadm set-menu default=<menu_entry_number> where
title Solaris Jumpstart
dhcp
root (nd)
kernel .../multiboot kernel/unix - install -B console=...
module ../x86.miniroot
Once the system is installed, the default B.7. Trouble-Shooting Now, what happens if this doesn't work? Here are some tips for trouble-shooting. a. Client boots straight to disk without attempting netboot. This usually means the client PXE ROM is disabled or that the BIOS is configured to boot from the disk before the network. The fix is to go into BIOS and modify the configuration. Details vary from one machine to another. b. Client attempts to boot net, but there is no response. Perform the usual checking of network cables, LED lights (if
any) on the interface card, and so on. Run # snoop -v [-d <interface>] 0:0:39:fc:f2:ef
where
If there is no If the PXEClient:Arch:00000:UNDI:002001 c. Client displays TFTP timeout message. This can happen when d. Client hangs in the middle of downloading The TFTP protocol can transfer up to 65K blocks. Some If the server is running the Solaris 8 OS, you may copy
e. Client finishes downloading Most likely, the console output went somewhere else. Make
sure the f. Client displays "No ethernet card found" message. This may happen when booting GRUB from local media and loading the Solaris OS from the network. It is an indication that the GRUB cannot find any network interface using the PCI BIOS32 service. g. Client displays "No PnPBios found" message. This may happen when booting GRUB from local media and loading the Solaris OS from the network. In this case, GRUB located the network interface, but failed to locate the PnP Bios service to install UNDI ROM from the network interface card. References
Discuss and comment on this resource in the BigAdmin Wiki
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
| ||||