Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.
Resource icon

zpool output unification with converting GPTID to GEOM name

Status
Not open for further replies.

turvas

Newbie
Joined
Jul 5, 2017
Messages
2
turvas submitted a new resource:

zpool output unification with converting GPTID to GEOM name - converting GPTID to GEOM name in zpool output

if you have zpool commands with mix of GPTID and GEOM name, it's not so easy to read. Small script below will convert GPTID to GEOM name in zpool output piping:


zpool iostat -v | ./fixer.sh


Code:
#!/bin/sh
# to change GPTID to GEOM name in zpool commands by turvas@gmail.com
# usage with zpool output procssing : zpool iostat -v | ./fixer.sh
glabel status | awk '{print "s|"$1"|"$3"|g"}' > glabel-lookup.sed
sed -f glabel-lookup.sed
Read more about this resource...
 

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
16,901
if you have zpool commands with mix of GPTID and GEOM name
When is that the case?
 

turvas

Newbie
Joined
Jul 5, 2017
Messages
2
during my last few years, it's always mixed, todays output is:
Code:
# zpool iostat -v
										   capacity	 operations	bandwidth
pool									alloc   free   read  write   read  write
--------------------------------------  -----  -----  -----  -----  -----  -----
freenas-boot							1.25G  13.1G	  1	 13  29.7K  59.8K
  mirror								1.25G  13.1G	  1	 13  29.7K  59.8K
	gptid/1f1b5759-5f65-11e7-b358-90e6ba884fe9	  -	  -	  0	  2  30.3K  59.1K
	da0p2								   -	  -	  0	  2	181  88.8K
--------------------------------------  -----  -----  -----  -----  -----  -----
pool2								   4.51T  3.65T	  2	 58  22.8K   406K
  raidz1								4.51T  3.65T	  2	 58  22.8K   406K
	gptid/070d67f8-5f7d-11e7-932a-90e6ba884fe9	  -	  -	  0	  8  8.86K   248K
	gptid/26b505c3-31b3-11e6-9a77-90e6ba884fe9	  -	  -	  0	  8  8.78K   249K
	gptid/d7df3964-30ed-11e6-8da5-90e6ba884fe9	  -	  -	  0	  8  8.91K   249K
--------------------------------------  -----  -----  -----  -----  -----  -----
 

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
16,901
Are you sure the device identifiers are related to GEOM? I'm under the impression they're exclusively related to the disk interface stacks.

Still, this could be useful in some scenarios.
 

danb35

Wizened Sage
Joined
Aug 16, 2011
Messages
11,805
I'm thinking this might come in handy with the script I was trying to make work a while back...
 
Status
Not open for further replies.
Top