1834152 Members
2225 Online
110064 Solutions
New Discussion

/etc/lvmtab

 
SOLVED
Go to solution
Jim Chen
New Member

/etc/lvmtab

Hello All,
first part of the question, i can't add disk or create physical volume. "/dev/dsk/cxtxdx already recorded in /etc/lvmtab" i know i can't edit this file, anyway around it. i need to take out the disks and the volume group in this file.
second part, if i can't edit this file, how do i go about creating my pv and vg and lv. i need to add 3 disks to one vg
path /dev/dsk/c0t4d0, /dev/dsk/c0t9d0, /dev/dsk/c0t5d0.
i am researching the itrc, but can't come up with anything.
i do appreciate all your help. thanks so much!!!
6 REPLIES 6
Bill Hassell
Honored Contributor

Re: /etc/lvmtab

The command is vgexport for the problem volume group. You can see the relationships in lvmtab by using:

strings /etc/lvmtab


Bill Hassell, sysadmin
linuxfan
Honored Contributor
Solution

Re: /etc/lvmtab

Hi Jim,

If a disk is already defined in a vg, you can use "vgreduce" to reduce the disk from a vg,

eg: vg01 contains the disk /dev/dsk/c2t4d0

to remove the disk from the vg
vgreduce /dev/vg01 /dev/dsk/c2t4d0

If you want to remove the whole VG itself
vgchange -a n vg01
vgexport /dev/vg01
(Before you do this you have to make sure you unmount all the filesystems on the VG, eg:
bdf |grep vg01)

If you want to recreate the lvmtab file, you can
mv /etc/lvmtab /etc/lvmtab.nogood
vgscan -v
(this would recreate your lvmtab file)

you could also do a "strings /etc/lvmtab" to see the contents of the file

To create a new VG,lvols you can use SAM or you can do it manually

1. mkdir /dev/vg
2. ls -al /dev/*/group
(Get a minor number not being used)
3. mknod /dev/vggroup c 64 0x??????
(where 0x?????? is a unique minor number not already being used)
4. pvcreate /dev/rdsk/c0t4d0
5. pvcreate /dev/rdsk/c0t4d1
6. vgcreate /dev/vg /dev/dsk/c0t4d0
7. vgextend /dev/vg /dev/dsk/c0t4d1
8. Now you can create LVs for your filesystems
Lets say you want to create a filesystem of 2GB
9. lvcreate -L 2048 /dev/vg01
10. newfs -F vxfs /dev/vg01/rlvol1
11. you can now mount the filesystem at any mount point

mount /dev/vg01/lvol1 /mntpoint

For more information look at the man pages for (vgscan, vgcreate, vgextend, lvcreate)

Also you can take a look at the document
http://docs.hp.com/cgi-bin/onlinedocs.py?mpn=B2355-90742&service=hpux&path=../B2355-90742/00/00/48&title=Managing%20Systems%20and%20Workgroups%3A%20A%20Guide%20for%20HP-UX%20System%20Administrators

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Sanjay_6
Honored Contributor

Re: /etc/lvmtab

Hi Jim,

Do "strings /etc/lvmtab |pg" to find out which vg is associated with the PV you want to remove. Do vgreduce to remove the PV from the vg. Say you want to remove /dev/dsk/c0t4d0 from the vg called vg_test.

If you have data on the disk c0t4d0 first move the data over to other PV in the VG.
pvmove /dev/dsk/c0t4d0
This will move the existing data on c0t4d0 on other PV's in that VG where it find free space. Of course you should have that much free space on other PV's.

Then do vgreduce
vgreduce /dev/vg_test /dev/dsk/c0t4d0
now create a new PV on this disk
pvcreate -f /dev/rdsk/c0t4d0
create a new vg
mkdir /dev/new_vg
mknod /dev/vg_new/group c 64 0x0n0000
n=1,2,3,...
vgcreate /dev/vg_new /dev/dsk/c0t4d0
Add other PV's using pvcreate and vgextend.
then do lvcreate to create new LV on the newly created vg. Do newfs to create new filesystem on these LV's.

Hope this helps

Thanks

Sanjay_6
Honored Contributor

Re: /etc/lvmtab

Hi Jim,

Please check the syntax of pvmove command. You may have to mention the vg name over there. I don't remember. Answering this from home. No access to my hp box from home.

Thanks.
Bill McNAMARA_1
Honored Contributor

Re: /etc/lvmtab

You can see some discussion on the lvm command usage you're intereseted in here:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x2ca2663ce855d511abcd0090277a778c,00.html

Later,
Bill
It works for me (tm)
Jim Chen
New Member

Re: /etc/lvmtab

Thanks everybody!!!!!!!!!
works great
jim