1754334 Members
2684 Online
108813 Solutions
New Discussion юеВ

LVMTAB junk charater??

 
Kanagaraj
Regular Advisor

LVMTAB junk charater??

Hi all,

I am getting lvmtab output junk.

I have pasted here.
# strings /etc/lvmtab
/dev/vg00
?dWE ---->Junk charater
/dev/dsk/c2t1d0s2

OS version--B.11.23 v2
Model --rx4640

At the same time I am listing another server lvmtab file,that is OK.
# strings /etc/lvmtab
/dev/vg00
/dev/dsk/c0t2d0s2
/dev/vg01
/dev/dsk/c0t3d0
/dev/dsk/c0t4d0
/dev/dsk/c0t5d0
/dev/dsk/c0t6d0
/dev/dsk/c0t7d0
/dev/dsk/c0t8d0

Server model---Vpar
OS version-- 11.23 v2

If any one get this type junk?? let me know. realy it has meaning? (vgid???)

Thanks in advance.



7 REPLIES 7
Kanagaraj
Regular Advisor

Re: LVMTAB junk charater??

I got partial answer from this forum.

http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1030478&admit=109447627+1259338590111+28353475


Let me know if you have valid reason this junk.

Thanks.
R.K. #
Honored Contributor

Re: LVMTAB junk charater??

Hi Kanagraj,

Lvmtab file is not an ascii file thus not readable by using cat or vi and hence we use "strings" to view contents of this file.

It has a lot of junk characters but when four readable character comes straight in a row, strings reads them and shows them in output.

So this (junk chars) are absolutely normal.

Regds..
Don't fix what ain't broke
Torsten.
Acclaimed Contributor

Re: LVMTAB junk charater??

Often discussed here and totally normal.

man strings

It is an binary file!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Bill Hassell
Honored Contributor

Re: LVMTAB junk charater??

lvmtab is a binary file which means that there will be characters that are not meaningful without decoding their meaning. The best way to view the strings output from any binary file is to use cat -tv like this:

strings /etc/lvmtab | cat -tv

However, is the core of the LVM display commands so everything you need to see is available from vgdisplay, lvdisplay and pvdisplay. To see the same output from lvmtab without the binary junk, use this command:

vgdisplay -v | awk '/VG Name/{print $3}; /PV Name/{print $3}'

Or to see the VG, LV and PV, just use this:

vgdisplay -v | awk '/Name/{print $3}'
or
vgdisplay -v|awk '/VG Name/; /LV Name/; /PV Name/'

lvmtab was never designed to be used for text applications -- use vgdisplay.


Bill Hassell, sysadmin
Raj D.
Honored Contributor

Re: LVMTAB junk charater??

D.Kanagaraj ,

This is very normal, lvmtab is a binary file and to be viewed with strings command. However the junk remains sometime.
To get the details of vg and disks you can use vgdisplay -v ,

Also if you still want to use lvmtab for vg and disk detais, you can grep:

# To get vg details:
# strings /etc/lvmtab | grep dev


# To get disk details:
# strings /etc/lvmtab | grep dsk


or
# both:
# strings /etc/lvmtab | grep -i -e dsk -e dev




Or to get ACTIVE vgs you can use something like this:

###lsvg hp-ux:
lsvg()
{
#!/bin/ksh

for VG in $(strings /etc/lvmtab | grep -v /dsk | grep dev | sort); do
printf "%-32s" "$VG"
vgdisplay $VG > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "ACTIVE"
else
echo "NOT ACTIVE"
fi
done
}
lsvg


Hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Kanagaraj
Regular Advisor

Re: LVMTAB junk charater??

Hi,

I did not ask about to use of lvmtab file and I used to see all vg/lv information from vgdisplay only..


for fast understanding of vgs and disk added into a vg for that we used see lvmtab file.

Thanks to all for reply.
Kanagaraj
Regular Advisor

Re: LVMTAB junk charater??

I am closing this forum