JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 11.1 Administration: ZFS File Systems     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Oracle Solaris ZFS File System (Introduction)

2.  Getting Started With Oracle Solaris ZFS

3.  Managing Oracle Solaris ZFS Storage Pools

4.  Managing ZFS Root Pool Components

Managing ZFS Root Pool Components (Overview)

ZFS Root Pool Requirements

ZFS Root Pool Space Requirements

ZFS Root Pool Configuration Requirements

Managing Your ZFS Root Pool

Installing a ZFS Root Pool

How to Update Your ZFS Boot Environment

How to Mount an Alternate BE

How to Configure a Mirrored Root Pool (SPARC or x86/VTOC)

How to Configure a Mirrored Root Pool (x86/EFI (GPT))

How to Replace a Disk in a ZFS Root Pool (SPARC or x86/VTOC)

How to Replace a Disk in a ZFS Root Pool (SPARC or x86/EFI (GPT))

How to Create a BE in Another Root Pool (SPARC or x86/VTOC)

How to Create a BE in Another Root Pool (SPARC or x86/EFI (GPT))

Managing Your ZFS Swap and Dump Devices

Adjusting the Sizes of Your ZFS Swap and Dump Devices

Troubleshooting ZFS Dump Device Issues

Booting From a ZFS Root File System

Booting From an Alternate Disk in a Mirrored ZFS Root Pool

Booting From a ZFS Root File System on a SPARC Based System

Booting From a ZFS Root File System on an x86 Based System

Booting For Recovery Purposes in a ZFS Root Environment

How to Boot the System For Recovery Purposes

5.  Managing Oracle Solaris ZFS File Systems

6.  Working With Oracle Solaris ZFS Snapshots and Clones

7.  Using ACLs and Attributes to Protect Oracle Solaris ZFS Files

8.  Oracle Solaris ZFS Delegated Administration

9.  Oracle Solaris ZFS Advanced Topics

10.  Oracle Solaris ZFS Troubleshooting and Pool Recovery

11.  Archiving Snapshots and Root Pool Recovery

12.  Recommended Oracle Solaris ZFS Practices

A.  Oracle Solaris ZFS Version Descriptions

Index

Booting From a ZFS Root File System

Both SPARC based and x86 based systems boot 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.

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 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 file system selected for booting is the one identified by the pool's bootfs property. This default selection can be overridden by specifying an alternate bootable file system that is included in the boot -Z command on a SPARC system or by selecting an alternate boot device from the BIOS on an x86 based system.

Booting From an Alternate Disk in a Mirrored ZFS Root Pool

You can attach a disk to create a mirrored ZFS root pool after installation. For more information about creating a mirrored root pool, see How to Configure a Mirrored Root Pool (SPARC or x86/VTOC).

Review the following known issues regarding mirrored ZFS root pools:

Booting From a ZFS Root File System on a SPARC Based System

On a SPARC based system with multiple ZFS BEs, you can boot from any BE by using the beadm activate command.

During an installation and beadm activation process, the ZFS root file system is automatically designated with the bootfs property.

Multiple bootable file systems can exist within a pool. By default, the bootable file system 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 file system 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, an entry similar to the following is added to the menu.lst file:

title Oracle Solaris 11.1 SPARC
bootfs rpool/ROOT/solaris

When a new BE is created, the menu.lst file is updated automatically.

title Oracle Solaris 11.1 SPARC
bootfs rpool/ROOT/solaris
title solaris
bootfs rpool/ROOT/solaris2

On a SPARC based system, you can select the BE to boot from as follows:

This method of booting does not activate the BE automatically. After the BE is booted with the boot -L and -Z syntax, you would have to activate this BE to continue booting from it automatically.

Example 4-1 Booting From a Specific ZFS Boot Environment

If you have multiple ZFS BEs in a ZFS storage pool on your system's boot device, you can use the beadm activate command to specify a default BE.

For example, the following ZFS BEs are available as described by the beadm output:

# beadm list
BE        Active Mountpoint Space Policy Created          
--        ------ ---------- ----- ------ -------          
solaris   NR     /          3.80G static 2012-07-20 10:25 
solaris-2 -      -          7.68M static 2012-07-19 13:44 

