• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Solaris Volume Manager (SVM) : Growing mirrored metadevices online

by admin

Solaris Volume Manager (SVM) : Growing RAID 5 metadevices online
Solaris Volume Manager (SVM) : Growing concat metadevice

The example shown below uses metadevice d3, which is a 33Gb mirror with a mounted file system. The high level steps to grow the mirrored metadevice d3 includes :

1. Attaching 2 more sub-mirrors (bigger ones – d32 and d33) to the parent metadevice d3.
2. Detaching the older sub-mirrors d30 and d31 after sync.
3. Growing the parent metadevice d3 to reflect new size.
4. Growing the file system.

Attaching 2 new sub-mirrors (bigger size)

The parent metadevice d3 is of size 33 GB with 2 sub-mirrors d30 and d31.

# metastat d3
   d3: Mirror
       Submirror 0: d30
         State: Okay
       Submirror 1: d31
         State: Okay
       Pass: 1
       Read option: roundrobin (default)
       Write option: parallel (default)
       Size: 70574080 blocks (33 GB)

   d30: Submirror of d3
       State: Okay
       Size: 70574080 blocks (33 GB)
       Stripe 0:
           Device     Start Block  Dbase        State Reloc Hot Spare
           c3t0d0s0          0     No            Okay   Yes

   d31: Submirror of d3
       State: Okay
       Size: 70574080 blocks (33 GB)
       Stripe 0:
           Device     Start Block  Dbase        State Reloc Hot Spare
           c3t0d1s0          0     No            Okay   Yes

To grow the metadevice, we will be adding 2 more large submirrors d32, d33 (from disks c4t0d0 and c4t0d1), making it a 4 way mirror, sync it and then remove the original 2 submirrors.

4 way mirror SVM

# metainit d32 1 1 c4t0d0s0
# metainit d33 1 1 c4t0d1s0
# metattach d3 d32
# metattach d3 d33

Now we have a 4-way mirror :

# metastat d3
   d3: Mirror
       Submirror 0: d30
         State: Okay
       Submirror 1: d31
         State: Okay
       Submirror 2: d32
         State: Okay
       Submirror 3: d33
         State: Okay
       Pass: 1
       Read option: roundrobin (default)
       Write option: parallel (default)
       Size: 70574080 blocks (33 GB)

   d30: Submirror of d3
       State: Okay
       Size: 70574080 blocks (33 GB)
       Stripe 0:
           Device     Start Block  Dbase        State Reloc Hot Spare
           c3t0d0s0          0     No            Okay   Yes

   d31: Submirror of d3
       State: Okay
       Size: 70574080 blocks (33 GB)
       Stripe 0:
           Device     Start Block  Dbase        State Reloc Hot Spare
           c3t0d1s0          0     No            Okay   Yes

   d32: Submirror of d3
       State: Okay
       Size: 141148160 blocks (67 GB)
       Stripe 0:
           Device     Start Block  Dbase        State Reloc Hot Spare
           c4t0d0s0          0     No            Okay   Yes

   d33: Submirror of d3
       State: Okay
       Size: 141148160 blocks (67 GB)
       Stripe 0:
           Device     Start Block  Dbase        State Reloc Hot Spare
           c4t0d1s0          0     No            Okay   Yes

Detaching the older sub-mirrors

We would let the new sub-mirrors to sync up and then detach the original submirrors d30 and d31.

SVM 4 way mirror new

 

# metadetach d3 d30
   d3: submirror d30 is detached
# metadetach d3 d31
   d3: submirror d31 is detached
This leaves you with a two way mirror where each sub-mirror is twice the size, but the parent mirror is still the original size. Because of this, you can not use growfs to utilize the new space. Note carefully how the sub-mirrors are different sizes to the parent mirror.
# metastat d3
   d3: Mirror
       Submirror 2: d32
    State: Okay 
    Submirror 3: d33
    State: Okay 
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
       Size: 70574080 blocks (33 GB)

    d32: Submirror of d3
       State: Okay 
       Size: 141148160 blocks (67 GB)
       Stripe 0:
    Device Start Block Dbase State Reloc Hot Spare
    c4t0d2s0 0 No Okay Yes 


   d33: Submirror of d3
    State: Okay 
    Size: 141148160 blocks (67 GB)
    Stripe 0:
    Device Start Block Dbase State Reloc Hot Spare
    c4t0d1s0 0 No Okay Yes

The key step is to use “metattach mirror”. This tells the parent mirror to grow to the size of its smallest current sub-mirror.

# metattach d3

Notice how the parent size has changed.

# metastat d3
   d3: Mirror
    Submirror 2: d32
    State: Okay 
    Submirror 3: d33
    State: Okay 
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 141148160 blocks (67 GB)

   d32: Submirror of d3
    State: Okay 
    Size: 141148160 blocks (67 GB)
    Stripe 0:
    Device Start Block Dbase State Reloc Hot Spare
    c3t0d2s0 0 No Okay Yes 


   d33: Submirror of d3
    State: Okay 
    Size: 141148160 blocks (67 GB)
    Stripe 0:
    Device Start Block Dbase State Reloc Hot Spare
    c3t0d3s0 0 No Okay Yes

Growing the file system

You can now use growfs to make the new space available to the file system.

# growfs -M /d3 /dev/md/rdsk/d3
/dev/md/rdsk/d3: 141148160 sectors in 68920 cylinders of 64 tracks, 32 sectors
68920.0MB in 1407 cyl groups (49 c/g, 49.00MB/g, 6144 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 100416, 200800, 301184, 401568, 501952, 602336, 702720, 803104, 903488, 140595008, 
140695392, 140795776, 140896160, 140996544, 141096928,

Verify the new size of the file system :

# df -k /d3
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d3 69470954 34730557 34393047 51% /d3
Solaris Volume Manager (SVM) : Growing RAID 5 metadevices online
Solaris Volume Manager (SVM) : Growing concat metadevice

Filed Under: SVM

Some more articles you might also be interested in …

  1. Solaris : How to run savecore manually while booted in single user from CDROM
  2. Solaris Volume Manager (SVM) : Growing concat metadevice
  3. Solaris Volume Manager (SVM) : Understanding metadb Flags
  4. How to replace failed root disk under Solaris Volume Manager (SVM)
  5. The ultimate Solaris Volume Manager (SVM) interview questions
  6. Solaris Volume Manager (SVM) : Growing RAID 5 metadevices online
  7. SVM : How to Use Metadevadm to Maintain Device Relocation Information After Disk Replacement
  8. SVM : How to un-encapsulate root disk (SPARC)
  9. Solaris 10 patching with SVM : Traditional method (non-live upgrade)
  10. How to add Additional Storage Space Created from Dynamic LUN Expansion in SVM online

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright