2
I am trying to check disks used for mirror in lvs. currently I am using "lslv -m ulv" command but to check for multiple lvs is difficult. I guess there should be some option in grep to exclude repetition of word, because if I will grep "disk" it will show a number of rows.
Sorry, but It did not work.
lslv -m salvaglv | grep hdisk0 | uniq
. it should give only one row with hdisk0. but insted it gave me same output aslslv -m salvaglv | grep hdisk0
. – Hemant – 2012-10-03T08:43:16.027Ok. Please try to use
sort -u
instead ofuniq
. Also if you could show us the output oflslv -m salvaglv | grep hdisk0
it could shed some light on by which columns you should sort. – mnmnc – 2012-10-03T08:55:50.813hemantr:stelsvr> lslv -m salvaglv | grep hdisk0 0001 0201 hdisk0 0002 0202 hdisk0 0003 0203 hdisk0 0004 0204 hdisk0 0005 0205 hdisk0 0006 0206 hdisk0 0007 0207 hdisk0 0008 0208 hdisk0 0009 0209 hdisk0 0010 0210 hdisk0 0011 0211 hdisk0 0012 0212 hdisk0 /u/hemantr
hemantr:stelsvr> lslv -m salvaglv | grep hdisk0 | sort -u 0001 0201 hdisk0 0002 0202 hdisk0 0003 0203 hdisk0 0004 0204 hdisk0 0005 0205 hdisk0 0006 0206 hdisk0 0007 0207 hdisk0 0008 0208 hdisk0 0009 0209 hdisk0 0010 0210 hdisk0 0011 0211 hdisk0 0012 0212 hdisk0 /u/hemantr hemantr:stelsvr> – Hemant – 2012-10-03T12:32:18.170
i've updated my answer. I assume you do not need the information from first two columns if you want to see only one entry for hdisk0. – mnmnc – 2012-10-03T12:56:29.703