Tuesday, October 21, 2014

How to split rpool & try to boot from two pools(root pool & bkprpot pool)

root@solaris1:~# zpool status
  pool: rpool
 state: ONLINE
  scan: resilvered 5.16G in 0h19m with 0 errors on Fri Nov  1 17:24:43 2013
config:
        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            c2d1s0  ONLINE       0     0     0
            c2d0s0  ONLINE       0     0     0
root@solaris1:~# zpool split rpool bkprpool
root@solaris1:~# zpool list
NAME    SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
rpool  9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -

root@solaris1:~# zpool import bkprpool
cannot mount 'bkprpool/export' on '/export': directory is not empty
cannot mount 'bkprpool/export' on '/export': directory is not empty
cannot mount 'bkprpool/export/home' on '/export/home': failure mounting parent dataset
root@solaris1:~# df -h
Filesystem             Size   Used  Available Capacity  Mounted on
rpool/ROOT/solaris     9.8G   2.2G       4.4G    33%    /
/devices                 0K     0K         0K     0%    /devices
/dev                     0K     0K         0K     0%    /dev
ctfs                     0K     0K         0K     0%    /system/contract
proc                     0K     0K         0K     0%    /proc
mnttab                   0K     0K         0K     0%    /etc/mnttab
swap                   3.4G   2.2M       3.4G     1%    /system/volatile
objfs                    0K     0K         0K     0%    /system/object
sharefs                  0K     0K         0K     0%    /etc/dfs/sharetab
fd                       0K     0K         0K     0%    /dev/fd
rpool/ROOT/solaris/var
                       9.8G    98M       4.4G     3%    /var
swap                   3.4G     0K       3.4G     0%    /tmp
rpool/VARSHARE         9.8G    63K       4.4G     1%    /var/share
rpool/export           9.8G    32K       4.4G     1%    /export
rpool/export/home      9.8G    31K       4.4G     1%    /export/home
rpool                  9.8G    73K       4.4G     1%    /rpool
bkprpool               9.8G    73K       4.4G     1%    /bkprpool
root@solaris1:~# beadm list
BE      Active Mountpoint Space Policy Created
--      ------ ---------- ----- ------ -------
solaris NR     -          2.26G static 2013-11-01 16:22
solaris NR     /          2.37G static 2013-11-01 16:22

#cd /usr/platform/SUNW,SPARC-Enterprise-T5120/lib/fs/zfs
# installboot -F zfs bootblk /dev/rdsk/c2d0s0
Use -F to override or install without the -u option

root@solaris1:~# init 0
root@solaris1:~# svc.startd: The system is coming down.  Please wait.
svc.startd: 121 system services are now being stopped.
syncing file systems... done
Program terminated

SPARC Enterprise T5120, No Keyboard
Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.33.6.b, 4096 MB memory available, Serial #83528244.
Ethernet address 0:14:4f:fa:8a:34, Host ID: 84fa8a34.

