ZFS Troubleshooting Guide

From Siwiki

Jump to: navigation, search

Contents

[edit] Resolving Hardware Problems

[edit] Diagnosing Potential Problems

  • General commands for diagnosing hardware problems are:
 zpool status
 zpool status -v
 fmdump
 fmdump -ev or fmdump -eV
 format or rmformat
  • Identify hardware problems with the zpool status commands. If a pool is in the DEGRADED state, use the zpool status command to identify if a disk is unavailable. For example:
  # zpool status -x
  pool: zeepool
 state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas exist for
        the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://www.sun.com/msg/ZFS-8000-D3
 scrub: resilver completed after 0h12m with 0 errors on Thu Aug 28 09:29:43 2008
config:

        NAME                 STATE     READ WRITE CKSUM
        zeepool              DEGRADED     0     0     0
          mirror             DEGRADED     0     0     0
            c1t2d0           ONLINE       0     0     0
            spare            DEGRADED     0     0     0
              c2t1d0         UNAVAIL      0     0     0  cannot open
              c2t3d0         ONLINE       0     0     0
        spares
          c1t3d0             AVAIL   
          c2t3d0             INUSE     currently in use

errors: No known data errors
  • See the disk replacement example to recover from a failed disk.
  • Identify potential data corruption with the zpool status -v command. If only one file is corrupted, then you might choose to deal with it directly, without needing to restore the entire pool.
# zpool status -v rpool
  pool: rpool
 state: DEGRADED
status: One or more devices has experienced an error resulting in data
        corruption. Applications may be affected.

action: Restore the file in question if possible. Otherwise restore the
        entire pool from backup.

see: http://www.sun.com/msg/ZFS-8000-8A
scrub: scrub completed after 0h2m with 1 errors on Tue Mar 11 13:12:42 2008

config:
       NAME        STATE     READ WRITE CKSUM
       rpool    DEGRADED     0     0     9
         c2t0d0s0  DEGRADED     0     0     9

errors: Permanent errors have been detected in the following files:
           /mnt/root/lib/amd64/libc.so.1
  • Display the list of suspected faulty devices using the fmdump command. It is also useful to know the diagnosis engines available on your system and how busy they have been, which is obtained via the fmstat command. Similarly, fmadm will show the status of the diagnosis engines. You can also see that there are 4 diagnosis engines which are appropriate to devices and ZFS: disk-transport, io-retire, zfs-diagnosis, and zfs-retire. Check your OS release for the available FMA diagnosis engine capability.
# fmdump
TIME                 UUID                                 SUNW-MSG-ID
Aug 18 18:32:48.1940 940422d6-03fb-4ea0-b012-aec91b8dafd3 ZFS-8000-D3
Aug 21 06:46:18.5264 692476c6-a4fa-4f24-e6ba-8edf6f10702b ZFS-8000-D3
Aug 21 06:46:18.7312 45848a75-eae5-66fe-a8ba-f8b8f81deae7 ZFS-8000-D3
# fmstat
module             ev_recv ev_acpt wait  svc_t  %w  %b  open solve  memsz  bufsz
cpumem-retire            0       0  0.0    0.0   0   0     0     0      0      0
disk-transport           0       0  0.0   55.9   0   0     0     0    32b      0
eft                      0       0  0.0    0.0   0   0     0     0   1.2M      0
fabric-xlate             0       0  0.0    0.0   0   0     0     0      0      0
fmd-self-diagnosis       0       0  0.0    0.0   0   0     0     0      0      0
io-retire                0       0  0.0    0.0   0   0     0     0      0      0
snmp-trapgen             0       0  0.0    0.0   0   0     0     0    32b      0
sysevent-transport       0       0  0.0 4501.8   0   0     0     0      0      0
syslog-msgs              0       0  0.0    0.0   0   0     0     0      0      0
zfs-diagnosis            0       0  0.0    0.0   0   0     0     0      0      0
zfs-retire               0       0  0.0    0.0   0   0     0     0      0      0
# fmadm config
MODULE                   VERSION STATUS  DESCRIPTION
cpumem-retire            1.1     active  CPU/Memory Retire Agent
disk-transport           1.0     active  Disk Transport Agent
eft                      1.16    active  eft diagnosis engine
fabric-xlate             1.0     active  Fabric Ereport Translater
fmd-self-diagnosis       1.0     active  Fault Manager Self-Diagnosis
io-retire                2.0     active  I/O Retire Agent
snmp-trapgen             1.0     active  SNMP Trap Generation Agent
sysevent-transport       1.0     active  SysEvent Transport Agent
syslog-msgs              1.0     active  Syslog Messaging Agent
zfs-diagnosis            1.0     active  ZFS Diagnosis Engine
zfs-retire               1.0     active  ZFS Retire Agent
  • Display more details about potential hardware problems by examining the error reports with fmdump -ev. Display even more details with fmdump -eV.
# fmdump -eV
TIME                           CLASS
Aug 18 2008 18:32:35.186159293 ereport.fs.zfs.vdev.open_failed
nvlist version: 0
        class = ereport.fs.zfs.vdev.open_failed
        ena = 0xd3229ac5100401
        detector = (embedded nvlist)
        nvlist version: 0
                version = 0x0
                scheme = zfs
                pool = 0x4540c565343f39c2
                vdev = 0xcba57455fe08750b
        (end detector)

        pool = whoo
        pool_guid = 0x4540c565343f39c2
        pool_context = 1
        pool_failmode = wait
        vdev_guid = 0xcba57455fe08750b
        vdev_type = disk
        vdev_path = /dev/ramdisk/rdx
        parent_guid = 0x4540c565343f39c2
        parent_type = root
        prev_state = 0x1
        __ttl = 0x1
        __tod = 0x48aa22b3 0xb1890bd
  • If expected devices can't be displayed with the format or rmformat utility, then those devices won't be visible to ZFS.

[edit] Disk Replacement Example

