Operating System - HP-UX
1827784 Members
2542 Online
109969 Solutions
New Discussion

Re: LVreduce error HELP!!!!

 
SOLVED
Go to solution
Babs_1
Frequent Advisor

LVreduce error HELP!!!!

I am running HPUX 11, with online JFS, I have done an lvreduce without doing fsadm..
I thought I was reducing the 13gb drive by 2 gb to 11gb. I have actually reduced it by 11gb to 2gb ARRGGHHH!!!! It was full of Oracle dbases I have not done anything else i.e. fsadm or give any other lvol the space..please tell me there is away to save me.....all the data is still there....help!!!
57 REPLIES 57
Frederic Sevestre
Honored Contributor

Re: LVreduce error HELP!!!!

Hi,

I am afraid you lost your data. I hope you made a back up before reducing the lvol.

Fr??d??ric
Crime doesn't pay...does that mean that my job is a crime ?
Babs_1
Frequent Advisor

Re: LVreduce error HELP!!!!

Please say it isnt so!!!!
Surely there is some file that can be edited somewhere that can save me???
Pete Randall
Outstanding Contributor

Re: LVreduce error HELP!!!!

Since this is used for Oracle databases, is it a raw logical volume? If it's a file system you're done for, but if it's a raw logical volume you might try doing a lvextend back to the original size and see what you've got. The data shouldn't be touched, you just need to straighten out the LVM structures.

Pete

Pete
John Palmer
Honored Contributor
Solution

Re: LVreduce error HELP!!!!

If you know exactly where the lvol used to reside on disk and can lvextend it back EXACTLY as it was then the data might be OK.

If the filesystem is still mounted then you may have problems unmounting it.

I'd suggest...

Unmount the filesystem, you'll probably have to force kill any processes using it.

Extend it back exactly as it was before you reduced it. If it wasn't in a contiguous area and you don't have an extent map then you're stuffed.

Do a full fsck of the filesystem, if that's OK, mount the filesystem. Oracle have a utility to check that datafiles are not corrupt (can't remember what it's called though), identify that and try running it against each datafile.

Regards,
John
Babs_1
Frequent Advisor

Re: LVreduce error HELP!!!!

Hi John,
Thanks for giving me the glimmer of hope (even if it fails) I was able to unmount the lvol no problem. It was not in a contiguous area as I think it spanned two disks. However there was very little space om the system which is why I was doing this in the first place. So in theory if I give it back the space it should go back to where it was? Or am I just wishful thinking?
John Palmer
Honored Contributor

Re: LVreduce error HELP!!!!

The problem is restoring the volume to exactly the same as it was before you lvreduced it.

One possibility is to run vgcfgrestore to restore the VG configuration BEFORE you did the lvreduce. That'll mean using /etc/lvmconf/vg??.old because /etc/lvmconf/vg?? will have your lvreduce changes applied. It's got to be worth a try...

Regards,
John
Babs_1
Frequent Advisor

Re: LVreduce error HELP!!!!

Thanks for the reply John, I am not sure what vgcfgrestore is? How do I do it? Do I just rename the vg00.conf.old to vg00.conf Thanks again for your help :)
James R. Ferguson
Acclaimed Contributor

Re: LVreduce error HELP!!!!

Hi:

# vgcfgrestore -f /etc/lvmconf/vgNN.conf.old /dev/rdsk/cXtYdZ

As John suggested, use the ".old" configuration file since this would/should be the configuration *before* your 'lvreduce' occured. Have a look at the man pages for 'vgcfgrestore' for more information.

Regards!

...JRF...
John Palmer
Honored Contributor

Re: LVreduce error HELP!!!!

vgcfgrestore is a tool for restoring LVM information to a disk.

In your case you need to restore the information to ALL the disks in your volume group. You should check the files in /etc/lvmconf to ensure that the vg??.old file is the correct one. They are created by vgcfgbackup and all LVM commands that change the configuration call vgcfgbackup automatically. If you've run lvreduce more than once for instance then you'd have to restore the correct vg??.conf from a backup.

If there are other lvols in your VG then it would be worth backing them up before trying the following...

1. Determine which disks are in ypur VG..
vgdisplay -v vg??|grep "PV Name"
2. Unmount all filesystems and deactivate your vg...
vgchange -n vg??
3. vgcfgrestore each and every disk in your VG with the .old config file...
vgcfgrestore -n vg?? -f /etc/lvmconf/vg??.old /dev/dsk/c?t?d?

Your VG should now be restored to the configuration before you did lvreduce so you can reactivate your VG with vgchange -a y vg?? then run fsck and remount the filesystems.

Regards,
John
Babs_1
Frequent Advisor

Re: LVreduce error HELP!!!!

Hi again,
I have been looking at the man pages for vgcfgrestore and your responses and it sounds like it should work and undo my mistake......but if it doesnt....my whole system could be messed up...what a lovely choice to have to make :(

1. Determine which disks are in ypur VG..
vgdisplay -v vg??|grep "PV Name"

I have two disks in one volume group vg00 when i enter the commands vgdisplay..for the first one I get this
PV Name /dev/dsk/c1t2d0
PV Name /dev/dsk/c1t2d0

and for the second one I get this
PV Name /dev/dsk/c2t2d0

Next
2. Unmount all filesystems and deactivate your vg...
vgchange -n vg??
Ok I have never done this before but I will now,
Next
3. vgcfgrestore each and every disk in your VG with the .old config file...
vgcfgrestore -n vg?? -f /etc/lvmconf/vg??.old /dev/dsk/c?t?d?

So I identify my two disks, unmount and deactivate all of my vg and then run vgcfgrestore....

Arrgghhh I am scared!!!

Then reactivate my VG with vgchange -a y vg?? then run fsck and remount the filesystems.

Have I got it?

I really appreciate this and I apologise if I am making you hold my hand doing this but as you can imagine the last thing I want to do is make a bad situation worse!!
Thanks so much for all the help :)
Pete Randall
Outstanding Contributor