{0} ok devalias
vol5                     /virtual-devices@100/channel-devices@200/disk@7
vol4                     /virtual-devices@100/channel-devices@200/disk@6
vol3                     /virtual-devices@100/channel-devices@200/disk@5
vol2                     /virtual-devices@100/channel-devices@200/disk@4
vol1                     /virtual-devices@100/channel-devices@200/disk@3
os-f                     /virtual-devices@100/channel-devices@200/disk@1
cdrom                    /virtual-devices@100/channel-devices@200/disk@2
os-p                     /virtual-devices@100/channel-devices@200/disk@0
net1                     /virtual-devices@100/channel-devices@200/network@1
net0                     /virtual-devices@100/channel-devices@200/network@0
net                      /virtual-devices@100/channel-devices@200/network@0
disk                     /virtual-devices@100/channel-devices@200/disk@0
virtual-console          /virtual-devices/console@1
name                     aliases
{0} ok boot os-p -v
Boot device: /virtual-devices@100/channel-devices@200/disk@0  File and args: -v
module /platform/SUNW,SPARC-Enterprise-T5120/kernel/sparcv9/unix: text at [0x1000000, 0x10cf407] data at 0x10000000
module /platform/SUNW,SPARC-Enterprise-T5120/kernel/sparcv9/genunix: text at [0x10cf408, 0x132f8cf] data at 0x107beb80
module /platform/SUNW,SPARC-Enterprise-T5120/kernel/misc/sparcv9/platmod: text at [0x132f8d0, 0x132f8d7] data at 0x1081be20
module /platform/SUNW,SPARC-Enterprise-T5120/kernel/cpu/sparcv9/SUNW,UltraSPARC-T2: text at [0x132f8e0, 0x1334bc7] data at 0x1081c480
SunOS Release 5.11 Version 11.1 64-bit
Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved.
Ethernet address = 0:14:4f:fa:8a:34
mem = 4194304K (0x100000000)
avail mem = 3845783552
root nexus = SPARC Enterprise T5120
pseudo0 at root
pseudo0 is /pseudo
scsi_vhci0 at root
scsi_vhci0 is /scsi_vhci
virtual-device: cnex0
cnex0 is /virtual-devices@100/channel-devices@200
vdisk@0 is online using ldc@2,0
channel-device: vdc0
vdc0 is /virtual-devices@100/channel-devices@200/disk@0
root on bkprpool/ROOT/solaris fstype zfs
pseudo-device: dld0
dld0 is /pseudo/dld@0
cpu0: UltraSPARC-T2 (chipid 0, clock 1165 MHz)
cpu1: UltraSPARC-T2 (chipid 0, clock 1165 MHz)
cpu2: UltraSPARC-T2 (chipid 0, clock 1165 MHz)
cpu3: UltraSPARC-T2 (chipid 0, clock 1165 MHz)
cpu4: UltraSPARC-T2 (chipid 0, clock 1165 MHz)
cpu5: UltraSPARC-T2 (chipid 0, clock 1165 MHz)
cpu6: UltraSPARC-T2 (chipid 0, clock 1165 MHz)
cpu7: UltraSPARC-T2 (chipid 0, clock 1165 MHz)
channel-device: vpci0
pseudo-device: dtrace0
dtrace0 is /pseudo/dtrace@0
pseudo-device: zfs0
zfs0 is /pseudo/zfs@0
This Solaris instance has UUID a949e2d3-52eb-66c3-bcc9-cae29f759d41vdisk@2 is online using ldc@4,0
channel-device: vdc2
vdc2 is /virtual-devices@100/channel-devices@200/disk@1
dump on /dev/zvol/dsk/rpool/dump size 2048 MB
pseudo-device: bmc0
bmc0 is /pseudo/bmc@0
vdisk@3 is online using ldc@5,0
channel-device: vdc3
vdc3 is /virtual-devices@100/channel-devices@200/disk@3
pseudo-device: drctl0
drctl0 is /pseudo/drctl@0
pseudo-device: mdesc0
mdesc0 is /pseudo/mdesc@0
pseudo-device: pool0
pool0 is /pseudo/pool@0
pseudo-device: devinfo0
devinfo0 is /pseudo/devinfo@0
iscsi0 at root
iscsi0 is /iscsi
Hostname: solaris1
pseudo-device: ds_snmp0
ds_snmp0 is /pseudo/ds_snmp@0
fcoe0 at root
fcoe0 is /fcoe
pseudo-device: pseudo1
pseudo1 is /pseudo/zconsnex@1
vdisk@1 is online using ldc@3,0
channel-device: vdc1
vdc1 is /virtual-devices@100/channel-devices@200/disk@2
vdisk@4 is online using ldc@6,0
channel-device: vdc4
vdc4 is /virtual-devices@100/channel-devices@200/disk@4
vdisk@5 is online using ldc@7,0
channel-device: vdc5
vdc5 is /virtual-devices@100/channel-devices@200/disk@5
vdisk@6 is online using ldc@8,0
channel-device: vdc6
vdc6 is /virtual-devices@100/channel-devices@200/disk@6
vdisk@7 is online using ldc@9,0
channel-device: vdc7
vdc7 is /virtual-devices@100/channel-devices@200/disk@7
pseudo-device: dcpc0
dcpc0 is /pseudo/dcpc@0
pseudo-device: ds_pri0
ds_pri0 is /pseudo/ds_pri@0
pseudo-device: fasttrap0
fasttrap0 is /pseudo/fasttrap@0
pseudo-device: fbt0
fbt0 is /pseudo/fbt@0
pseudo-device: fcode0
fcode0 is /pseudo/fcode@0
pseudo-device: fcp0
fcp0 is /pseudo/fcp@0
pseudo-device: fcsm0
fcsm0 is /pseudo/fcsm@0
pseudo-device: llc10
llc10 is /pseudo/llc1@0
pseudo-device: lockstat0
lockstat0 is /pseudo/lockstat@0
pseudo-device: lofi0
lofi0 is /pseudo/lofi@0
pseudo-device: ntwdt0
ntwdt0 is /pseudo/ntwdt@0
pseudo-device: profile0
profile0 is /pseudo/profile@0
pseudo-device: ramdisk1024
ramdisk1024 is /pseudo/ramdisk@1024
pseudo-device: sdt0
sdt0 is /pseudo/sdt@0
pseudo-device: srn0
srn0 is /pseudo/srn@0
pseudo-device: systrace0
systrace0 is /pseudo/systrace@0
pseudo-device: trapstat0
trapstat0 is /pseudo/trapstat@0
pseudo-device: bpf0
bpf0 is /pseudo/bpf@0
pseudo-device: fssnap0
fssnap0 is /pseudo/fssnap@0
pseudo-device: pm0
pm0 is /pseudo/pm@0
cannot mount 'bkprpool/export' on '/export': directory is not empty
cannot mount 'bkprpool/export' on '/export': directory is not empty
cannot mount 'bkprpool/export/home' on '/export/home': failure mounting parent dataset
svc:/system/filesystem/local:default: WARNING: /usr/sbin/zfs mount -a failed: one or more file systems failed to mount
Dec  6 15:11:27 svc.startd[11]: svc:/system/filesystem/local:default: Method "/lib/svc/method/fs-local" failed with exit status 95.
Dec  6 15:11:27 svc.startd[11]: system/filesystem/local:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
solaris1 console login: root
Password:
Last login: Fri Dec  6 14:57:25 on console
Oracle Corporation      SunOS 5.11      11.1    September 2012
You have new mail.
root@solaris1:~# zpool list
NAME       SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
bkprpool  9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
rpool     9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
root@solaris1:~# zpool status
  pool: bkprpool
 state: ONLINE
  scan: resilvered 5.16G in 0h19m with 0 errors on Fri Nov  1 17:24:43 2013