If you have multiple ZFS BEs on your SPARC based system, you can use the boot -L command. For example:

ok boot -L                                 
Boot device: /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@0,0:a  File and args: -L
1 Oracle Solaris 11.1 SPARC
2 solaris
Select environment to boot: [ 1 - 2 ]: 1

To boot the selected entry, invoke:
boot [<root-device>] -Z rpool/ROOT/solaris-2

Program terminated
ok boot -Z rpool/ROOT/solaris-2

Keep in mind that the BE that is booted with the above command is not activated for the next reboot. If you want to continue to boot automatically from the BE that is selected during the boot -Z operation, you will need to activate it.

Booting From a ZFS Root File System on an x86 Based System

In Oracle Solaris 11, an x86 system is installed with legacy GRUB, the following entries are added to the /pool-name/boot/grub/menu.lst file during the installation process or beadm activate operation to boot ZFS automatically:

title solaris
bootfs rpool/ROOT/solaris
kernel$ /platform/i86pc/kernel/amd64/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/amd64/boot_archive
title solaris-1
bootfs rpool/ROOT/solaris-1
kernel$ /platform/i86pc/kernel/amd64/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/amd64/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 file system, the following option is added.

-B $ZFS-BOOTFS

In Oracle Solaris 11.1, an x86 based system is installed with GRUB2. The menu.lst file is replaced by the /rpool/boot/grub/grub.cfg file, but this file should not be edited manually. Use the bootadm sub commands to add, change, and remove menu entries.

For more information about modifying the GRUB menu items, see Booting and Shutting Down Oracle Solaris 11.1 Systems.

Example 4-2 x86: Booting a ZFS File System

When booting from a ZFS root file system on a GRUB2 system, the root device is specified as follows:

# bootadm list-menu
the location of the boot loader configuration files is: /rpool/boot/grub
default 0
console text
timeout 30
0 Oracle Solaris 11.1

When booting from a ZFS root file system on a legacy GRUB system, the root device is specified by the boot -B $ZFS-BOOTFS parameter. For example:

title solaris
bootfs rpool/ROOT/solaris
kernel$ /platform/i86pc/kernel/amd64/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/amd64/boot_archive
title solaris-1
bootfs rpool/ROOT/solaris-1
kernel$ /platform/i86pc/kernel/amd64/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/amd64/boot_archive

Example 4-3 x86: Fast Rebooting a ZFS Root File System

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 beadm activate command. For other system operations where the reboot command is appropriate, you can use the reboot -f command. For example:

# reboot -f

Booting For Recovery Purposes in a ZFS Root Environment

Use the following procedure if you need to boot the system so that you can recover from a lost root password or similar problem.

How to Boot the System For Recovery Purposes

