1832535 Members
7587 Online
110043 Solutions
New Discussion

"lvextend" error

 
SOLVED
Go to solution
Noel Daniel
Advisor

"lvextend" error

I faced a problem, where I mirrored certain LVs only & rebooted the system from the mirrored disk with the original boot disk removed.. Although the system booted, I got a few errors. After that I booted off the original boot disk, & the system came up. Now when I try to mirror the other LVs in the boot disk I get the following error.

Cannot lock "/etc/lvmconf//lvm_lock" still trying ......

The file in question had no rights, I added 600, but things haven't changed.

Any help/suggestions appreciated.
7 REPLIES 7
Robert-Jan Goossens_1
Honored Contributor

Re: "lvextend" error

Hi Noel,

Check if there is an other lvm process running. (vgsync, lvsync etc.)

Regards,
Robert-Jan
Sandy Chen
Honored Contributor

Re: "lvextend" error

Hi,

When you boot a mirror disk with the original disk removed, the files will be different between both of them. Therefore when you returned things the way they are and boot them, it will automatically do a vgsync. Perhaps you could try mirror the other lv after wait a while

Regards,
Sandy
I never think of the future. It comes soon enough.
Steven E. Protter
Exalted Contributor

Re: "lvextend" error

Shalom,

I agree with the earlier analysis and suggest ou may not have done the mirror completely.

Here is a procedure for 11.11

pvcreate -B /dev/rdsk/c1t0d0 #use real disk

mkboot -l /dev/rdsk/c1t0d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c1t0d0 # use real disk


# mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?

If you are running 64-bit OS:

# mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?


vgextend /dev/vg00 /dev/dsk/c1t0d0 # same thing
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0

# real disk. repeat for other lvols

lvlnboot -r /dev/vg00/lvol3 # root fs /
lvlnboot -s /dev/vg00/lvol2 #swap
lvlnboot -d /dev/vg00/lvol2 #swap/dump
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
setboot
setboot -a 52.1.0 # second disk

I suggest you reboot and start over.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sundar_7
Honored Contributor

Re: "lvextend" error

Noel,

That file should NOT be there for the things to change :-).

lvm_lock may have been left by an LVM command that didnt terminate normally.

First, make sure there are no LVM commands running.

# ps -ef | egrep -i "lv|pv|vg" | grep -v grep

If you dont see anything, remove the lock file /etc/lvmconf/lvm_conf file and try the mirroring again. But, note that you can only mirror LVs one by one serially. You cannot have multiple sessions running that are trying to mirror different LVs at the same time.

Sundar.

Learn What to do ,How to do and more importantly When to do ?
Sandman!
Honored Contributor

Re: "lvextend" error

Mridul Shrivastava
Honored Contributor
Solution

Re: "lvextend" error

When the lvm commands run and need to access the lvmtab file there need to be a mechanism so that they do not update/access the file when it is being updated/accessed by other lvm commands. This is the purpose of the lvm_lock file. If you get the message Cannot lock "/etc/lvmconf//lvm_lock" still trying ... this indicates the system has attempted to lock the lvm_lock file 5 times using lockf() and failed since another command already has it locked. Every 10 attempts the command sleeps for 1 second before trying again. So, this message indicates another lvm command is running and has the lvm_lock file locked.

By deleting the lvm_lock file you could have one lvm command update or access the lvmtab file while another command is already doing this. This could cause the system to behave incorrectly or even corrupt the lvmtab file or worst case cause it to be lost completely.

Sometimes it might be necessary to delete the lvm_lock file to release the lvmtab file for lvm commands. If the process holding the lvm_lock can be killed gracefully it should remove the lock. A reboot may be needed afterward to free the lvmtab file. Afterward the lvm command should work fine.
Time has a wonderful way of weeding out the trivial
Noel Daniel
Advisor

Re: "lvextend" error

Yes, I think the disks were trying to synchronize. Your advice was was very useful.

Sorry for the late response, but I was away from Office.