config:
        NAME      STATE     READ WRITE CKSUM
        bkprpool  ONLINE       0     0     0
          c2d0s0  ONLINE       0     0     0
errors: No known data errors
  pool: rpool
 state: ONLINE
  scan: resilvered 5.16G in 0h19m with 0 errors on Fri Nov  1 17:24:43 2013
config:
        NAME      STATE     READ WRITE CKSUM
        rpool     ONLINE       0     0     0
          c2d1s0  ONLINE       0     0     0
errors: No known data errors
root@solaris1:~# df -h
Filesystem             Size   Used  Available Capacity  Mounted on
bkprpool/ROOT/solaris
                       9.8G   2.2G       4.4G    33%    /
/devices                 0K     0K         0K     0%    /devices
/dev                     0K     0K         0K     0%    /dev
ctfs                     0K     0K         0K     0%    /system/contract
proc                     0K     0K         0K     0%    /proc
mnttab                   0K     0K         0K     0%    /etc/mnttab
swap                   3.6G   2.1M       3.6G     1%    /system/volatile
objfs                    0K     0K         0K     0%    /system/object
sharefs                  0K     0K         0K     0%    /etc/dfs/sharetab
fd                       0K     0K         0K     0%    /dev/fd
bkprpool/ROOT/solaris/var
                       9.8G    98M       4.4G     3%    /var