Re: LVreduce error HELP!!!!

Quote:
"I have two disks in one volume group vg00 when i enter the commands vgdisplay..for the first one I get this
PV Name /dev/dsk/c1t2d0
PV Name /dev/dsk/c1t2d0 "


Whatever you do, don't mess with vg00. That's your root VG where the OS resides. You should be trying to recover the other VG.

Pete

Pete
Babs_1
Frequent Advisor

Re: LVreduce error HELP!!!!

Whatever you do, don't mess with vg00. That's your root VG where the OS resides. You should be trying to recover the other VG.

I dont understand you? I have only one volume group vg00? I have two disks/physical volumes in this one volume group I know thats probably not good planning etc. but thats the way it is? And I am stuck with it for now.
So what do you mean that I should try to recover the other volume group?
John Palmer
Honored Contributor

Re: LVreduce error HELP!!!!

Aargh it's vg00! This means that you can't deactivate it with the system running.

Provided you are sure that the one lvreduce command is all that you've done then you should still be OK but you should be consifering doing this in LVM maintenance mode...

reboot
interrupt the boot processs
bo PRI
reply y to interact with ISL?
hpux -lm

When you get the shell prompt, only / will be mounted and vg00 will not be activated. You'll be able to do your two vgcfgrestore commands then reboot...
vgcfgrestore -n vg00 -f /etc/lvmconf/vg00.conf.old /dev/dsk/c1t2d0
vgcfgrestore -n vg00 -f /etc/lvmconf/vg00.conf.old /dev/dsk/c2t2d0
reboot

Regards,
John
Pete Randall
Outstanding Contributor

Re: LVreduce error HELP!!!!

I think everyone has been assuming throughout this discussion that your VG's were separate. You can't very well deactivate vg00. You can try the vgcfgrestore with deactivating first.

Pete

Pete
Pete Randall
Outstanding Contributor

Re: LVreduce error HELP!!!!

Sorry - meant to say "withOUT deactivating first" - but I like John's LVM maintenance mode idea better anyway.

Pete

Pete
Babs_1
Frequent Advisor

Re: LVreduce error HELP!!!!

Somebody please kill me :(

I can only acess this machine through telnet etc. I dont have a unix monitor...oh this is getting messy...
I do have the SWC can I interupt the boot process from there? If I reboot, while logged into the SWC in theroy I should be able to see it coming back up, where do I interupt and how? Is it cntrl C??
Thanks you so much for bearing with me :)
Pete Randall
Outstanding Contributor

Re: LVreduce error HELP!!!!

In this case, I would try the vgcfgrestore without deactivating - it's not an absolute requirement.

Pete

Pete
S.K. Chan
Honored Contributor

Re: LVreduce error HELP!!!!

From the SWC you can use GSP to reboot the machine ..enter CTRL-B to get to GSP and in GSP prompt ..enter RS to reset it. System will now reboot. WHen it comes up and when you see something like .. "..press and key within 10 secs to interrupt" you would press any key. And I think you'll get a BOOTADMIN prompt. Enter ..
bo pri
and enter Y to the question "Do you want to interact with IPL". You'll then get the ISL prompt. At ISL prompt enter ..
ISL> hpux -is
to boot as single user mode or if you like ..
ISL> hpux -lm
to boot in LVM maintenance mode. The latter is what you need if you're dealing with vg00.
Pete Randall
Outstanding Contributor

Re: LVreduce error HELP!!!!

I finally figured out that SWC is the Secure Web Console!!! Duhhh! By all means, reboot using your SWC to get into LVM maintenance mode.

Pete

Pete
Babs_1
Frequent Advisor

Re: LVreduce error HELP!!!!

Crikey!
I think I will try running it while the vg is still active..worst case scenario is it doesnt work right? (see my obituary now....sys admin beaten to death by Oracle dba)
So have I got these commands right :
vgcfgrestore -R -n /dev/vg00 /etc/lvmconf/vg00.conf.old /dev/dsk/c1t2d0
for the first disk and
vgcfgrestore -R -n /dev/vg00 /etc/lvmconf/vg00.conf.old /dev/dsk/c2t2d0 for the second disk
Have I got these commands right?
Pete Randall
Outstanding Contributor

Re: LVreduce error HELP!!!!

Don't use the -R option.

Pete
Babs_1
Frequent Advisor

Re: LVreduce error HELP!!!!

So no -R but the rest is ok?
Pete Randall
Outstanding Contributor

Re: LVreduce error HELP!!!!

Yup

Pete
S.K. Chan
Honored Contributor

Re: LVreduce error HELP!!!!

Nope .. you missed the "-f" before the vg00.conf.old file. I would dropped the -R option as it's risky (see man page for details). My guess is it'll come back and tell you you need to deactivate your vg first.