1838694 Members
5260 Online
110128 Solutions
New Discussion

Re: sorting lvols

 
SOLVED
Go to solution
Nick D'Angelo
Super Advisor

sorting lvols

Admins - I am sure this is an easy one for as I know I have seen it somewhere already, but for the life of me, I can not find it again.

I would like to sort my vg00/lvol1-9 and my vg02 lvol1-4 so that they appear in order when I do a bdf.

Suggestions?
Always learning
11 REPLIES 11
A. Clay Stephenson
Acclaimed Contributor

Re: sorting lvols

Hi:

How about:

bdf | grep -v "Filesystem" | sort
If it ain't broke, I can fix that.
Sanjay_6
Honored Contributor

Re: sorting lvols

Hi Nick,

Try,

bdf |sort

Hope this helps.

Regds
Sridhar Bhaskarla
Honored Contributor

Re: sorting lvols

How about

bdf |grep -e "vg00" |grep -e "vg02" |sort ?

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: sorting lvols

How about

bdf |grep -e "vg00" -e "vg02" |sort ?

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Deshpande Prashant
Honored Contributor

Re: sorting lvols

Hi
Try
#bdf |sort -k 1

Thanks.
Prashant.
Take it as it comes.
Craig Rants
Honored Contributor

Re: sorting lvols

To add to all the info sort -n will put all your information in the numerical order you probably want.

Good Luck,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Nick D'Angelo
Super Advisor

Re: sorting lvols

Hmm, maybe I didn't quite word it right.

I wanted them sorted permanently so that anytime I do a bdf it shows it order. I thought there was a vgdisplay command to do this, but perhaps I am mistaken.

Nickd
Always learning
Roger Baptiste
Honored Contributor
Solution

Re: sorting lvols

Nick

You set an alias for the bdf command to get the output you want.
for eg:
#alias bdf="bdf |sort"
>bdf
/dev/vg00/fs_crash 716800 49454 625708 7% /var/adm/crash
/dev/vg00/fs_emc 262144 73970 176459 30% /opt/emc
/dev/vg00/fs_localadm
/dev/vg00/fs_omni 524288 44404 449939 9% /opt/omni
/dev/vg00/fs_oracle
/dev/vg00/fs_perf 262144 75715 174835 30% /var/opt/perf
/dev/vg00/fs_prod 53248 1117 48880 2% /prod
/dev/vg00/fs_sw 614400 573285 38549 94% /var/adm/sw
/dev/vg00/lvol1 127573 40775 74040 36% /stand
/dev/vg00/lvol3 262144 42928 206178 17% /
/dev/vg00/lvol4 524288 406477 110475 79% /opt
/dev/vg00/lvol5 131072 11736 111918 9% /tmp
/dev/vg00/lvol6 1122304 531264 554143 49% /usr
/dev/vg00/lvol7 524288 151848 349924 30% /var
/dev/vg00/lvol8 262144 8952 237397 4% /home

-raj
Take it easy.
Nick D'Angelo
Super Advisor

Re: sorting lvols

Thanks everyone for your replies - points to everyone.

The last suggestion was by far the simplest

bdf|sort

Cheers.
Always learning
fg_1
Trusted Contributor

Re: sorting lvols

Nick

Hope you don't mind one more suggestion:

I always edit the /etc/mnttab file to show the order that I want things to appear. Makes life easier for consistency across the board since I always set the vg00 group to be the first one's read. Give it a try on a sandbox if you have one.

Hope this helps.
Nick D'Angelo
Super Advisor

Re: sorting lvols

Another great suggestion.

Many thanks, consider the issue closed.

Thanks to all.
Always learning