Operating System - HP-UX
1748027 Members
4982 Online
108757 Solutions
New Discussion юеВ

Re: bdf output not in sequence

 
M.P.Chandrasekar
Occasional Advisor

bdf output not in sequence

usually if i execute bdf command it will give the result in sequence order but then we had a problem like disk21 and disk22 mounted on a vg11 was not detected for some reason, then we determined that disk21 and disk22 went bad, so we replaced with new disks and then it got detected, but it got detected at the bottom, actually we have 33 disks, i mean disk1, disk2 disk3........ disk in sequence order, but very recently if i execute bdf its not in sequence order, which gives the output as disk5, disk3 disk11, disk33, disk27......
so i want in sequence order either is ascending or descending order. help me in fixing this
10 REPLIES 10
Patrick Wallek
Honored Contributor

Re: bdf output not in sequence

'bdf' generally gives the output in the order the LV's were mounted.

If you want it in order you pipe the bdf output to sort.

The other option is to search for Bill Hassell's 'bdfmegs' script. This has options for sorting, totaling, etc.

Pete Randall
Outstanding Contributor

Re: bdf output not in sequence

I suspect that they are shown in the order in which they are mounted. Correct your /etc/fstab and then either reboot or "umount -a", "mount -a".


Pete

Pete
Patrick Wallek
Honored Contributor

Re: bdf output not in sequence

The latest version of 'bdfmegs' is availalbe here:

http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1394638

M.P.Chandrasekar
Occasional Advisor

Re: bdf output not in sequence

i have checked with the folowing comands strings /etc/lvmtab and strings /etc/fstab and both shows in sequential order only, there was no prob for about 1 year but only for the past 2 days it has this problem
Pete Randall
Outstanding Contributor

Re: bdf output not in sequence

Then do as Patrick suggested and use bdfmegs or sort it yourself.


Pete

Pete

Re: bdf output not in sequence

the only reason you never saw a problem before is probably cos you never unmounted a filesystem before - AFAIK the only order that bdf sticks to is the order the filesystems were mounted in. This will usually match what you see in /etc/fstab, but if for example I unmount and then re-mount a filesystem then it will move to the end of the bdf output. There's no way to "fix" that, because it is correct behaviour for bdf. As already indicated consider sorting your output using sort or try Bill H's bdfmegs

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Bill Hassell
Honored Contributor

Re: bdf output not in sequence

> there was no prob for about 1 year but only for the past 2 days it has this problem

That is because you interfered with the order of the disks by replacing them. This is completely normal. The bdf order is unimportant to HP-UX -- your system is running normally.

> so i want in sequence order either is ascending or descending order

As mentioned, use the (attached) script:

bdfmegs -c1
(sorts by logical volume)

bdfmegs -c6
(sorts by mountpoint)

This is purely cosmetic (which is why bdfmegs was created)

> help me in fixing this

reboot


Bill Hassell, sysadmin
M.P.Chandrasekar
Occasional Advisor

Re: bdf output not in sequence

hey sorry guys, i was not well for couple of weeks and so i was unable to chk this, so some of u say that there is no harm if the disks are not in order right? ok fine then. but y it happened all of a sudden? except me and one more staff no one takes care of this and so we both wonder how the disks r not inorder all of a sudden, any reasons?
James R. Ferguson
Acclaimed Contributor

Re: bdf output not in sequence

Hi:

> so we both wonder how the disks r not inorder all of a sudden, any reasons?

As Duncan said, if you unmount and re-mount a filesystem you will see it move to the end of the list.

If you examine '/etc/mnttab' you can see that actual mount time for each filesystem. For example, the first line of 'mnttab' on one of my servers looks like:

/dev/vg00/lvol3 / vxfs ioerror=mwdisable,largefiles,delaylog,dev=40000003 0 1 1267655762

The last field is the mount time in Epoch seconds. In this case:

# perl -le 'print scalar localtime(1267655762)'
Wed Mar 3 17:36:02 2010

Regards!

...JRF...