Replacing Devices in a Pool

  • In this example we are assuming that "c4t60060160C166120099E5419F6C29DC11d0s6" is the faulty disk and we will replace it with "c4t60060160C16612006A4583D66C29DC11d0s6"
    host:~ # zpool status z-mirror
      pool: z-mirror
     state: ONLINE
     scrub: resilver completed with 0 errors on Tue Sep 11 09:05:44 2007
    config:
    
            NAME                                         STATE     READ WRITE CKSUM
            z-mirror                                     ONLINE       0     0     0
              mirror                                     ONLINE       0     0     0
                c4t60060160C166120064F22DA86C29DC11d0s6  ONLINE       0     0     0
                c4t60060160C166120099E5419F6C29DC11d0s6  FAULTED      0     0     0
    
  • zpool replace [-f] <pool> <device> [new_device]
    • host:~ # zpool replace z-mirror c4t60060160C166120099E5419F6C29DC11d0s6 c4t60060160C16612006A4583D66C29DC11d0s6
    • host:~ # zpool status z-mirror
    pool: z-mirror
     	state: ONLINE
     	: resilver completed with 0 errors on Tue Sep 11 09:08:44 2007
    config:
            	NAME                                  STATE     READ WRITE CKSUM
             z-mirror                                     ONLINE       0     0     0
              mirror                                      ONLINE       0     0     0
                c4t60060160C166120064F22DA86C29DC11d0s6   ONLINE       0     0     0
                c4t60060160C16612006A4583D66C29DC11d0s6   ONLINE       0     0     0
    
    errors: No known data errors

[edit] Solving Mirrored {Root} Pool Problems (zpool attach)

  • If you cannot attach a disk to create a mirrored root or non-root pool with the zpool attach command, and you see messages similar to the following:
# zpool attach rpool c1t1d0s0 c1t0d0s0
cannot attach c1t0d0s0 to c1t1d0s0: new device must be a single disk
  • You might be running into CR 6852962, which was been seen in an LDOM environment.
  • If the problem is not 6852962 and the system is booted under a virtualization product, make sure the devices are accessible by ZFS outside of the virtualization product.

[edit] Creating a Pool or Attaching a Disk to a Pool (I/O error)

If you attempt to create a pool or attach a disk or a disk slice to a existing pool and you see the following error:

# zpool attach rpool c4t0d0s0 c4t1d0s0
cannot open '/dev/dsk/c4t1d0s0': I/O error

This error means that the disk slice doesn't have any disk space allocated to it or possibly that a Solaris fdisk partition and the slice doesn't exist on an x86 system. Use the format utility to allocate disk space to a slice. If the x86 system doesn't have a Solaris fdisk partition, use the fdisk utility to create one.

[edit] Panic/Reboot/Pool Import Problems

During the boot process, each pool must be opened, which means that pool failures might cause a system to enter into a panic-reboot loop. In order to recover from this situation, ZFS must be informed not to look for any pools on startup.

[edit] Boot From Milestone=None Recovery Method

  • Boot to the none milestone by using the -m milestone=none boot option.
ok boot -m milestone=none
  • Remount your root file system as writable.
  • Rename or move the /etc/zfs/zpool.cache file to another location.
   These actions cause ZFS to forget that any pools exist on the system, preventing it from trying to access the bad pool causing the 
   problem. If you have multiple pools on the system, do these additional steps:
   * Determine which pool might have issues by using the fmdump -eV command to display the pools with reported fatal errors.
   * Import the pools one-by-one, skipping the pools that are having issues, as described in the fmdump output.
  • If the system is back up, issue the svcadm milestone all command.

[edit] Boot From OpenSolaris Live CD Recovery Method

Template:Draft

If you are running a Solaris SXCE or Solaris 10 release, you might be able to boot from the OpenSolaris Live CD and fix whatever is causing the pool import to fail.

  • Boot from the OpenSolaris Live CD
  • Import the pool
  • Resolve the issue that causes the pool import to fail, such as replace a failed disk
  • Export the pool
  • Boot from the original Solaris release
  • Import the pool

[edit] Capacity Problems with Storage Array LUNs

  • If you resize a LUN from a storage array and the zpool status command doesn't display the LUN's expected capacity, export and import the pool to see expected capacity. This is CR xxxxxxx.
  • If zpool status doesn't display the array's LUN expected capacity, confirm that the expected capacity is visible from the format utility. For example, the format output below shows that one LUN is configured as 931.01 Gbytes and one is configured as 931.01 Mbytes.
          2. c6t600A0B800049F93C0000030A48B3EA2Cd0 <SUN-LCSM100_F-0670-931.01GB>
             /scsi_vhci/ssd@g600a0b800049f93c0000030a48b3ea2c
          3. c6t600A0B800049F93C0000030D48B3EAB6d0 <SUN-LCSM100_F-0670-931.01MB>
             /scsi_vhci/ssd@g600a0b800049f93c0000030d48b3eab6
  • You will need to reconfigure the array's LUN capacity with the array sizing tool to correct this sizing problem.
  • When the LUN sizes are resolved, export and import the pool if the pool has already been created with these LUNs.

[edit] Resolving Software Problems

[edit] Unsupported CIFS properties in Solaris 10 Releases

  • The Solaris 10 10/08 release includes modifications to support the Solaris CIFS environment as described in zfs.1m. However, the CIFS features are not supported in the Solaris 10 release. Therefore, these properties are set to read-only values. If you attempt to reset the CIFS-related properties, you will see a message similar to the following:
# zfs set utf8only=on rpool
cannot set property for 'rpool': 'utf8only' is readonly

[edit] Unsupported Cache Devices in Solaris 10 10/08 and Solaris 10 5/09 Releases

  • Starting in the Solaris 10 10/08 release, cache device support is identified as available by using the zpool upgrade -v command. For example:
# zpool upgrade -v
This system is currently running ZFS pool version 10.

The following versions are supported:

VER  DESCRIPTION
---  --------------------------------------------------------
 1   Initial ZFS version
 2   Ditto blocks (replicated metadata)
 3   Hot spares and double parity RAID-Z
 4   zpool history
 5   Compression using the gzip algorithm
 6   bootfs pool property
 7   Separate intent log devices
 8   Delegated administration
 9   refquota and refreservation properties
 10  Cache devices
  • However, cache devices are not supported in these releases.
  • If you attempt to add a cache device to a ZFS storage pool when the pool is created, the following message is displayed:
# zpool create pool mirror c0t1d0 c0t2d0 cache c0t3d0
cannot create 'pool': operation not supported on this type of pool
  • If you attempt to add a cache device to a ZFS storage pool after the pool is created, the following message is displayed:
# zpool create pool mirror c0t1d0 c0t2d0
# zpool add pool cache c0t3d0
cannot add to 'pool': pool must be upgraded to add these vdevs

[edit] ZFS Installation Issues

[edit] Review Solaris 10 10/08 Installation Requirements

  • 768 Mbytes is the minimum amount of memory required to install a ZFS root file system
  • 1 Gbyte of memory is recommended for better overall ZFS performance
  • At least 16 Gbytes of disk space is recommended

