ZFS Fail safe

SPARC:

sparc# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t1d0s0

x86:

x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t1d0s0

For example:
ok boot -L
Rebooting with command: boot -L
Boot device: /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@0 File and args: -L

1 zfsBE
2 zfs2BE
Select environment to boot: [ 1 – 2 ]: 1
To boot the selected entry, invoke:
boot [<root-device>] -Z rpool/ROOT/zfsBE

Program terminated
ok boot -Z rpool/ROOT/zfsBE

Example 5–9 SPARC: Booting a ZFS File System in Failsafe Mode

On a SPARC based system, you can boot from the failsafe archive located in /platform/`uname -i`/failsafe as follows:

ok boot -F failsafe

To boot a failsafe archive from a particular ZFS bootable dataset, use syntax similar to the following:

ok boot -Z rpool/ROOT/zfsBE -F failsafe

How to Resolve ZFS Mount-Point Problems

1. Boot the system from a failsafe archive.

2.Import the pool.
For example:
# zpool import rpool
3. Look for incorrect temporary mount points.

For example:

# zfs list -r -o name,mountpoint rpool/ROOT/s10u6

NAME MOUNTPOINT
rpool/ROOT/s10u6 /.alt.tmp.b-VP.mnt/
rpool/ROOT/s10u6/zones /.alt.tmp.b-VP.mnt//zones
rpool/ROOT/s10u6/zones/zonerootA /.alt.tmp.b-VP.mnt/zones/zonerootA
The mount point for the root BE (rpool/ROOT/s10u6) should be /.
If the boot is failing because of /var mounting problems, look for a similar incorrect temporary mount point for the /var dataset.

Reset the mount points for the ZFS BE and its datasets.
For example:

# zfs inherit -r mountpoint rpool/ROOT/s10u6
# zfs set mountpoint=/ rpool/ROOT/s10u6
Reboot the system.
When the option to boot a specific boot environment is presented, either in the GRUB menu or at the OpenBoot PROM prompt, select the boot environment whose mount points were just corrected.
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.
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.

How to Boot ZFS Failsafe Mode
Boot failsafe mode.
On a SPARC system:

ok boot -F failsafe

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
=============================================================
for X86 systems

How to Boot ZFS From Alternate Media
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.

Boot from an installation CD or from the network.

SPARC:

ok boot cdrom -s
ok boot net -s

If you don’t use the -s option, you will need to exit the installation program.

x86: 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