Operating System - HP-UX
1748028 Members
5373 Online
108757 Solutions
New Discussion юеВ

Re: lvmtab includes some unidentified characters

 
simon_164
Super Advisor

lvmtab includes some unidentified characters

my /etc/lvmtab has some unidentified characters, I have a vg00 which has one disk in it. whatever i do i still have the output of lvmtab:
/dev/vg00
DF%s
/dev/dsk/c2t1d0s2

if i try to delicatelly remove these characters using vi, it will be fine but after a vgscan i get that the lvmtab file is wrong and should be replaced.
the system came out of the box this way, how to fix this?
9 REPLIES 9
Miguel Hern├бndez
Frequent Advisor

Re: lvmtab includes some unidentified characters

lvmtab is not a text file. You can see it with strings:

sapap1:root> strings /etc/lvmtab
/dev/vg00
/dev/dsk/c0t6d0s2
/dev/dsk/c2t6d0s2
/dev/vg_EPC_D01
/dev/dsk/c13t0d1


Dont modify lvmtab!!!
spex
Honored Contributor

Re: lvmtab includes some unidentified characters

simon,

DO NOT edit /etc/lvmtab with vi. You will corrupt the file. lvmtab is a BINARY file. Those unidentifiable characters are binary data.

To edit lvmtab, use lv/pv/vg commands, such as lvcreate, lvreduce, etc.

The proper way to view the contents of lvmtab is:

# strings /etc/lvmtab

PCS
simon_164
Super Advisor

Re: lvmtab includes some unidentified characters

I was not clear enough, I am getting the unidentified characters from lvmtab using the strings command so:
strings /etc/lvmtab -->
/dev/vg00
DF%s
/dev/dsk/c2t1d0s2

what does the DF%s means, how to get rid of it.
spex
Honored Contributor

Re: lvmtab includes some unidentified characters

simon,

# man strings

The 'strings' command returns what it believes to be printable, or ASCII, strings in a file. The junk you see is just 'strings' giving you a false positive. It is just making an educated guess, after all.

You can exclude this unwanted output by increasing the minimum string length like this (just make sure you're not excluding lines you do want):

# strings -n 8 /etc/lvmtab

or with grep:

# strings /etc/lvmtab | grep -v 'DF%s'

PCS

James R. Ferguson
Acclaimed Contributor

Re: lvmtab includes some unidentified characters

Hi Simon:

As already stated, the '/etc/lvmtab' file is a binary file. The 'strings' command attempts to produce readable output by examining groups of four characters at a time.

In reality, the '/etc/lvmtab' contains not only the volume group names and their associated device files, but the LVM VGID (Volume Group ID) that uniquely identifies each volume group.

You file is *not* corrupt!

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: lvmtab includes some unidentified characters

That is ABSOLUTELY NORMAL for the /etc/lvmtab file. You DO NOT have a problem. Quit trying to fix a problem that doesn't exist.

Geoff Wild
Honored Contributor

Re: lvmtab includes some unidentified characters

Nothing wrong with that - unless you did a vi and saved it.

If so:

mv /etc/lvmtab /etc/lvmtab.bad
vgscan

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
simon_164
Super Advisor

Re: lvmtab includes some unidentified characters

Thx a lot,
Ok, i will not touch it.
However i would have liked it to be without those character :).
Torsten.
Acclaimed Contributor

Re: lvmtab includes some unidentified characters

Consider to accept the strings output or try

strings -n 6 /etc/lvmtab

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!