Popular Posts

Nov 9, 2018

Replace a ZFS Root Pool to another disk


Replace a ZFS Root Pool to another disk


APPLIES TO : Solaris 11.3 LDOM

ISSUE : Server is running in 100GB OS LUN, need to move the OS to another disk provided from another array. 

GOAL :  Replace a ZFS Root Pool with another disk, Move the OS LUN to the disk provided from another Storage Array

SOLUTION :  Attach the secondary disk in zpool, boot the server in both disks, detach the primary disk.

EXAMPLE :  

1.      Verify the secondary disk c1d1 is visible in format output
                root@judi-dev-01:~# echo | format
                Searching for disks...done
                
                AVAILABLE DISK SELECTIONS:
                       0. c1d0 <3PARdata-VV-3212-100.00GB>
                          /virtual-devices@100/channel-devices@200/disk@0
                       1. c1d1 <3PARdata-VV-3212-100.00GB>
                          /virtual-devices@100/channel-devices@200/disk@1
                Specify disk (enter its number): Specify disk (enter its number):

                root@judi-dev-01:~#

2.      Check the zpool list
                root@judi-dev-01:~# zpool list
                NAME    SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
                rpool  99.5G  9.37G  90.1G   9%  1.00x  ONLINE  -

                root@judi-dev-01:~#

3.      Check the zpool Status
                root@judi-dev-01:~# zpool status
                  pool: rpool
                 state: ONLINE
                  scan: resilvered 7.37G in 30s with 0 errors on Thu Nov  8 11:51:10 2018

                config:

                        NAME    STATE     READ WRITE CKSUM
                        rpool   ONLINE       0     0     0
                          c1d0  ONLINE       0     0     0

                errors: No known data errors

                root@judi-dev-01:~#

4.      Verify the bootdisk path (The server booted with disk@0)
                root@judi-dev-01:~# prtconf -vp | grep bootpath
                        bootpath:  '/virtual-devices@100/channel-devices@200/disk@0'

                root@judi-dev-01:~#

5.      Attach the secondary disk c1d1 to zpool
                root@judi-dev-01:~# zpool attach rpool c1d0 c1d1
                Make sure to wait until resilver is done before rebooting.

                root@judi-dev-01:~#

6.      Check the status of the pool, Wait till the resilvered completes 
                root@judi-dev-01:~# zpool status
                  pool: rpool
                 state: ONLINE
                  scan: resilvered 7.37G in 34s with 0 errors on Thu Nov  8 12:34:45 2018

                config:

                        NAME        STATE     READ WRITE CKSUM
                        rpool       ONLINE       0     0     0
                          mirror-0  ONLINE       0     0     0
                            c1d0    ONLINE       0     0     0
                            c1d1    ONLINE       0     0     0

                errors: No known data errors

                root@judi-dev-01:~#

7.      Apply the boot blocks after the new disk is resilvered 
                root@judi-dev-01:~# bootadm install-bootloader

                root@judi-dev-01:~#

8.      Bring down the server to OK Prompt (OBP)
                {0} ok show-disks
                a) /reboot-memory@0
                b) /virtual-devices@100/channel-devices@200/disk@1

                c) /virtual-devices@100/channel-devices@200/disk@0

9.      Boot the server with secondary disk from OK Prompt (OBP) [Now server is booting with disk@1]
                {0} ok boot /virtual-devices@100/channel-devices@200/disk@1
                Boot device: /virtual-devices@100/channel-devices@200/disk@1  File and args:
                SunOS Release 5.11 Version 11.3 64-bit
                Copyright (c) 1983, 2018, Oracle and/or its affiliates. All rights reserved.

                Hostname: judi-dev-01

10.      Verify the bootdisk path (The server should have booted through the secondary disk disk@1)
                root@judi-dev-01:~# prtconf -vp | grep bootpath
                        bootpath:  '/virtual-devices@100/channel-devices@200/disk@1'

                root@judi-dev-01:~#

                IF YOU FACE ANY ISSUE IN BOOTING THE SERVER IN SECONDARY DISK THEN ROLL BACK THE CHANGE BY BOOTING THE SERVER WITH PRIMARY DISK
                /virtual-devices@100/channel-devices@200/disk@0

                FOLLOW THE BELOW PROCEDURE IF YOU THE SERVER BOOTS IN SECONDARY DISK WITHOUT ANY ISSUE.

11.      Check the zpool Status
                root@judi-dev-01:~# zpool status
                  pool: rpool
                 state: ONLINE
                  scan: resilvered 7.37G in 34s with 0 errors on Thu Nov  8 12:34:45 2018

                config:

                        NAME        STATE     READ WRITE CKSUM
                        rpool       ONLINE       0     0     0
                          mirror-0  ONLINE       0     0     0
                            c1d0    ONLINE       0     0     0
                            c1d1    ONLINE       0     0     0

                errors: No known data errors

                root@judi-dev-01:~#

12.      Detach the old(primary) disk c1d0 from the pool, since the server is booting without any issue from the secondary disk.
                root@judi-dev-01:~# zpool detach rpool c1d0

                root@judi-dev-01:~#

13.      Check the status of the zpool, the zpool contains only the secondary disk
                root@judi-dev-01:~# zpool status
                  pool: rpool
                 state: ONLINE
                  scan: resilvered 7.37G in 34s with 0 errors on Thu Nov  8 12:34:45 2018

                config:

                        NAME    STATE     READ WRITE CKSUM
                        rpool   ONLINE       0     0     0
                          c1d1  ONLINE       0     0     0

                errors: No known data errors

                root@judi-dev-01:~#

14.      reboot the server again to confirm the change is successful and the bootdisk path.
                root@judi-dev-01:~# prtconf -vp | grep bootpath
                        bootpath:  '/virtual-devices@100/channel-devices@200/disk@1'

                root@judi-dev-01:~#



Known Errors :  You may be getting the below error while booting the server from secondary disk.
                {0} ok boot /virtual-devices@100/channel-devices@200/disk@1
                Boot device: /virtual-devices@100/channel-devices@200/disk@1  File and args:

                ERROR: Last Trap: Fast Data Access MMU Miss

                After attaching the secondary disk you might have used the installboot command as below.
                installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/cwtxdys0
                This command is incorrect to use in this procedure, 
                
                the correct caommnd to install the bootblock is 
                bootadm install-bootloader










~Judi~


Solaris Root Mirror
zpool detach disk and boot
zpool replace disk
Replace a ZFS Root Pool
single disk root pool
solaris 11 zpool mirror
zpool mirror replace disk
zpool mirror status

zpool mirror rpool
Replace a ZFS Root Pool to another disk



Popular Posts