Back to the main page
GRUB booting on Solaris x86
Let's talk bit more about booting the Solaris on x86 architecture (NOT on SPARC)
Now, on Solaris 10, the default boot loader is GRUB (GRand Unified Bootloader).
The GRUB loads boot archive in system's memory.
Okay so what's boor archive now?
Well, simply it's bunch of critical files that's needed during boot time before / (root) file system is mounted.
And these critical files are kernel modules and configuration files.
Sun says, "Boot archive is interface that is used to boot Solaris OS". Remember, there is not boot archive on SPARC, only on x86 architecture.
The GRUB has menu so you can select OS instance you want to boot.
Sometimes you may need to perform next two tasks below and luckily, there are nice commands for that. I'll talk about them more later.
- Rebuild the boot archive
- Install the GRUB boot loader
But let's do first thing first and this is overview of booting.
GRUB functional components are:
- The system is powered on.
- BIOS (yes this is x86, not SPARC) initializes CPU, memory and platform hardware
- BIOS loads boot loader (GRUB) from boot device
- GRUB takes control now
- GRUB shows menu with boot options (predefined in configuration file /boot/grub/menu.list)
- There are also options for edit command - press "e" or for CLI - press "c"
- Example: Boot in a single user mode
- Press e when GRUB main menu shows up
- Move to kernel /platform/i86pc/multiboot line. It has additional options if you boot from ZFS.
- Press e to edit this command. Prompt grub edit> shows up.
- Type -s at the end of line. Press Enter brings you back to main menu.
- Once in main menu, press b to boot in single user mode.
- Same can be done for reconfigure boot with adding -r
- If you need verbose for better troubleshooting, use -v
- GRUB boots primary boot archive (see menu.list file module /platform/i86pc/boot_archive ) and multiboot program (see this in menu.list file: kernel /platform/i86pc/multiboot ).
- Primary boot archive is file system image containing kernel modules and data. This goes into memory in this moment.
- Multiboot program is executable file and takes control from GRUB.
- Multiboot program reads boot archive and assembles core kernel modules into memory.
The boot behavior can be modified using command eeprom which will edit file /boot/solaris/bootenv.rc. See the file for more info.
- stage-1 installed on first sector of fdisk partition.
- stage-2 installed in reserved area in fdisk partition. This is the core image of GRUB.
Update a corrupt boot archive
Well, sooner or later you will have to do this, trust me :(
Primary boot archive has files below (if any of them is updated, rebuild boot archive with "bootadm update-archive".
- Boot "Solaris failsafe"
- You may get prompt to sync out-of-date boot archive on say /dev/dsk/c0t0d0s0 - do it with Y
- Mount device with corrupted boot archive on /a
- And forcibly update corrupted boot archive on alternate root: bootadm update-archive -f -R /a
- umount /a
- init 6
- Good luck!
- Tip: setup cron job to run bootadm update-archive on regular basis and do it manually after system upgrade or patch install.
Actually, beside primary boot archive, there is one more - Failsafe boot archive. It can boot on its own, require no maintenance and is created during OS installation.
This is also something you may need to do, say you are mirroring two disks using SVM and want to install GRUB on second disk in case you need to boot from there.
So to install GRUB in master boot sector run (replace c1t0d0s0 with yours if needed):
installgrub -fm /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t0d0s0
See man page for "installgrub"
Back to the main page