分类:
2010-06-04 16:39:07
zpool status zpool status -v fmdump fmdump -ev or fmdump -eV format or rmformat
# 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:
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
# 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:
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
# 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
# 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
Replacing Devices in a Pool
# 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 z-mirror c4t60060160C166120099E5419F6C29DC11d0s6 c4t60060160C16612006A4583D66C29DC11d0s6
If you are replacing a disk in the same physical location, then you only need identify the original device. For example:
# zpool replace z-mirror c4t60060160C166120099E5419F6C29DC11d0s6
# zpool status z-mirror
pool: z-mirror
state: ONLINE
scrub: 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# zpool clear z-mirror
# zpool scrub z-mirror
Follow these steps after the device is replaced, the pool errors are cleared, and the pool is scrubbed.
# fmstat
# fmadm reset zfs-diagnosis # fmadm reset zfs-retire # fmstat
# fmadm faulty -a
--------------- ------------------------------------ -------------- ---------
TIME EVENT-ID MSG-ID SEVERITY
--------------- ------------------------------------ -------------- ---------
Jul 17 11:03:56 378924d1-840b-c4dd-c8e2-a5491d4047ff ZFS-8000-D3 Major
...
Fault class : fault.fs.zfs.device
Affects : zfs://pool=rzpool/vdev=70f7855d9f673fcc
faulted but still in service
Problem in : zfs://pool=rzpool/vdev=70f7855d9f673fcc
faulted but still in service
...# fmadm repair zfs://pool=rzpool/vdev=70f7855d9f673fcc fmadm: recorded repair to zfs://pool=rzpool/vdev=70f7855d9f673fcc
# fmadm faulty
# zpool attach rpool c1t1d0s0 c1t0d0s0 cannot attach c1t0d0s0 to c1t1d0s0: new device must be a single disk
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.
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.
ok boot -m milestone=none
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 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.
# zpool list pool NAME SIZE USED AVAIL CAP HEALTH ALTROOT pool 16.8G 76.5K 16.7G 0% ONLINE - # zpool replace pool c1t16d0 c1t1d0 # zpool replace pool c1t17d0 c1t2d0 # zpool list pool NAME SIZE USED AVAIL CAP HEALTH ALTROOT pool 16.8G 88.5K 16.7G 0% ONLINE - # zpool set autoexpand=on pool # zpool list pool NAME SIZE USED AVAIL CAP HEALTH ALTROOT pool 68.2G 117K 68.2G 0% ONLINE -
2. c6t600A0B800049F93C0000030A48B3EA2Cd0/scsi_vhci/ssd@g600a0b800049f93c0000030a48b3ea2c 3. c6t600A0B800049F93C0000030D48B3EAB6d0 /scsi_vhci/ssd@g600a0b800049f93c0000030d48b3eab6
# zpool replace pool-name device-name
# zpool clear pool-name
Update: This bug is fixed in Nevada, build 124.
# zfs set utf8only=on rpool cannot set property for 'rpool': 'utf8only' is readonly
# 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
# zpool create pool mirror c0t1d0 c0t2d0 cache c0t3d0 cannot create 'pool': operation not supported on this type of pool
# zpool create pool mirror c0t1d0 c0t2d0 # zpool add pool cache c0t3d0 cannot add to 'pool': pool must be upgraded to add these vdevs
ok boot cdrom - text ok boot net - text **On an x86 based system, select the text-mode install option when presented.
* Exit the GUI installer * Expand the terminal window to 80 x 24 * Unset the DISPLAY, like this: # DISPLAY= # export DISPLAY # install-solaris
ERROR: ZFS pooldoes not support boot environments
# zpool add -f rpool log c0t6d0s0 cannot add to 'rpool': root pool can not have multiple vdevs or separate logs
ERROR: ZFSdoes not support boot environments
# zfs set compression=on rpool/ROOT
UFS -> UFS UFS -> ZFS ZFS -> ZFS (different pool)
# BOOT_MENU_FILE="menu.lst" # export BOOT_MENU_FILE
Review the following information before upgrading to the Solaris 10 10/09 release.
# luactivate b126 System has findroot enabled GRUB ERROR: Unable to determine the configuration of the current boot environment.
Review the following supported ZFS and zones configurations. These configurations are upgradeable and patchable.
This ZFS zone root configuration can be upgraded or patched. See the ZFS Administration Guide for information about supported zones configurations that can be upgraded or patched in the Solaris 10 release.
# zpool create rpool mirror c1t0d0s0 c1t1d0s0
# lucreate -n S10BE2 -p rpool
# lucreate S10BE3
# luactivate S10BE3
# init 6
# 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/zonerootAThe mount point for the root ZFS BE (rpool/ROOT/s10u6) should be /.# zfs inherit -r mountpoint rpool/ROOT/s10u6 # zfs set mountpoint=/ rpool/ROOT/s10u6
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.
zfs create -o canmount=noauto rpool/ROOT/S10be/zonesSetting 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.
# zfs mount rpool/ROOT/S10be/zonesThe dataset is mounted at /zones.
# zfs create -o canmount=noauto rpool/ROOT/S10be/zones/zonerootA # zfs mount rpool/ROOT/S10be/zones/zonerootA
# chmod 700 /zones/zonerootA
# 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# zoneadm -z zoneA install
# zoneadm -z zoneA boot
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.
# lucreate -n newBEThe 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.
# luupgrade -u -n newBE -s /net/install/export/s10u7/latestWhere the -s option is the location of a Solaris installation medium.
# luupgrade -t -n newBE -t -s /patchdir 139147-02 157347-14
# luactivate newBE
# init 6
# 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 /.# zfs inherit -r mountpoint rpool/ROOT/newBE # zfs set mountpoint=/ rpool/ROOT/newBE
# 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 to top level dataset for BEERROR: Unable to delete GRUB menu entry for deleted boot environment . Unable to delete boot environment.
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}"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
krtld: Ignoring invalid kernel option -Z. krtld: Unused kernel arguments: `rpool/ROOT/zfs1008BE'.
If you need to recover the root password or some similar problem that prevents successful login in a ZFS root environment, you will need to boot failsafe mode or boot from alternate media, depending on the severity of the error. In addition, the OpenSolaris release doesn't support failsafe mode.
Select either of the following recovery methods:
ok boot -F failsafe
. . . 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.
# cd /a/etc
# vi passwd
# init 6
ok boot cdrom -s ok boot net -s
If you don't use the -s option, you will need to exit the installation program.
# zpool import -R /a rpool
# zfs mount rpool/ROOT/zfsBE
# cd /a/etc
# vi shadow
# init 6
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.
# zpool import rpool
# 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/zonerootAThe mount point for the root BE (rpool/ROOT/s10u6) should be /.# zfs inherit -r mountpoint rpool/ROOT/s10u6 # zfs set mountpoint=/ rpool/ROOT/s10u6
You can boot from different devices in a mirrored ZFS root pool.
# 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
# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t1d0s0
ok setenv boot-device /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@1 ok boot
# beadm activate opensolaris-2 Unable to activate opensolaris-2. Unknown external error.
# zpool detach rpool c0t0d0s0
# format -e c0t1d0s0 format> label [0] SMI Label [1] EFI Label Specify Label type[1]: 0 Ready to label disk, continue? yes format> quitMake 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.
# zpool attach rpool c0t0d0s0 c0t1d0s0
# 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
x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t1d0s0
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:
Different ways exist to send and receive root pool snapshots:
Validating remotely stored snapshots as files or snapshots is an important step in root pool recovery. In either method, snapshots should be recreated on a routine basis, such as when the pool configuration changes or the Solaris OS is upgraded.
The following procedures have been tested with one ZFS BE.
Create root pool snapshots to be stored as files in a pool on a remote system for recovery purposes. For example:
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
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 ""If you are running a current OpenSolaris release, you will need to provide the fully qualified domain name for the local-system, in this example.
local# zfs snapshot -r rpool@0316 local# zpool set listsnapshots=on rpool local# zfs list NAME USED AVAIL REFER MOUNTPOINT rpool 17.6G 116G 67K /rpool rpool@0316 0 - 67K - rpool/ROOT 5.43G 116G 21K legacy rpool/ROOT@0316 0 - 21K - rpool/ROOT/osolBE 5.43G 116G 4.68G / rpool/ROOT/osolBE@install 773M - 3.89G - rpool/ROOT/osolBE@0316 290K - 4.68G - rpool/dump 4.00G 116G 4.00G - rpool/dump@0316 0 - 4.00G - rpool/export 69.5K 116G 23K /export rpool/export@0316 0 - 23K - rpool/export/home 46.5K 116G 23K /export/home rpool/export/home@0316 0 - 23K - rpool/export/home/admin 23.5K 116G 23.5K /export/home/admin rpool/export/home/admin@0316 0 - 23.5K - rpool/swap 8.20G 124G 15.2M - rpool/swap@0316 0 - 15.2M -
local# zfs send -Rv rpool/ROOT/@0316 > /net/remote-system/rpool/snaps/rpoolzfsBE.0316 local# zfs send -Rv rpool/export@0316 > /net/remote-system/rpool/snaps/rpoolexport.0316
If you are running the SXCE build 107 or the Solaris 10 5/09 or later release, you can send the entire recursive snapshot.
# zfs send -Rv rpool@0316 > /net/remote-system/rpool/snaps/rpool.0316
In this scenario, assume the following conditions:
All the steps below are performed on the local system.
ok boot net
or
ok boot cdrom
Then, exit out of the installation program.
# mount -F nfs remote-system:/rpool/snaps /mnt
# zpool create -f -o failmode=continue -R /a -m legacy -o cachefile=/etc/zfs/zpool.cache rpool c1t1d0s0
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
# cat /mnt/rpoolzfsBE.0316 | zfs receive -Fd rpool # cat /mnt/rpoolexport.0316 | zfs receive -Fd rpoolGo to the next step.
# cat /mnt/rpool.0316 | 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.
# zfs mount rpool/ROOT/osolBE # zfs mount rpool/ROOT/osolBE/var
# 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.
# zfs list NAME USED AVAIL REFER MOUNTPOINT rpool 17.6G 116G 67K /rpool rpool@0316 0 - 67K - rpool/ROOT 5.44G 116G 21K legacy rpool/ROOT@0316 0 - 21K - rpool/ROOT/osolBE 5.44G 116G 4.68G / rpool/ROOT/osolBE@install 773M - 3.89G - rpool/ROOT/osolBE@0316 3.69M - 4.68G - rpool/dump 4.00G 116G 4.00G - rpool/dump@0316 0 - 4.00G - rpool/export 106K 116G 23K /export rpool/export@0316 18K - 23K - rpool/export/home 64.5K 116G 23K /export/home rpool/export/home@0316 18K - 23K - rpool/export/home/admin 23.5K 116G 23.5K /export/home/admin rpool/export/home/admin@0316 0 - 23.5K - rpool/swap 8.20G 124G 15.2M - rpool/swap@0316 0 - 15.2M -
# zpool set bootfs=rpool/ROOT/osolBE rpool
# zfs create -V 2G rpool/dump
SPARC# zfs create -V 2G -b 8k rpool/swap x86# zfs create -V 2G -b 4k rpool/swap
# init 6
Create root pool snapshots and send them as snapshots to a pool on a remote system for recovery purposes. The remote system must be configured to allow ssh as root.
local# zfs snapshot -r rpool@0901 local# zfs list -t all NAME USED AVAIL REFER MOUNTPOINT rpool 8.88G 58.1G 21K legacy rpool@0901 0 - 21K - rpool/ROOT 4.87G 58.1G 21K legacy rpool/ROOT@0901 0 - 21K - rpool/ROOT/zfs1009BE 4.87G 58.1G 4.87G legacy rpool/ROOT/zfs1009BE@0901 519K - 4.87G - rpool/dump 2.00G 58.1G 2.00G - rpool/dump@0901 0 - 2.00G - rpool/swap 2.00G 60.1G 16K - rpool/swap@0901 0 - 16K -
local# zfs send rpool/ROOT@0901 | ssh remote-system zfs receive -Fdu tank Password: zfs send rpool/ROOT/zfs1009BE@0901 | ssh remote-system zfs receive -Fdu tank Password:
remote# zfs list -r tank tank 4.87G 129G 23K /tank tank/ROOT 4.87G 129G 23K /tank/ROOT tank/ROOT@0901 18K - 21K - tank/ROOT/zfs1009BE 4.87G 129G 4.87G /tank/ROOT/zfs1009BE tank/ROOT/zfs1009BE@0901 0 - 4.87G -
In this scenario, assume the following conditions:
ok boot net
or
ok boot cdrom
Then, exit out of the installation program.
remote# netservices open remote# vi /.rhosts remote# vi /etc/hosts.equiv
local# zpool create -f -o failmode=continue -R /a -m legacy -o cachefile=/etc/zfs/zpool.cache rpool c1t1d0s0
local-sparc# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0 local-x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t1d0s0
local# rsh remote-system zfs send tank/ROOT@0901 | zfs receive -Fdu rpool local# rsh remote-system zfs send tank/ROOT/zfs1009BE@0901 | zfs receive -Fdu rpoolThis step might take some time.
local# zfs list NAME USED AVAIL REFER MOUNTPOINT rpool 4.87G 62.1G 21K legacy rpool/ROOT 4.87G 62.1G 21K legacy rpool/ROOT@0901 0 - 21K - rpool/ROOT/zfs1009BE 4.87G 62.1G 4.87G legacy rpool/ROOT/zfs1009BE@0901 0 - 4.87G -
local# zfs mount rpool/ROOT/zfs1009BE local# zfs mount rpool/ROOT/zfs1009BE/var
Then, mount everything in the pool that is not part of a BE.
local# 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.
local# zpool set bootfs=rpool/ROOT/zfs1009BE rpool
local# zfs create -V 2G rpool/dump
local-SPARC# zfs create -V 2G -b 8k rpool/swap local-x86# zfs create -V 2G -b 4k rpool/swap
local# init 6
local# zfs list -t all NAME USED AVAIL REFER MOUNTPOINT rpool 8.88G 58.1G 21K legacy rpool@0901 0 - 21K - rpool/ROOT 4.87G 58.1G 21K legacy rpool/ROOT@0901 0 - 21K - rpool/ROOT/zfs1009BE 4.87G 58.1G 4.87G legacy rpool/ROOT/zfs1009BE@0901 519K - 4.87G - rpool/dump 2.00G 58.1G 2.00G - rpool/swap 2.00G 60.1G 16K -
You might need to replace a disk in the root pool for the following reasons:
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.
# 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.
# 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# format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000004cf7fac8a,0
1. c1t1d0
/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> # 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
! - execute , 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
# zpool attach rpool c1t0d0s0 c1t1d0s0 Please be sure to invoke installgrub(1M) to make 'c1t1d0s0' bootable.
# zpool status rpool
x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t1d0s0
sparc# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0
# zpool detach rpool c1t0d0s0
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@0730 # zfs list NAME USED AVAIL REFER MOUNTPOINT rpool 6.87G 60.1G 37K /rpool rpool@0730 18K - 37K - rpool/ROOT 3.87G 60.1G 18K legacy rpool/ROOT@0730 0 - 18K - rpool/ROOT/zfs1008BE 3.87G 60.1G 3.82G / rpool/ROOT/zfs1008BE@0730 52.3M - 3.81G - rpool/dump 1.00G 60.1G 1.00G - rpool/dump@0730 16K - 1.00G - rpool/export 52K 60.1G 19K /export rpool/export@0730 15K - 19K - rpool/export/home 18K 60.1G 18K /export/home rpool/export/home@0730 0 - 18K - rpool/swap 2.00G 62.1G 16K - rpool/swap@0730 0 - 16K -
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
# zfs rollback rpool@0730 # zfs rollback rpool/ROOT@0730 # zfs rollback rpool/ROOT/zfs1008BE@0730 # zfs rollback rpool/export@0730 . . .Current ZFS snapshot rollback behavior is that recursive snapshots are not rolled back with the -r option. You must roll back the individual snapshots from the recursive snapshot.
# init 6
ok boot disk1
# zpool offline rpool c0t0d0s0 # cfgadm -c unconfigure c1::dsk/c0t0d0
# cfgadm -c configure c1::dsk/c0t0d0 # zpool online rpool c0t0d0
# zpool replace rpool c0t0d0s0
# zpool detach rpool c0t0d0s0 # zpool attach rpool c0t1d0s0 c0t0d0s0
# zpool status rpool
SPARC# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t0d0s0 x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t0d0s0
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:
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 -
# 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
# swap -a /dev/zvol/dsk/rpool/swap
/dev/zvol/dsk/rpool/swap - - swap - no
# dumpadm -d /dev/zvol/dsk/rpool/dump
# zfs set volsize=2G rpool/dump # zfs get volsize rpool/dump NAME PROPERTY VALUE SOURCE rpool/dump volsize 2G -
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.
# zfs set volsize=2G rpool/dump # zfs get volsize rpool/dump NAME PROPERTY VALUE SOURCE rpool/dump volsize 2G -
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.
# swap -l swapfile dev swaplo blocks free /dev/zvol/dsk/rpool/swap 182,2 8 4194296 4194296In the above output, blocks == free, so the swap device is not actually being used.
# swap -d /dev/zvol/dsk/rpool/swap
# swap -l No swap devices configured
# zfs set volsize=1G rpool/swap
# 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
If you need to add swap space but removing an existing swap device is difficult on a busy system, add another swap volume. For example:
# zfs create -V 2G rpool/swap1 # swap -a /dev/zvol/dsk/rpool/swap1 # swap -l swapfile dev swaplo blocks free /dev/zvol/dsk/rpool/swap 256,1 16 2097136 2097136 /dev/zvol/dsk/rpool/swap1 256,5 16 4194288 4194288 Add an entry for the second swap volume to the /etc/vfstab file.
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# dumpadm -d swap