[edit] Before You Start

  • Due to an existing boot limitation, disks intended for a bootable ZFS root pool must be created with disk slices and must be labeled with a VTOC (SMI) disk label.
  • If you relabel EFI-labeled disks with VTOC labels, be sure that the desired disk space for the root pool is in the disk slice that will be used to create the bootable ZFS pool.

[edit] Solaris/ ZFS Initial Installation

  • For the OpenSolaris releases, a ZFS root file system is installed by default and there is no option to choose another type of root file system.
  • For the SXCE and Solaris 10 10/08 releases, you can only install a ZFS root file system from the text installer.
  • You cannot use a Flash install or the standard upgrade option to install or migrate to a ZFS root file system. Stay tuned, more work is in progress on improving installation.
  • For the SXCE and Solaris 10 10/08 releases, you can use LiveUpgrade to migrate a UFS root file system to a ZFS root file system.
  • Access the text installer as follows:
    • On SPARC based system, use the following syntax from the Solaris installation DVD or the network:
 ok boot cdrom - text
 ok boot net - text
**On an x86 based system, select the text-mode install option when presented.
  • If you accidentally start the GUI install method, do the following:
 * Exit the GUI installer
 * Expand the terminal window to 80 x 24
 * Unset the DISPLAY, like this:
   # DISPLAY=
   # export DISPLAY
   # install-solaris

[edit] ZFS Root Pool Recommendations and Requirements

  • During an initial installation, select two disks to create a mirrored root pool.
  • Or, you can also attach a disk to create a mirrored root pool after installation. See the ZFS Administration Guide for details.
  • Solaris VTOC (SMI) labels are required for disks in the root pool which should be configured using a slice specification. EFI labeled disks do not work. Several factors are at work here, including BIOS support for booting from EFI labeled disks.
  • Note: If you mirror the boot disk later, make sure you specify a bootable slice and not the whole disk because the latter may try to install an EFI label.
  • You cannot use a RAID-Z configuration for a root pool. Only single-disk pools or pools with mirrored disks are supported. You will see the following message if you attempt to use an unsupported pool for the root pool:
ERROR: ZFS pool <pool-name> does not support boot environments
  • Root pools cannot have a separate log device. For example:
# zpool add -f rpool log c0t6d0s0
cannot add to 'rpool': root pool can not have multiple vdevs or separate logs
  • The lzjb compression property is supported for root pools but the other compression types are not supported.
  • Keep a second ZFS BE for recovery purposes. You can boot from alternate BE if the primary BE fails. For example:
# lucreate -n ZFS2BE
  • Keep root pool snapshots on a remote system. See the steps below for details.

[edit] Solaris Live Upgrade Migration Scenarios

  • You can use the Solaris Live Upgrade feature to migrate a UFS root file system to a ZFS root file system.
  • You can't use Solaris Live Upgrade to migrate a ZFS boot environment (BE) to UFS BE.
  • You can't use Solaris Live Upgrade to migrate non-root or shared UFS file systems to ZFS file systems.

[edit] Review LU Requirements

  • You must be running the SXCE, build 90 release or the Solaris 10 10/08 release to use LU to migrate a UFS root file system to a ZFS root file system.
  • You must create a ZFS storage pool that contains disk slices before the LU migration.
  • The pool must exist either on a disk slice or on disk slices that are mirrored, but not on a RAID-Z configuration or on a nonredundant configuration of multiple disks. If you attempt to use an unsupported pool configuration during a Live Upgrade migration, you will see a message similar to the following:
ERROR: ZFS <pool-name> does not support boot environments
  • If you see this message, then either the pool doesn't exist or its an unsupported configuration.

[edit] Live Upgrade Issues

  • The Solaris installation GUI's standard-upgrade option is not available for migrating from a UFS to a ZFS root file system. To migrate from a UFS file system, you must use Solaris Live Upgrade.
  • You cannot use Solaris Live Upgrade to create a UFS BE from a ZFS BE.
  • Do not rename your ZFS BEs with the zfs rename command because the Solaris Live Upgrade feature is unaware of the name change. Subsequent commands, such as ludelete, will fail. In fact, do not rename your ZFS pools or file systems if you have existing BEs that you want to continue to use.
  • Solaris Live Upgrade creates the datasets for the BE and ZFS volumes for the swap area and dump device but does not account for any existing dataset property modifications. Thus, if you want a dataset property enabled in the new BE, you must set the property before the lucreate operation. For example:
 zfs set compression=on rpool/ROOT
  • When creating an alternative BE that is a clone of the primary BE, you cannot use the -f, -x, -y, -Y, and -z options to include or exclude files from the primary BE. You can still use the inclusion and exclusion option set in the following cases:

UFS -> UFS UFS -> ZFS ZFS -> ZFS (different pool)

  • Although you can use Solaris Live Upgrade to upgrade your UFS root file system to a ZFS root file system, you cannot use Solaris Live Upgrade to upgrade non-root or shared file systems.
  • On a SPARC system that runs the Solaris 10 5/09 release, set the BOOT_MENU_FILE variable before activating the ZFS BE with luactivate, due to CR 6824589.
# BOOT_MENU_FILE="menu.lst"
# export BOOT_MENU_FILE

[edit] Live Upgrade with Zones

Review the following supported ZFS and zones configurations. These configurations are upgradeable and patchable.

[edit] Migrate a UFS Root File System with Zones Installed to a ZFS Root File System

This ZFS zone root configuration can be upgraded or patched.

  1. Upgrade the system to the Solaris 10 10/08 release if it is running a previous Solaris 10 release.
  2. Create the root pool.
    # zpool create rpool mirror c1t0d0s0 c1t1d0s0
  3. Confirm that the zones from the UFS environment are booted.
  4. Create the new boot environment.
    # lucreate -n S10BE2 -p rpool
  5. Activate the new boot environment.
  6. Reboot the system.
  7. Migrate the UFS zones to the ZFS BE.
    1. Boot the zones.
    2. Create another BE within the pool.
      # lucreate S10BE3
    3. Activate the new boot environment.
      # luactivate S10BE3
    4. Reboot the system.
      # init 6
  8. Resolve any potential mount point problems, due to a Solaris Live Upgrade bug.
    1. Review the zfs list output and look for any temporary mount points.
      # 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 ZFS BE (rpool/ROOT/s10u6) should be /.
    2. Reset the mount points for the ZFS BE and its datasets.
      # zfs inherit -r mountpoint rpool/ROOT/s10u6
      # zfs set mountpoint=/ rpool/ROOT/s10u6
    3. Reboot the system. When the option is presented to boot a specific boot environment, either in the GRUB menu or at the OpenBoot Prom prompt, select the boot environment whose mount points were just corrected.