swap                   3.6G     0K       3.6G     0%    /tmp
bkprpool/VARSHARE      9.8G    63K       4.4G     1%    /var/share
bkprpool               9.8G    73K       4.4G     1%    /bkprpool
rpool/export           9.8G    32K       4.4G     1%    /export
rpool/export/home      9.8G    31K       4.4G     1%    /export/home
rpool                  9.8G    73K       4.4G     1%    /rpool

root@solaris1:~# zpool get all bkprpool
NAME      PROPERTY       VALUE                  SOURCE
bkprpool  allocated      5.26G                  -
bkprpool  altroot        -                      default
bkprpool  autoexpand     off                    default
bkprpool  autoreplace    off                    default
bkprpool  bootfs         bkprpool/ROOT/solaris  local
bkprpool  cachefile      -                      default
bkprpool  capacity       52%                    -
bkprpool  dedupditto     0                      default
bkprpool  dedupratio     1.00x                  -
bkprpool  delegation     on                     default
bkprpool  failmode       wait                   default
bkprpool  free           4.67G                  -
bkprpool  guid           18142721330775309480   -
bkprpool  health         ONLINE                 -
bkprpool  listshares     off                    default
bkprpool  listsnapshots  off                    default
bkprpool  readonly       off                    -
bkprpool  size           9.94G                  -
bkprpool  version        34                     default
root@solaris1:~# zpool get all rpool
NAME   PROPERTY       VALUE                SOURCE
rpool  allocated      5.26G                -
rpool  altroot        -                    default
rpool  autoexpand     off                  default
rpool  autoreplace    off                  default
rpool  bootfs         rpool/ROOT/solaris   local
rpool  cachefile      -                    default
rpool  capacity       52%                  -
rpool  dedupditto     0                    default
rpool  dedupratio     1.00x                -
rpool  delegation     on                   default
rpool  failmode       wait                 default
rpool  free           4.67G                -
rpool  guid           6955103259219416060  -
rpool  health         ONLINE               -
rpool  listshares     off                  default
rpool  listsnapshots  off                  default
rpool  readonly       off                  -
rpool  size           9.94G                -
rpool  version        34                   default
root@solaris1:~# zpool list
NAME       SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
bkprpool  9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
rpool     9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -


root@solaris1:~# dumpadm
      Dump content: kernel pages
       Dump device: /dev/zvol/dsk/rpool/dump (dedicated)
Savecore directory: /var/crash
  Savecore enabled: yes
   Save compressed: on
root@solaris1:~# dumpadm -d /dev/zvol/dsk/bkprpool/dump
dump on /dev/zvol/dsk/bkprpool/dump size 2048 MB
      Dump content: kernel pages
       Dump device: /dev/zvol/dsk/bkprpool/dump (dedicated)
Savecore directory: /var/crash
  Savecore enabled: yes
   Save compressed: on
root@solaris1:~# swap -l
swapfile             dev    swaplo   blocks     free
/dev/zvol/dsk/rpool/swap 285,2        16  2097136  2097136
root@solaris1:~# swap -a /dev/zvol/dsk/bkprpool/swap
swap -d root@solaris1:~# swap -d /dev/zvol/dsk/rpool/swap
root@solaris1:~# dumpadm
      Dump content: kernel pages
       Dump device: /dev/zvol/dsk/bkprpool/dump (dedicated)
Savecore directory: /var/crash
  Savecore enabled: yes
   Save compressed: on
root@solaris1:~# swap -l
swapfile             dev    swaplo   blocks     free
/dev/zvol/dsk/bkprpool/swap 285,4        16  2097136  2097136