Use the procedure below to resolve a problem with a menu.lst problem or a root password problem. If you need to replace a disk in root pool, see How to Replace a Disk in a ZFS Root Pool (SPARC or x86/VTOC). If you need to perform complete system (bare metal) recovery, see Chapter 11, Archiving Snapshots and Root Pool Recovery.

  1. Select the appropriate boot method:
    • x86: Live Media – Boot from the installation media and use a GNOME terminal for the recovery procedure.

    • SPARC: Text installation – Boot from the install media or from the network, and select option 3 Shell from the text installation screen.

    • x86: Text installation – From the GRUB menu, select the Text Installer and command line boot entry, then select the option 3 Shell from the text installation screen.

    • SPARC: Automated installation – Use the following command to boot directly from an installation menu that allows you to exit to a shell.

      ok boot net:dhcp
    • x86: Automated installation – Booting from an install server on the network requires a PXE boot. Select the Text Installer and command line entry from the GRUB menu. Then, select the option 3 Shell from the text installation screen.

    For example, after the system is booted, select option 3 Shell.

            1  Install Oracle Solaris
            2  Install Additional Drivers
            3  Shell
            4  Terminal type (currently xterm)
            5  Reboot
    
    Please enter a number [1]: 3
    To return to the main menu, exit the shell
    #
  2. Select the boot recovery problem:
    • Resolve a bad root shell by booting the system to single-user mode and correcting the shell entry in the /etc/passwd file.

      On an x86 system, edit the selected boot entry and add the -s option.

      For example, on a SPARC system, shut down the system and boot to single-mode. After you log in as root, edit the /etc/passwd file, and fix the root shell entry.

      # init 0
      ok boot -s
      Boot device: /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@0,0:a ...
      SunOS Release 5.11 Version 11.1 64-bit
      Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved.
      Booting to milestone "milestone/single-user:default".
      Hostname: tardis.central
      Requesting System Maintenance Mode
      SINGLE USER MODE
      
      Enter user name for system maintenance (control-d to bypass): root
      Enter root password (control-d to bypass): xxxx
      single-user privilege assigned to root on /dev/console.
      Entering System Maintenance Mode
      
      Aug  3 15:46:21 su: 'su root' succeeded for root on /dev/console
      Oracle Corporation      SunOS 5.11      11.1    October 2012
      su: No shell /usr/bin/mybash.  Trying fallback shell /sbin/sh.
      root@tardis.central:~# TERM =vt100; export TERM
      root@tardis.central:~# vi /etc/passwd
      root@tardis.central:~# <Press control-d> 
      logout
      svc.startd: Returning to milestone all.
    • Resolve a problem that prevents an x86–based system from booting. .

      First, you must boot from media or the network by using one of the boot methods listed in step 1. Then, import the root pool and fix a GRUB entry, for example.

      You can the use the bootadm list-menu command to list and modify GRUB2 entries. You can also use the set-menu subcommand to change a boot entry. For more information, see bootadm(1M).

      x86# zpool import -f rpool
      x86# bootadm list-menu
      x86# bootadm set-menu default=1
      x86# exit
              1  Install Oracle Solaris
              2  Install Additional Drivers
              3  Shell
              4  Terminal type (currently sun-color)
              5  Reboot
      
      Please enter a number [1]: 5

      Confirm that the system boots successfully.

    • Resolve an unknown root password that prevents you from logging into the system.

      First, you must boot from media or the network by using one of the boot methods listed in step 1. Then, import the root pool (rpool) and mount the BE to remove the root password entry. This process is identical on SPARC and x86 platforms.

      # zpool import -f rpool
      # beadm list
      be_find_current_be: failed to find current BE name
      be_find_current_be: failed to find current BE name
      BE        Active Mountpoint Space  Policy Created          
      --        ------ ---------- -----  ------ -------          
      solaris   -      -          46.95M static 2012-07-20 10:25 
      solaris-2 R      -          3.81G  static 2012-07-19 13:44 
      # mkdir /a
      # beadm mount solaris-2 /a
      # TERM=vt100
      # export TERM
      # cd /a/etc
      # vi shadow 
      <Carefully remove the unknown password>
      # cd /
      # beadm umount solaris-2
      # halt

      Go to the next step to set the root password.

  3. Set the root password by booting to single-user mode and setting the password.

    This step assumes that you have removed an unknown root password in the previous step.

    On an x86 based system, edit the selected boot entry and add the -s option.

    On a SPARC based system, boot the system to single-user mode, log in as root, and set the root password. For example:

    ok boot -s
    Boot device: /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@0,0:a ...
    SunOS Release 5.11 Version 11.1 64-bit
    Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved
    Booting to milestone "milestone/single-user:default".
    
    Enter user name for system maintenance (control-d to bypass): root
    Enter root password (control-d to bypass): <Press return>
    single-user privilege assigned to root on /dev/console.
    Entering System Maintenance Mode
    
    Jul 20 14:09:59 su: 'su root' succeeded for root on /dev/console
    Oracle Corporation      SunOS 5.11      11.1    October 2012
    root@tardis.central:~# passwd -r files root
    New Password: xxxxxx
    Re-enter new Password: xxxxxx
    passwd: password successfully changed for root
    root@tardis.central:~# <Press control-d> 
    logout
    svc.startd: Returning to milestone all.