Popular Posts

Showing posts with label zfs. Show all posts
Showing posts with label zfs. Show all posts

Nov 1, 2019

create zpool on existing directory with data

Create zpool on existing directory with data

APPLIES TO :  Oracle SPARC Solaris

ISSUE :  A directory contains a huge amount of data, due to disk space constrain we need to convert that data into zfs volume. The challenge is how to retain the file ownership, permission, and soft/hard links

GOAL :  Create a zfs volume and move the local data with exact permission, ownership.

SOLUTION :  There isn't a built-in or automated way to create a new DataSet and migrate existing data to it. To get it done you'll need to create the dataset and manually (e.g. rsync) the data to it.

Prerequisites :   NIL

               1. Move the data directory into a new name.
                       root@JUDI-DEV-10:/root # mv /oracle /oracle_org

               2. Create a zpool volume with a the new disk
                       root@JUDI-DEV-10:/root # zpool create -f -m /oracle oracle c1d1

               3. Copy the data to the zfs volume using the rsync command
                       root@JUDI-DEV-10:/root # rsync -aAX /oracle_org/ /oracle

               4. Verify the permission and ownership once the copy completed
                       root@JUDI-DEV-10:/root # ls -rlt


create zpool with existing data directory
create zpool and sync with existing directory
zfs create dataset from existing directory
create zpool on existing directory with data
Proper way to create a zfs off an existing directory
ZFS: adding filesystem over existing directory
create ZFS dataset over existing data
converting existing directory to zfs dataset

Zfs create dataset from existing directory

Oct 13, 2019

solaris zpool zfs upgrade

Upgrading ZFS Storage Pools in Solaris 11.4

APPLIES TO :  Oracle SPARC Solaris

ISSUE :  The pool is formatted using an older on-disk format. The pool can still be used, but some features are unavailable.

GOAL :  Upgrading ZFS Storage Pools in Solaris 11.4

SOLUTION :  Upgrade the zpool to latest version to avail all the features.

Prerequisites :   

               1. Check the zpool status to find the version.
                       root@JUDI-DEV-10:/root# zpool status
                         pool: rpool
                       state: ONLINE
                       status: The pool is formatted using an older on-disk format. The pool can
                               still be used, but some features are unavailable.
                       action: Upgrade the pool using 'zpool upgrade'. Once this is done, the
                               pool will no longer be accessible on older software versions.
                       config:
                               NAME                       STATE      READ WRITE CKSUM
                               rpool                      ONLINE        0     0     0
                                 mirror-0                 ONLINE        0     0     0
                                   c0t6000CCA02A507030d0  ONLINE        0     0     0
                                   c0t6000CCA02A507984d0  ONLINE        0     0     0
                       errors: No known data errors
                       root@JUDI-DEV-10:/root# 

               2. Check the servers zpool software installed version and zpool volume is configured in which version.
                       root@JUDI-DEV-10:/root# zpool upgrade
                       This system is currently running ZFS pool version 45.

                       The following pools are out of date, and can be upgraded.  After being
                       upgraded, these pools will no longer be accessible by older software versions.

                       VER  POOL
                       ---  ------------
                       44   rpool

                       Use 'zpool upgrade -v' for a list of available versions and their associated features.
                       root@JUDI-DEV-10:/root#

                      The Installed version of zpool version in OS is 45, The rpool volume is with version 44

               3. List of available versions and their associated features..
                       root@JUDI-DEV-10:/root# zpool upgrade -v
                       This system is currently running ZFS pool version 45.
                       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
                       11  Improved scrub performance
                       12  Snapshot properties
                       13  snapused property
                       14  passthrough-x aclinherit
                       15  user/group space accounting
                       16  stmf property support
                       17  Triple-parity RAID-Z
                       18  Snapshot user holds
                       19  Log device removal
                       20  Compression using zle (zero-length encoding)
                       21  Deduplication
                       22  Received properties
                       23  Slim ZIL
                       24  System attributes
                       25  Improved scrub stats
                       26  Improved snapshot deletion performance
                       27  Improved snapshot creation performance
                       28  Multiple vdev replacements
                       29  RAID-Z/mirror hybrid allocator
                       30  Encryption
                       31  Improved 'zfs list' performance
                       32  One MB blocksize
                       33  Improved share support
                       34  Sharing with inheritance
                       35  Sequential resilver
                       36  Efficient log block allocation
                       37  LZ4 compression
                       38  Xcopy with encryption
                       39  Resilver restart enhancements
                       40  New deduplication support
                       41  Asynchronous dataset destroy
                       42  Reguid: ability to change the pool guid
                       43  RAID-Z improvements and cloud device support
                       44  Device removal
                       45  Lazy deadlists
                       For more information on a particular version, including supported releases, see the ZFS Administration Guide.
                       root@JUDI-DEV-10:/root# 

               4. Upgrade the zpool version from 44 to 45 (The latest zpool version)
                       root@JUDI-DEV-10:/root# zpool upgrade rpool
                       This system is currently running ZFS pool version 45.
                       Successfully upgraded 'rpool' from version 44 to version 45
                       root@JUDI-DEV-10:/root#

               5. Check the status of zpool version 
                       root@JUDI-DEV-10:/root# zpool upgrade
                       This system is currently running ZFS pool version 45.
                       All pools are formatted using this version.

                       root@JUDI-DEV-10:/root#







~Judi~










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