[edit] Configure a ZFS Root File System With Zone Roots on ZFS

Set up a ZFS root file system and ZFS zone root configuration that can be upgraded or patched. In this configuration, the ZFS zone roots are created as ZFS datasets.

  1. Install the system with a ZFS root, either by using the interactive initial installation method or the Solaris JumpStart installation method.
  2. Boot the system from the newly-created root pool.
  3. Create a dataset for grouping the zone roots.
    zfs create -o canmount=noauto rpool/ROOT/S10be/zones
    Setting the noauto value for the canmount property prevents the dataset from being mounted other than by the explicit action of Solaris Live Upgrade and system startup code.
  4. Mount the newly-created zones container dataset.
    # zfs mount rpool/ROOT/S10be/zones
    The dataset is mounted at /zones.
  5. Create and mount a dataset for each zone root.
    # zfs create -o canmount=noauto rpool/ROOT/S10be/zones/zonerootA
    # zfs mount rpool/ROOT/S10be/zones/zonerootA
  6. Set the appropriate permissions on the zone root directory.
    # chmod 700 /zones/zonerootA
  7. Configure the zone, setting the zone path as follows:
    # zonecfg -z zoneA
        zoneA: No such zone configured
        Use 'create' to begin configuring a new zone.
        zonecfg:zoneA> create
        zonecfg:zoneA> set zonepath=/zones/zonerootA
  8. Install the zone.
    # zoneadm -z zoneA install
  9. Boot the zone.
    # zoneadm -z zoneA boot
[edit] Upgrade or Patch a ZFS Root File System With Zone Roots on ZFS