root@solaris1:~# df -h
Filesystem             Size   Used  Available Capacity  Mounted on
bkprpool/ROOT/solaris
                       9.8G   2.2G       4.4G    33%    /
/devices                 0K     0K         0K     0%    /devices
/dev                     0K     0K         0K     0%    /dev
ctfs                     0K     0K         0K     0%    /system/contract
proc                     0K     0K         0K     0%    /proc
mnttab                   0K     0K         0K     0%    /etc/mnttab
swap                   3.6G   2.1M       3.6G     1%    /system/volatile
objfs                    0K     0K         0K     0%    /system/object
sharefs                  0K     0K         0K     0%    /etc/dfs/sharetab
fd                       0K     0K         0K     0%    /dev/fd
bkprpool/ROOT/solaris/var
                       9.8G    98M       4.4G     3%    /var
swap                   3.6G     0K       3.6G     0%    /tmp
bkprpool/VARSHARE      9.8G    63K       4.4G     1%    /var/share
bkprpool               9.8G    73K       4.4G     1%    /bkprpool
rpool/export           9.8G    32K       4.4G     1%    /export
rpool/export/home      9.8G    31K       4.4G     1%    /export/home
rpool                  9.8G    73K       4.4G     1%    /rpool
root@solaris1:~# zfs umount rpool/export/home
root@solaris1:~# zfs umount rpool/export
root@solaris1:~# zfs umount rpool
root@solaris1:~# zpool list
NAME       SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
bkprpool  9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
rpool     9.94G  2.26G  7.67G  22%  1.00x  ONLINE  -
root@solaris1:~# zpool export rpool
root@solaris1:~# zpool list
NAME       SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
bkprpool  9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
root@solaris1:~# zfs mount bkprpool/export
root@solaris1:~# zfs mount bkprpool/export/home

root@solaris1:~# zpool list
NAME       SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
bkprpool  9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
root@solaris1:~# beadm list
BE      Active Mountpoint Space Policy Created
--      ------ ---------- ----- ------ -------
solaris NR     /          2.37G static 2013-11-01 16:22


root@solaris1:~# init 0
root@solaris1:~# svc.startd: The system is coming down.  Please wait.
svc.startd: 118 system services are now being stopped.
svc.startd: Killing user processes.
Dec  6 15:25:40 The system is down.  Shutdown took 15 seconds.
syncing file systems... done
Program terminated

SPARC Enterprise T5120, No Keyboard
Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.33.6.b, 4096 MB memory available, Serial #83528244.
Ethernet address 0:14:4f:fa:8a:34, Host ID: 84fa8a34.
=============================
Boot from root disk
============================
{0} ok devalias
vol5                     /virtual-devices@100/channel-devices@200/disk@7
vol4                     /virtual-devices@100/channel-devices@200/disk@6
vol3                     /virtual-devices@100/channel-devices@200/disk@5
vol2                     /virtual-devices@100/channel-devices@200/disk@4
vol1                     /virtual-devices@100/channel-devices@200/disk@3
os-f                     /virtual-devices@100/channel-devices@200/disk@1
cdrom                    /virtual-devices@100/channel-devices@200/disk@2
os-p                     /virtual-devices@100/channel-devices@200/disk@0
net1                     /virtual-devices@100/channel-devices@200/network@1
net0                     /virtual-devices@100/channel-devices@200/network@0
net                      /virtual-devices@100/channel-devices@200/network@0
disk                     /virtual-devices@100/channel-devices@200/disk@0
virtual-console          /virtual-devices/console@1
name                     aliases
{0} ok boot os-p
Boot device: /virtual-devices@100/channel-devices@200/disk@0  File and args:
SunOS Release 5.11 Version 11.1 64-bit
Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved.
Hostname: solaris1
Dec  6 15:28:22 solaris1 sendmail[792]: My unqualified host name (solaris1) unknown; sleeping for retry
solaris1 console login: root
rPassword:
Login incorrect
solaris1 console login: root
Password:
Warning: 1 failed authentication attempt at Fri Dec 06 15:28 2013 since last successful authentication.
Dec  6 15:28:41 solaris1 login: ROOT LOGIN /dev/console
Last login: Fri Dec  6 15:11:42 on console
Oracle Corporation      SunOS 5.11      11.1    September 2012
You have new mail.
root@solaris1:~# zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
bkprpool                   5.36G  4.42G  73.5K  /bkprpool
bkprpool/ROOT              2.26G  4.42G    31K  legacy
bkprpool/ROOT/solaris      2.26G  4.42G  2.16G  /
bkprpool/ROOT/solaris/var  99.3M  4.42G  97.8M  /var
bkprpool/VARSHARE          63.5K  4.42G  63.5K  /var/share
bkprpool/dump              2.06G  4.49G  2.00G  -
bkprpool/export              63K  4.42G    32K  /export
bkprpool/export/home         31K  4.42G    31K  /export/home
bkprpool/swap              1.03G  4.46G  1.00G  -
root@solaris1:~# zpool list
NAME       SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
bkprpool  9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -

