Sunday, 29 December 2019

Expand zpool online Solaris

Expand zpool online Solaris

09 Aug
I have Solaris 11.1 runnning on SPARC T4-2, connected to SAN using powerpath. I want to expand an existing zpool without any downtime and loss of data. Below is what I did to achieve it.
1. Check the zpool details.
root@falcon-db:~# zpool list datapool
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
datapool 9.94G 126K 9.94G 0% 1.00x ONLINE –
root@falcon-db:~#
2. Expand the LUN from storage side.
3. Run cfgadm -al and format. Select the expanded disk.(check cylinder size before expanding)
97. emcpower8a <DGC-VRAID-0532 cyl 32766 alt 2 hd 64 sec 10>
/pseudo/emcp@8
Specify disk (enter its number): 97
selecting emcpower8a
[disk formatted]
Note: detected additional allowable expansion storage space that can be
added to current SMI label’s computed capacity.
Select to adjust the label capacity.
4. Select expand option and select the slice mounted to expand.
partition> e
Expansion of label cannot be undone; continue (y/n) ? y
The expanded capacity was added to the disk label and “s2”.
Disk label was written to disk.
partition> 0
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 – 32765 10.00GB (32766/0/0) 20970240
Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]:
Enter partition size[20970240b, 32766c, 32765e, 10239.38mb, 10.00gb]: $
partition> p
Current partition table (unnamed):
Total disk cylinders available: 39319 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 – 39318 12.00GB (39319/0/0) 25164160
1 unassigned wu 0 0 (0/0/0) 0
2 backup wu 0 – 39318 12.00GB (39319/0/0) 25164160
partition> l
Ready to label disk, continue? y
partition>
Cylinder size after expansion of disk
97. emcpower8a <DGC-VRAID-0532 cyl 39319 alt 2 hd 64 sec 10>
/pseudo/emcp@8
5. Set the autoexpand option to on and the pool is expanded to new size.
root@falcon-db:~# zpool list datapool
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
datapool 9.94G 89.5K 9.94G 0% 1.00x ONLINE –
root@falcon-db:~#
root@falcon-db:~# zpool get autoexpand datapool
NAME PROPERTY VALUE SOURCE
datapool autoexpand off local
root@falcon-db:~# zpool set autoexpand=on datapool
root@falcon-db:~#
root@falcon-db:~#
root@falcon-db:~# zpool list datapool
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
datapool 11.9G 136K 11.9G 0% 1.00x ONLINE –
root@falcon-db:~#

No comments:

Post a Comment