Upgrade or patch a ZFS root file system with zone roots on ZFS. These updates can either be a system upgrade or the application of patches.

  1. Create the boot environment to upgrade or patch.
    # lucreate -n newBE
    The existing boot environment, including all the zones, are cloned. New datasets are created for each dataset in the original boot environment. The new datasets are created in the same pool as the current root pool.
  2. Select one of the following to upgrade the system or apply patches to the new boot environment.
    1. Upgrade the system.
      # luupgrade -u -n newBE -s /net/install/export/s10u7/latest
      Where the -s option is the location of a Solaris installation medium.
    2. Apply patches to the new boot environment.
      # luupgrade -t -n newBE -t -s /patchdir 139147-02 157347-14
  3. Activate the new boot environment after the updates to the new boot environment are complete.
    # luactivate newBE
  4. Boot from newly-activated boot environment.
    # init 6
  5. Resolve any potential mount point problems, due to a Solaris Live Upgrade bug.
    1. Review the zfs list output and look for any temporary mount points.
      # zfs list -r -o name,mountpoint rpool/ROOT/newBE
          
          NAME                               MOUNTPOINT
          rpool/ROOT/newBE                   /.alt.tmp.b-VP.mnt/
          rpool/ROOT/newBE/zones             /.alt.tmp.b-VP.mnt//zones
          rpool/ROOT/newBE/zones/zonerootA   /.alt.tmp.b-VP.mnt/zones/zonerootA
          
      The mount point for the root ZFS BE (rpool/ROOT/newBE) should be /.
    2. Reset the mount points for the ZFS BE and its datasets.
      # zfs inherit -r mountpoint rpool/ROOT/newBE
      # zfs set mountpoint=/ rpool/ROOT/newBE
    3. Reboot the system. When the option is presented to boot a specific boot environment, either in the GRUB menu or at the OpenBoot Prom prompt, select the boot environment whose mount points were just corrected.

    [edit] Recover from BE Removal Failure (ludelete)

    • If you use ludelete to remove an unwanted BE and it fails with messages similar to the following:
    # ludelete -f c0t1d0s0
    System has findroot enabled GRUB
    Updating GRUB menu default setting
    Changing GRUB menu default setting to <0>
    ERROR: Failed to copy file </boot/grub/menu.lst> to top level dataset for BE <c0t1d0s0>
    ERROR: Unable to delete GRUB menu entry for deleted boot environment <c0t1d0s0>.
    Unable to delete boot environment.
    
    • You might be running into the following bugs: 6718038, 6715220, 6743529
    • The workaround is as follows:
    1. Edit /usr/lib/lu/lulib and in line 2934, replace the following text:
      lulib_copy_to_top_dataset "$BE_NAME" "$ldme_menu" "/${BOOT_MENU}"
       with this text:
      
      lulib_copy_to_top_dataset `/usr/sbin/lucurr` "$ldme_menu" "/${BOOT_MENU}"
    2. Rerun the ludelete operation.

    [edit] ZFS Boot Issues

    • The boot process can be slow if the boot archive is updated or a dump device has changed. Be patient.
    • CR 6704717 – Do not place offline the primary disk in a mirrored ZFS root configuration. If you do need to offline or detach a mirrored root disk for replacement, then boot from another mirrored disk in the pool.
    • CR 6668666 - If you attach a disk to create a mirrored root pool after an initial installation, you will need to apply the boot blocks to the secondary disks. For example:
      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 
    
    • CR 6741743 - The boot -L command doesn't work if you migrated from a UFS root file system. Copy the bootlst command to the correct location. For example:
    # cp -p /platform/`uname -m`/bootlst /rpool/platform/`uname -m`/bootlst

    [edit] ZFS Boot Error Messages

    • CR 2164779 - Ignore the following krtld messages from the boot -Z command. They are harmless:
    krtld: Ignoring invalid kernel option -Z.
    krtld: Unused kernel arguments: `rpool/ROOT/zfs1008BE'.
    

    [edit] Resolving ZFS Mount Point Problems That Prevent Successful Booting

    The best way to change the active boot environment is to use the luactivate command. If booting the active environment fails, due to a bad patch or a configuration error, the only way to boot a different environment is by selecting that environment at boot time. You can select an alternate BE from the GRUB menu on an x86 based system or by booting it explicitly from the PROM on an SPARC based system.

    Due to a bug in the Live Upgrade feature, the non-active boot environment might fail to boot because the ZFS datasets or the zone's ZFS dataset in the boot environment has an invalid mount point.

    The same bug also prevents the BE from mounting if it has a separate /var dataset.

    The mount points can be corrected by taking the following steps.

    [edit] Resolve ZFS Mount Point Problems

    1. Boot the system from a failsafe archive.
    2. Import the pool.
      # zpool import rpool
    3. Review the zfs list output after the pool is imported, looking 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 /.
    4. Reset the mount points for the ZFS BE and its datasets.
      # zfs inherit -r mountpoint rpool/ROOT/s10u6
      # zfs set mountpoint=/ rpool/ROOT/s10u6
    5. Reboot the system. When the option is presented to boot a specific boot environment, either in the GRUB menu or at the OpenBoot Prom prompt, select the boot environment whose mount points were just corrected.

    [edit] Boot From a Alternate Disk in a Mirrored ZFS Root Pool

    You can boot from different devices in a mirrored ZFS root pool.

    • Identify the device pathnames for the alternate disks in the mirrored root pool by reviewing the zpool status output. In the example output, disks are c0t0d0s0 and c0t1d0s0.
    # zpool status
      pool: rpool
     state: ONLINE
     scrub: resilver completed after 0h6m with 0 errors on Thu Sep 11 10:55:28 2008
    config:
    
            NAME          STATE     READ WRITE CKSUM
            rpool         ONLINE       0     0     0
              mirror      ONLINE       0     0     0
                c0t0d0s0  ONLINE       0     0     0
                c0t1d0s0  ONLINE       0     0     0
    
    errors: No known data errors
    • If you attached the second disk in the mirror configuration after an initial installation, apply the bootblocks after the second disk has resilvered. For example, on a SPARC system:
    # installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t1d0s0
    • Depending on the hardware configuration, you might need to update the OpenBoot PROM configuration or the BIOS to specify a different boot device. For example, on a SPARC system:
    ok setenv boot-device /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@1
    ok boot

    [edit] Activating a BE Fails (OpenSolaris Releases Prior to 101a)

    • If you attached a second disk to your ZFS root pool and that disk has an EFI label, booting the BE will fail with a messages similar to the following:
    # beadm activate opensolaris-2
    Unable to activate opensolaris-2.
    Unknown external error.
    • ZFS root pool disks must contain a VTOC label. Starting in build 101a, you will be warned about adding a disk with an EFI label to the root pool.
    • See the steps below to detach and relabel the disk with a VTOC label. These steps are also applicable to the Solaris Nevada (SXCE) and Solaris 10 releases.
    1. Detach the disk. For example:
      # zpool detach rpool c0t0d0s0
    2. Relabel the disk.
    3. # format -e c0t1d0s0
      format> label
      [0] SMI Label
      [1] EFI Label
      Specify Label type[1]: 0
      Ready to label disk, continue? yes
      format> quit
      
      Make sure all the disk space is in s0. The relabeling process might go back to the default sizing so check to see that all the disk space is where you want it.
    4. Attach the disk. For example:
    5. # zpool attach rpool c0t0d0s0 c0t1d0s0
    6. Confirm that the newly attached disk has resilvered completely by using the zpool status command to watch the progress.
      # zpool status
        pool: rpool
       state: ONLINE
       scrub: resilver completed after 0h8m with 0 errors on Mon Jan 26 10:39:11 2009
      config:
      
              NAME          STATE     READ WRITE CKSUM
              rpool         ONLINE       0     0     0
                mirror      ONLINE       0     0     0
                  c0t0d0s0  ONLINE       0     0     0  67.9M resilvered
                  c0t1d0s0  ONLINE       0     0     0  6.55G resilvered
      
    7. Install the bootblock on the newly attached disk.
      x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t1d0s0 
    8. Confirm that you can boot from the newly attached disk by selecting this disk from the BIOS level.

    [edit] ZFS Root Pool Recovery

    [edit] Complete Solaris ZFS Root Pool Recovery

    The section describes how to create and restore root pool snapshots starting with Solaris 10 10/08 and recent SXCE releases. The following issues can complicate the root pool snapshot process:

    • CR 6462803 - Fixed in the SXCE (Nevada, build 111) release but still open in the Solaris 10 5/09 release, and means that a recursive snapshot of the root pool can fail if more than one BE exists. The workaround is to create a recursive snapshot of the root pool prior to the creation of additional BEs.
    • CR 6794452 - Fixed in the SXCE (Nevada, build 107) release and the Solaris 10 5/09 release, but still open in the Solaris 10 10/08 release, which means that you must send and receive individual root pool dataset snapshots. Apply kernel patch 139555-08 for SPARC and 139556-08 for x86 to resolve this CR in the Solaris 10 10/08 release. The resolution of this CR is to use the zfs receive -u option when restoring the root pool snapshots even when sending and receiving the entire recursive root pool snapshot.

    Different ways exist to send and receive root pool snapshots. The following procedure has been tested with one ZFS BE.

    [edit] Create Root Pool Snapshots

    Create root pool snapshots for recovery purposes. For example:

    1. Create space on a remote system to store the snapshots.
      remote# zfs create rpool/snaps
      remote# zfs list
      NAME          USED  AVAIL  REFER  MOUNTPOINT
      rpool         108K  8.24G    19K  /rpool
      rpool/snaps    18K  8.24G    18K  /rpool/snaps
      
    2. Share the space to the local system.
      remote# zfs set sharenfs='rw=local-system,root=local-system' rpool/snaps
      # share
      -@rpool/snaps   /rpool/snaps   sec=sys,rw=local-system,root=local-system   "" 
      
    3. Create a recursive snapshot of the root pool.
      local# zfs snapshot -r rpool@0602
      local# zfs list
      NAME                                     USED  AVAIL  REFER  MOUNTPOINT
      NAME                     USED  AVAIL  REFER  MOUNTPOINT
      rpool                   6.60G  60.3G    94K  /rpool
      rpool@0602                  0      -    94K  -
      rpool/ROOT              4.60G  60.3G    18K  legacy
      rpool/ROOT@0602             0      -    18K  -
      rpool/ROOT/zfsBE        4.60G  60.3G  4.60G  /
      rpool/ROOT/zfsBE@0602       0      -  4.60G  -
      rpool/dump              1.00G  60.3G  1.00G  -
      rpool/dump@0602             0      -  1.00G  -
      rpool/export              38K  60.3G    20K  /export
      rpool/export@0602           0      -    20K  -
      rpool/export/home         18K  60.3G    18K  /export/home
      rpool/export/home@0602      0      -    18K  -
      rpool/swap              1.00G  61.3G   406K  -
      rpool/swap@0602             0      -   406K  -
      
    4. Send the individual snapshots to the remote system. This method is required for a Solaris 10 10/08 system that does not have the above mentioned kernel patch level. Furthermore, this method: 1) allows recovery of individual datasets versus the entire rpool should that be desired and; 2) does not "zfs send" the dump and swap devices which is not necessary and adds time to the recursive method. But it does require manual creation of these datasets as outlined in the steps below.
      local# zfs send -v rpool@0602 > /net/remote-system/rpool/snaps/rpool.0602
      local# zfs send -Rv rpool/ROOT/zfsBE@0602 > /net/remote-system/rpool/snaps/zfsBE.0602
      local# zfs send -Rv rpool/export@0602 > /net/remote-system/rpool/snaps/export.0602
      

      If you are running the SXCE build 107 or the Solaris 10 5/09 release, you can send the entire recursive snapshot.

      # zfs send -Rv rpool@0602 > /net/remote-system/rpool/snaps/rpool.0602
    [edit] Recreate Root Pool and Restore Root Pool Snapshots

    In this scenario, assume the following conditions:

    • ZFS root pool cannot be recovered
    • ZFS root pool snapshots are stored on a remote system and shared over NFS

    All the steps below are performed on the local system.

    1. Boot from CD/DVD or the network.
      ok boot net

      or

      ok boot cdrom

      Then, exit out of the installation program.

    2. Mount the remote snapshot dataset.
      # mount -F nfs remote-system:/rpool/snaps /mnt
    3. If the root pool disk is replaced and does not contain a disk label that is usable by ZFS, you will have to relabel the disk. For more information, see #Replacing/Relabeling_the_Root_Pool_Disk.
    4. Recreate the root pool. For example:
      # zpool create -f -o failmode=continue -R /a -m legacy -o cachefile=/etc/zfs/zpool.cache rpool c1t1d0s0 
      
    5. If you had to replace or relabel the disk, then you might need to reinstall the boot blocks. For example:
      sparc# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0
      x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t1d0s0
    6. Select one of the following if you are running the Solaris 10 10/08, Solaris 10 5/09, or the Nevada, build 107 or later release:
      • Solaris 10 10/08 or Nevada, prior to build 107: Receive the individual root pool snapshots. This step might take some time. For example:
        # cat /mnt/rpool.0115 | zfs receive -Fd rpool
        # cat /mnt/s10u607bbe2.0115 | zfs receive -Fd rpool
        # cat /mnt/s10s_u6wos_07b.0115 | zfs receive -Fd rpool
        # cat /mnt/export.0115 | zfs receive -Fd rpool
        
        Go to the next step.
      • Solaris 10 10/08 with above-mentioned kernel patch, Solaris 10 5/09, Nevada, build 107 or later: Receive the recursive root pool snapshot. This step might take some time. For example:
        # cat /mnt/rpool.0115 | zfs receive -Fdu rpool

        Using the -u option means that the restored archive is not mounted when the zfs receive completes. The -u option is available starting in the Solaris 10 5/09 release.

        • If you want to modify something in the BE, you will need to explicitly mount them like this:
          # zfs mount rpool/ROOT/zfsBE
          # zfs mount rpool/ROOT/zfsBE/var
        • Then, mount everything in the pool that is not part of a BE.
          # zfs mount -a rpool

          Other BEs are not mounted since they all have canmount=noauto, which suppresses mounting when the zfs mount -a is done.

    7. Verify that the root pool datasets are restored:
      # zfs list
      NAME                             USED  AVAIL  REFER  MOUNTPOINT
      rpool                   5.60G  61.3G    94K  /a/rpool
      rpool@0602                  0      -    94K  -
      rpool/ROOT              4.60G  61.3G    18K  legacy
      rpool/ROOT@0602             0      -    18K  -
      rpool/ROOT/zfsBE        4.60G  61.3G  4.60G  /a
      rpool/ROOT/zfsBE@0602       0      -  4.60G  -
      rpool/dump              1.00G  61.3G  1.00G  -
      rpool/dump@0602             0      -  1.00G  -
      rpool/export              38K  61.3G    20K  /a/export
      rpool/export@0602           0      -    20K  -
      rpool/export/home         18K  61.3G    18K  /a/export/home
      rpool/export/home@0602      0      -    18K  -
      rpool/swap               406K  61.3G   406K  -
      rpool/swap@0602             0      -   406K  -
      
    8. Set the bootfs property on the root pool BE.
      # zpool set bootfs=rpool/ROOT/zfsBE rpool
    9. Recreate the dump device. This step not necessary when using the recursive restore method as it is recreated with the rpool.
      # zfs create -V 2G rpool/dump
    10. Recreate the swap device. This step not necessary when using the recursive restore method as it is recreated with the rpool.
      SPARC# zfs create -V 2G -b 8k rpool/swap
      x86# zfs create -V 2G -b 4k rpool/swap
    11. Reboot the system.
      # init 6

    [edit] Replacing/Relabeling the Root Pool Disk

    You might need to replace a disk in the root pool for the following reasons:

    • The root pool is too small and you want to replace it with a larger disk
    • The root pool disk is failing. If the disk is failing so that the system won't boot, you'll need to boot from an alternate media, such as a CD or the network, before you replace the root pool disk.

    Part of recovering the root pool might be to replace or relabel the root pool disk. Follow the steps below to relabel and replace the root pool disk.

    1. Physically attach the replacement disk.
    2. If the replacement disk has an EFI label, the fdisk output looks similar to the following on an x86 system.
      # fdisk /dev/rdsk/c1t1d0p0
      selecting c1t1d0p0
        Total disk size is 8924 cylinders
                   Cylinder size is 16065 (512 byte) blocks
      
                                                     Cylinders
            Partition   Status    Type          Start   End   Length    %
            =========   ======    ============  =====   ===   ======   ===
                1                 EFI               0  8924    8925    100
      .
      .
      .
      Enter Selection: 6

      Use fdisk to change this to a Solaris partition.

    3. Select one of the following to create a Solaris fdisk partition for a disk on an x86 system or create an SMI label for a disk on a SPARC system.
      • On an x86 system, create a Solaris fdisk partition that can be used for booting by selecting 1=SOLARIS2. You can create a Solaris partition by using the fdisk -B option that creates one Solaris partition that uses the whole disk. Beware that the following command uses the whole disk.
        # fdisk -B /dev/rdsk/c1t1d0p0

        Display the newly created Solaris partition. For example:

         Total disk size is 8924 cylinders
                     Cylinder size is 16065 (512 byte) blocks
        
                                                       Cylinders
              Partition   Status    Type          Start   End   Length    %
              =========   ======    ============  =====   ===   ======   ===
                  1       Active    Solaris2          1  8923    8923    100
        .
        .
        .
        Enter Selection: 6
      • On a SPARC based system, make sure you have an SMI label. Use the format -e command to determine if the disk label is EFI or SMI and relabel the disk, if necessary. In the output below, the disk label includes sectors and not cylinders. This is an EFI label.
        # format -e
        Searching for disks...done
        AVAILABLE DISK SELECTIONS:
               0. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
                  /pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000004cf7fac8a,0
               1. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
                  /pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000004cf7fad21,0
        Specify disk (enter its number): 1
        selecting c1t1d0
        [disk formatted]
        format> p
        partition> p
        Current partition table (original):
        Total disk sectors available: 71116541 + 16384 (reserved sectors)
        
        Part      Tag    Flag     First Sector        Size        Last Sector
          0        usr    wm                34      33.91GB         71116541    
          1 unassigned    wm                 0          0              0    
          2 unassigned    wm                 0          0              0    
          3 unassigned    wm                 0          0              0    
          4 unassigned    wm                 0          0              0    
          5 unassigned    wm                 0          0              0    
          6 unassigned    wm                 0          0              0    
          7 unassigned    wm                 0          0              0    
          8   reserved    wm          71116542       8.00MB         71132925    
        partition> label
        [0] SMI Label
        [1] EFI Label
        Specify Label type[1]: 0
        Auto configuration via format.dat[no]? 
        Auto configuration via generic SCSI-2[no]? 
        partition> 
    4. Create a slice in the Solaris partition for the root pool. Creating a slice on x86 and SPARC system is similar except that an x86 system has a slice 8. In the example below, a slice 0 is created and the disk space is allocated to slice 0 on an x86 system. For a SPARC system, just ignore the slice 8 input.
      # format
      Specify disk (enter its number): 1
      selecting c1t1d0
      [disk formatted]
      FORMAT MENU:
              disk       - select a disk
              type       - select (define) a disk type
              partition  - select (define) a partition table
              current    - describe the current disk
              format     - format and analyze the disk
              fdisk      - run the fdisk program
      .
      .
      .
      format> p
      PARTITION MENU:
              0      - change `0' partition
              1      - change `1' partition
              2      - change `2' partition
              3      - change `3' partition
              4      - change `4' partition
              5      - change `5' partition
              6      - change `6' partition
              7      - change `7' partition
              select - select a predefined table
              modify - modify a predefined partition table
              name   - name the current table
              print  - display the current table
              label  - write partition map and label to the disk
              !<cmd> - execute <cmd>, then return
              quit
      partition> p
      Current partition table (original):
      Total disk cylinders available: 8921 + 2 (reserved cylinders)
      
      Part      Tag    Flag     Cylinders        Size            Blocks
        0 unassigned    wm       0               0         (0/0/0)            0
        1 unassigned    wm       0               0         (0/0/0)            0
        2     backup    wu       0 - 8920       68.34GB    (8921/0/0) 143315865
        3 unassigned    wm       0               0         (0/0/0)            0
        4 unassigned    wm       0               0         (0/0/0)            0
        5 unassigned    wm       0               0         (0/0/0)            0
        6 unassigned    wm       0               0         (0/0/0)            0
        7 unassigned    wm       0               0         (0/0/0)            0
        8       boot    wu       0 -    0        7.84MB    (1/0/0)        16065
        9 unassigned    wm       0               0         (0/0/0)            0
      partition> modify
      Select partitioning base:
              0. Current partition table (original)
              1. All Free Hog
      Choose base (enter number) [0]? 1
      
      Part      Tag    Flag     Cylinders        Size            Blocks
        0       root    wm       0               0         (0/0/0)            0
        1       swap    wu       0               0         (0/0/0)            0
        2     backup    wu       0 - 8920       68.34GB    (8921/0/0) 143315865
        3 unassigned    wm       0               0         (0/0/0)            0
        4 unassigned    wm       0               0         (0/0/0)            0
        5 unassigned    wm       0               0         (0/0/0)            0
        6        usr    wm       0               0         (0/0/0)            0
        7 unassigned    wm       0               0         (0/0/0)            0
        8       boot    wu       0 -    0        7.84MB    (1/0/0)        16065
        9 alternates    wm       0               0         (0/0/0)            0
      
      Do you wish to continue creating a new partition
      table based on above table[yes]? 
      Free Hog partition[6]? 0
      Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]: 
      Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]: 
      Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]: 
      Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]: 
      Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]: 
      Enter size of partition '7' [0b, 0c, 0.00mb, 0.00gb]: 
      
      Part      Tag    Flag     Cylinders        Size            Blocks
        0       root    wm       1 - 8920       68.33GB    (8920/0/0) 143299800
        1       swap    wu       0               0         (0/0/0)            0
        2     backup    wu       0 - 8920       68.34GB    (8921/0/0) 143315865
        3 unassigned    wm       0               0         (0/0/0)            0
        4 unassigned    wm       0               0         (0/0/0)            0
        5 unassigned    wm       0               0         (0/0/0)            0
        6        usr    wm       0               0         (0/0/0)            0
        7 unassigned    wm       0               0         (0/0/0)            0
        8       boot    wu       0 -    0        7.84MB    (1/0/0)        16065
        9 alternates    wm       0               0         (0/0/0)            0
      
      Okay to make this the current partition table[yes]? 
      Enter table name (remember quotes): "disk1"
      
      Ready to label disk, continue? yes
      partition> q
      format> q
      
    5. Attach the replacement disk.
      # zpool attach rpool c1t0d0s0 c1t1d0s0
      Please be sure to invoke installgrub(1M) to make 'c1t1d0s0' bootable.
    6. Check the resilvering status of the newly attached disk.
      # zpool status rpool
    7. After the disk resilvering is complete, install the boot blocks.
      x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t1d0s0
      sparc# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk c1t1d0s0
    8. Confirm that you can boot from the replacement disk.
    9. Detach the smaller or unneeded disk.
      # zpool detach rpool c1t0d0s0
    10. [edit] Rolling Back a Root Pool Snapshot From a Failsafe Boot

      This procedure assumes that existing root pool snapshots are available. In this example, the root pool snapshots are available on the local system.

      # zfs snapshot -r rpool/ROOT@1013
      # zfs list
      NAME                      USED  AVAIL  REFER  MOUNTPOINT
      rpool                    5.67G  1.04G  21.5K  /rpool
      rpool/ROOT               4.66G  1.04G    18K  /rpool/ROOT
      rpool/ROOT@1013              0      -    18K  -
      rpool/ROOT/zfs1008       4.66G  1.04G  4.66G  /
      rpool/ROOT/zfs1008@1013      0      -  4.66G  -
      rpool/dump                515M  1.04G   515M  -
      rpool/swap                513M  1.54G    16K  -
      
      1. Shutdown the system and boot failsafe mode.
        ok boot -F failsafe
        Multiple OS instances were found. To check and mount one of them
        read-write under /a, select it from the following list. To not mount
        any, select 'q'.
        
          1  /dev/dsk/c0t1d0s0             Solaris 10 xx SPARC
          2  rpool:5907401335443048350     ROOT/zfs1008
        
        Please select a device to be mounted (q for none) [?,??,q]: 2
        mounting rpool on /a
        
      2. Roll back the root pool snapshots.
        # zfs rollback -rf rpool/ROOT@1013
      3. Reboot back to multiuser mode.
        # init 6
      4. [edit] Primary Mirror Disk in a ZFS Root Pool is Unavailable or Fails

        • If the primary disk in the pool fails, you will need to boot from the secondary disk by specifying the boot path. For example, on a SPARC system, a devalias is available to boot from the second disk as disk1.
        ok boot disk1
        • In some cases, you might need to remove the failed boot disk from the system to boot successfully from the other disk in the mirror.
        • While booted from a secondary disk, physically replace the primary disk. For example, c0t0d0s0.
        • Put a VTOC label on the new disk with format -e.
        • Let ZFS know the primary disk was physically replaced at the same location.
        # zpool replace rpool c0t0d0s0
        • If the zpool replace step fails, detach and attach the primary mirror disk:
        # zpool detach rpool c0t0d0s0
        # zpool attach rpool c0t1d0s0 c0t0d0s0
        • Confirm that the disk is available and the disk is resilvered.
        # zpool status rpool
        • After the resilvering is complete, replace the bootblocks on the primary disk.
        # installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t0d0s0
        • Confirm that you can boot from the primary disk.

        [edit] ZFS Swap and Dump Devices

        During an initial installation or a Live Upgrade migration, a swap volume and dump volume are created. The default sizes of the swap and dump volumes that are created by the Solaris installation program are as follows:

        • Swap volume size is calculated as half the size of physical memory, generally in the 512 MB to 2 GB range.
        • Dump volume size is calculated by the kernel based on dumpadm information and the size of physical memory.

        You can adjust the sizes of your swap and dump volumes in a JumpStart profile or during an initial installation to sizes of your choosing as long as the new sizes support system operation.

        # zfs list
        NAME                   USED  AVAIL  REFER  MOUNTPOINT
        rpool                 5.66G  27.6G  21.5K  /rpool
        rpool/ROOT            4.65G  27.6G    18K  /rpool/ROOT
        rpool/ROOT/zfs1008BE  4.65G  27.6G  4.65G  /
        rpool/dump             515M  27.6G   515M  -
        rpool/swap             513M  28.1G    16K  -
        

        [edit] Resizing ZFS Swap and Dump Devices

        • You can adjust the size of your swap and dump volumes during an initial installation.
        • You can create and size your swap and dump volumes before you do a Solaris Live Upgrade operation. ZFS dump volume performance is better when the volume is created with a 128-Kbyte block size. In SXCE, build 102, ZFS dump volumes are automatically created with a 128-Kbyte block size (CR 6725698). For example:
        # zpool create rpool mirror c0t0d0s0 c0t1d0s0
        /* The Solaris 10 10/08 dump creation syntax would be:
        # zfs create -V 2G -b 128k rpool/dump
        /* The SXCE build 102 dump creation syntax would be:
        # zfs create -V 2G rpool/dump
        SPARC# zfs create -V 2G -b 8k rpool/swap
        x86# zfs create -V 2G -b 4k rpool/swap
        
        • Solaris Live Upgrade does not resize existing swap and dump volumes. You can reset the volsize property of the swap and dump devices after a system is installed. For example:
        # zfs set volsize=2G rpool/dump
        # zfs get volsize rpool/dump
        NAME        PROPERTY  VALUE       SOURCE
        rpool/dump  volsize   2G          -
        
        • You can adjust the size of the swap and dump volumes in a JumpStart profile by using profile syntax similar to the following:
        install_type initial_install
        cluster SUNWCXall
        pool rpool 16g 2g 2g c0t0d0s0
        
        In this profile, the 2g and 2g entries set the size of the swap area and dump device as 2 Gbytes and 2 Gbytes, respectively.
        
        • You can adjust the size of your dump volume, but it might take some time, depending on the size of the dump volume. For example:
        # zfs set volsize=2G rpool/dump
        # zfs get volsize rpool/dump
        NAME        PROPERTY  VALUE       SOURCE
        rpool/dump  volsize   2G          -
        [edit] Adjusting the Size of the Swap Volume on an Active System

        If you need to adjust the size of the swap volume after installation on an active system, review the following steps. See CR 6765386 for more information.

        1. If your swap device is in use, then you might not be able to delete it. Check to see if the swap area is in use. For example:
          # swap -l
          swapfile                 dev    swaplo   blocks     free
          /dev/zvol/dsk/rpool/swap 182,2         8  4194296  4194296
          In the above output, blocks == free, so the swap device is not actually being used.
        2. If the swap area is not is use, remove the swap area. For example:
          # swap -d /dev/zvol/dsk/rpool/swap
        3. Confirm that the swap area is removed.
          # swap -l
          No swap devices configured
        4. Resize the swap volume. For example:
          # zfs set volsize=1G rpool/swap
        5. Activate the swap area.
          # swap -a /dev/zvol/dsk/rpool/swap
          # swap -l
          swapfile                 dev    swaplo   blocks     free
          /dev/zvol/dsk/rpool/swap 182,2         8  2097136  2097136

          The swap -a attempt might fail if the swap area is already listed in /etc/vfstab or is in use by Live Upgrade. In this case, use the swapadd feature instead.

          # /sbin/swapadd
          # swap -l
          swapfile                 dev  swaplo blocks   free
          /dev/zvol/dsk/rpool/swap 256,1      16 2097136 2097136
          

        [edit] Destroying a Pool With an Active Dump/Swap Device

        If you want to destroy a ZFS root pool that is no longer needed, but it still has an active dump device and swap area, you'll need to use the dumpadm and swap commands to remove the dump device and swap area. Then, use these commands to establish a new dump device and swap area.

        # dumpadm -d swap
        # dumpadm -d none
        < destroy the root pool >
        # swap -a <device-name>
        # dumpadm -d swap
        
Solaris Internals
Personal tools
The Books
The Ads