Both SPARC based and x86 based systems use the new style of booting with a boot archive, which is a file system image that contains the files required for booting. When booting from a ZFS root file system, the path names of both the boot archive and the kernel file are resolved in the root file system that is selected for booting.
When the system is booted for installation, a RAM disk is used for the root file system during the entire installation process.
Booting from a ZFS file system differs from booting from a UFS file system because with ZFS, a device specifier identifies a storage pool, not a single root file system. A storage pool can contain multiple bootable datasets or ZFS root file systems. When booting from ZFS, you must specify a boot device and a root file system within the pool that was identified by the boot device.
By default, the dataset selected for booting is the one identified by the pool's bootfs property. This default selection can be overridden by specifying an alternate bootable dataset that is included in the boot -Z command.
You can create a mirrored ZFS root pool when the system is installed, or you can attach a disk to create a mirrored ZFS root pool after installation. Review the following known issues regarding mirrored ZFS root pools:
CR 6668666 – You must install the boot information on the additionally attached disks by using the installboot or installgrub commands if you want to enable booting on the other disks in the mirror. If you create a mirrored ZFS root pool with the initial installation method, then this step is unnecessary. For example, if c0t1d0s0 was the second disk added to the mirror, then the installboot or installgrub command would be as follows:
sparc# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t1d0s0 |
x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t1d0s0 |
You can boot from different devices in a mirrored ZFS root pool. Depending on the hardware configuration, you might need to update the PROM or the BIOS to specify a different boot device.
For example, you can boot from either disk (c1t0d0s0 or c1t1d0s0) in this pool.
# zpool status pool: rpool state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 mirror ONLINE 0 0 0 c1t0d0s0 ONLINE 0 0 0 c1t1d0s0 ONLINE 0 0 0 |
On a SPARC based system, enter the alternate disk at the ok prompt.
ok boot /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@1 |
After the system is rebooted, confirm the active boot device. For example:
SPARC# prtconf -vp | grep bootpath bootpath: '/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@1,0:a' |
On an x86 based system, use syntax similar to the following:
x86# prtconf -v|sed -n '/bootpath/,/value/p' name='bootpath' type=string items=1 value='/pci@0,0/pci8086,25f8@4/pci108e,286@0/disk@0,0:a' |
On an x86 based system, select an alternate disk in the mirrored ZFS root pool from the appropriate BIOS menu.
On a SPARC based system with multiple ZFS BEs, you can boot from any BE by using the luactivate command.
During the installation and Solaris Live Upgrade process, the ZFS root file system is automatically designated with the bootfs property.
Multiple bootable datasets can exist within a pool. By default, the bootable dataset entry in the /pool-name/boot/menu.lst file is identified by the pool's bootfs property. However, a menu.lst entry can contain a bootfs command, which specifies an alternate dataset in the pool. In this way, the menu.lst file can contain entries for multiple root file systems within the pool.
When a system is installed with a ZFS root file system or migrated to a ZFS root file system, an entry similar to the following is added to the menu.lst file:
title zfsnv109BE bootfs mpool/ROOT/zfsnv109BE |
When a new BE is created, the menu.lst file is updated. Until CR 6696226 is fixed, you must update the menu.lst file manually after you activate the BE with the luactivate command.
When a new BE is created, the menu.lst file is updated automatically.
On a SPARC based system, two new boot options are available:
After the BE is activated, you can use the boot -L command to display a list of bootable datasets within a ZFS pool. Then, you can select one of the bootable datasets in the list. Detailed instructions for booting that dataset are displayed. You can boot the selected dataset by following the instructions.
Use the boot -Z dataset command to boot a specific ZFS dataset.
If you have multiple ZFS BEs in a ZFS storage pool on your system's boot device, you can use the luactivate command to specify a default BE.
For example, the following ZFS BEs are available as described by the lustatus output:
# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- zfsnv109BE yes yes yes no - zfsnv1092BE yes no no yes - |
If you have multiple ZFS BEs on your SPARC based system, you can use the boot -L command. For example:
ok boot -L Rebooting with command: boot -L Boot device: /pci@1f,0/pci@1/scsi@4,1/disk@2,0:a File and args: -L 1 zfsnv109BE 2 zfsnv1092BE Select environment to boot: [ 1 - 2 ]: 2 To boot the selected entry, invoke: boot [<root-device>] -Z mpool/ROOT/zfsnv1092BE Program terminated ok boot -Z rpool/ROOT/zfsnv1092BE |
On a SPARC based system, you can boot from the failsafe archive located in /platform/`uname -i`/failsafe as follows. For example:
ok boot -F failsafe |
If you want to boot a failsafe archive from a particular ZFS bootable dataset, use syntax similar to the following:
ok boot -Z rpool/ROOT/zfsnv109BE -F failsafe |
The following entries are added to the /pool-name/boot/grub/menu.lst file during the installation process or Solaris Live Upgrade operation to boot ZFS automatically:
title Solaris Express Community Edition zfsnv109BE X86 bootfs rpool/ROOT/zfsnv109BE findroot (pool_rpool,0,a) kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS module$ /platform/i86pc/$ISADIR/boot_archive |
If the device identified by GRUB as the boot device contains a ZFS storage pool, the menu.lst file is used to create the GRUB menu.
On an x86 based system with multiple ZFS BEs, you can select a BE from the GRUB menu. If the root file system corresponding to this menu entry is a ZFS dataset, the following option is added.
-B $ZFS-BOOTFS |
When booting from a ZFS file system, the root device is specified by the boot -B $ZFS-BOOTFS parameter on either the kernel or module line in the GRUB menu entry. This value, similar to all parameters specified by the -B option, is passed by GRUB to the kernel. For example:
title Solaris Express Community Edition zfsnv1095BE X86 findroot (pool_rpool,0,a) bootfs rpool/ROOT/zfsnv109BE kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS module$ /platform/i86pc/$ISADIR/boot_archive |
The x86 failsafe archive is /boot/x86.miniroot-safe and can be booted by selecting the Solaris failsafe entry from the GRUB menu. For example:
title zfsnv109BE failsafe findroot (pool_rpool,0,a) bootfs rpool/ROOT/zfsnv109BE kernel /boot/platform/i86pc/kernel/unix -s -B console=ttyb module /boot/x86.miniroot-safe |
In the Solaris Express Community Edition, build 100, the fast reboot feature provides the ability to reboot within seconds on x86 based systems. With the fast reboot feature, you can reboot to a new kernel without experiencing the long delays that can be imposed by the BIOS and boot loader. The ability to fast reboot a system drastically reduces down time and improves efficiency.
You must still use the init 6 command when transitioning between BEs with the luactivate command. For other system operations where the reboot command is appropriate, you can use the reboot f command. For example:
# reboot -f |
Use the following procedure if you need to boot the system so that you can recover from a lost root password or similar problem.
You will need to boot failsafe mode or boot from alternate media, depending on the severity of the error. In general, you can boot failsafe mode to recover a lost or unknown root password. The OpenSolaris release does not support failsafe mode.
If you need to recover a root pool or root pool snapshot, see Recovering the ZFS Root Pool or Root Pool Snapshots.
Boot failsafe mode.
On a SPARC system:
ok boot -F failsafe |
On an x86 system, select failsafe mode from the GRUB prompt.
Mount the ZFS BE on /a when prompted:
. . . ROOT/zfsBE was found on rpool. Do you wish to have it mounted read-write on /a? [y,n,?] y mounting rpool on /a Starting shell. |
Change to the /a/etc directory.
# cd /a/etc |
If necessary, set the TERM type.
# TERM=vt100 # export TERM |
Correct the passwd or shadow file.
# vi shadow |
Reboot the system.
# init 6 |
If a problem prevents the system from booting successfully or some other severe problem occurs, you will need to boot from a network install server or from a Solaris installation CD, import the root pool, mount the ZFS BE, and attempt to resolve the issue.
You can use this procedure on a system that is running the Open Solaris release to recover a lost root password or similar problem.
Boot from an installation CD or from the network.
On a SPARC system:
ok boot cdrom -s ok boot net -s |
If you don't use the -s option, you will need to exit the installation program.
On an x86 system, select the network boot or boot from local CD option.
Import the root pool and specify an alternate mount point. For example:
# zpool import -R /a rpool |
Mount the ZFS BE. For example:
# zfs mount rpool/ROOT/zfsBE |
Access the ZFS BE contents from the /a directory.
# cd /a |
Reboot the system.
# init 6 |