=====================
Boot from mirror disk
=====================
{0} ok devalias
vol5                     /virtual-devices@100/channel-devices@200/disk@7
vol4                     /virtual-devices@100/channel-devices@200/disk@6
vol3                     /virtual-devices@100/channel-devices@200/disk@5
vol2                     /virtual-devices@100/channel-devices@200/disk@4
vol1                     /virtual-devices@100/channel-devices@200/disk@3
os-f                     /virtual-devices@100/channel-devices@200/disk@1
cdrom                    /virtual-devices@100/channel-devices@200/disk@2
os-p                     /virtual-devices@100/channel-devices@200/disk@0
net1                     /virtual-devices@100/channel-devices@200/network@1
net0                     /virtual-devices@100/channel-devices@200/network@0
net                      /virtual-devices@100/channel-devices@200/network@0
disk                     /virtual-devices@100/channel-devices@200/disk@0
virtual-console          /virtual-devices/console@1
name                     aliases
{0} ok boot os-f
Boot device: /virtual-devices@100/channel-devices@200/disk@1  File and args:
SunOS Release 5.11 Version 11.1 64-bit
Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved.
Hostname: solaris1
Dec  6 15:32:15 solaris1 sendmail[793]: My unqualified host name (solaris1) unknown; sleeping for retry
solaris1 console login: root
Password:
Dec  6 15:32:27 solaris1 login: ROOT LOGIN /dev/console
Last login: Fri Dec  6 14:57:25 on console
Oracle Corporation      SunOS 5.11      11.1    September 2012
You have new mail.
droot@solaris1:~#
root@solaris1:~# zpool list
NAME    SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
rpool  9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
root@solaris1:~# df -h
Filesystem             Size   Used  Available Capacity  Mounted on
rpool/ROOT/solaris     9.8G   2.2G       4.4G    33%    /
/devices                 0K     0K         0K     0%    /devices
/dev                     0K     0K         0K     0%    /dev
ctfs                     0K     0K         0K     0%    /system/contract
proc                     0K     0K         0K     0%    /proc
mnttab                   0K     0K         0K     0%    /etc/mnttab
swap                   3.5G   2.2M       3.5G     1%    /system/volatile
objfs                    0K     0K         0K     0%    /system/object
sharefs                  0K     0K         0K     0%    /etc/dfs/sharetab
fd                       0K     0K         0K     0%    /dev/fd
rpool/ROOT/solaris/var
                       9.8G    98M       4.4G     3%    /var
swap                   3.5G     0K       3.5G     0%    /tmp
rpool/VARSHARE         9.8G    63K       4.4G     1%    /var/share
rpool/export           9.8G    32K       4.4G     1%    /export
rpool/export/home      9.8G    31K       4.4G     1%    /export/home
rpool                  9.8G    73K       4.4G     1%    /rpool

No comments:

Post a Comment