Operating System - HP-UX
1833055 Members
2592 Online
110049 Solutions
New Discussion

Rename LVMs and Groups (this should be easy I think)

 
John M. Gonzales_1
Regular Advisor

Rename LVMs and Groups (this should be easy I think)

Pardon my ignorance of HPUX but we have a 9000 K class machine running version 10.20. We just recently discovered the client obtained this machine from another company and they hooked up the controller cards improperly. We can see the drives in IOSCAN (this particular device has external drives 24 total) but this machine once ran oracle and we need to be able to access all the data still left of those drives.

Needless to say this played heck with the LVM headers and the like. We've been battling several issues, like hard disk space wasn't partitioned correctly and we've even had redo.logs in the root partition when I saw it.

If we can remove and rename the LVMs and volume groups then we should be home free. I'm just not familiar with HPUX that much so I'm at a bit of a loss. Any help is appreciated
If life really sucks so much, then why am I not enjoying the feeling?
13 REPLIES 13
James R. Ferguson
Acclaimed Contributor

Re: Rename LVMs and Groups (this should be easy I think)

Hi John:

Do you want the data on the disks or do you merely want to reclaim the space and destroy all knowledge of it?

...JRF...
Roger Baptiste
Honored Contributor

Re: Rename LVMs and Groups (this should be easy I think)

John,

What sort of external drives is this system connected to? You mentioned 12 drives- are these drives on a external RAID array . If so, are those disks currently connected to the system?

What is the intention? Do you want to blow away the database and reconfigure the system?
or do you want to preserve it and continue using it? or do you want to take backup and reconfigure it?

As an initial check:
#ioscan -nf >/tmp/ioscan.out
-> gives you all info on the I/O connected to the system

#ioscan -nfCdisk >/tmp/ioscan-disk.out
-> gives info on what diskcontrollers/disks the system can see

#vgdisplay -v >/tmp/vgv.out
-> this actually should show what VG's are currently enabled and visible on the system and their configuration. This should give you an idea on how the VG's were laid out previously

#mount >/tmp/mount.out
-> shows current FS mounted
#Compare mount.out with /etc/fstab and see how many Filesystems were mounted and how mnay did not.

#Is the database running?
ps -ef |grep pmon (quick and dirty check)

IF the database is not running, or the vgdisplay output gives errors on vg not enabled, then you need to make sure all the disks are connected properly.

If you can post the mount information it would
help.

-raj
Take it easy.
Roger Baptiste
Honored Contributor

Re: Rename LVMs and Groups (this should be easy I think)

John,

Simple answer to your subject question.
Yes, you can rename LV and VG.
First you need to have the VG enabled to rename the LV in it.

eg: vgdisplay -v testvg should give an output
if not, do
vgchange -a y testvg and it should work.
Else you don't have the disks connected correctly.

If the vgchange works, then :

You can rename the LV's in the VG by doing
simple mv command :
cd /dev/testvg
mv file newfile
(remember to rename both the block and raw files and also make sure they are not being used by anybody at that time)
To rename VG:
vgexport -v -m /tmp/testvg.map -f /tmp/testvg.disk testvg
mkdir /dev/newvg
mknod /dev/newvg/group c 64 0x??0000
vgimport -m /tmp/testvg.map -f /tmp/testvg.disk newvg

HTH
raj
Take it easy.
Sebastien Masson
Valued Contributor

Re: Rename LVMs and Groups (this should be easy I think)

1. vgexport all the vg you want to rename (don't forget, to do that, you need to umount all assigned logical volume and do a vgchange -a n to disable access).

2. Then, you can delete all exported vg device directory under /dev (i.e.: /dev/vg01).

3. mkdir /dev/vg_newname
4. mknod /dev/vg_newname/group c 64 0xnn0000 (nn=01 to kernel:MAXVGs). the nn number just need to be uniq accros the OS.

5. vgimport /dev/vg_newname /dev/dsk/c?t?d? [/dev/dsk/c?t?d?] ...


If you had disk from an other system who you know they have been in a volume group, just do a: ioscan; mv /etc/lvmtab /etc/lvmtab.old; vgscan; strings /etc/lvmtab. This will give you information about which disk under which vg.

John M. Gonzales_1
Regular Advisor

Re: Rename LVMs and Groups (this should be easy I think)

Wow thanks for all the replies. Let me get back to you with more info after I try some of these steps.

My intention is to retain the data for this oracle database at ALL costs. I'm not onsite so I can't say what kind of of system the external drives are on but all 24 are in it from my last view.

They have several older volume groups and various data point where the Oracle DBFs are located. Hope that clarafies a little better.
If life really sucks so much, then why am I not enjoying the feeling?
Roger Baptiste
Honored Contributor

Re: Rename LVMs and Groups (this should be easy I think)

<>

In that case,you would need to start off by checking whether oracle instance is up and running and whether the DBA/users are able to see all the stuff in it.

<< I'm not onsite so I can't say what kind of of system the external drives are on but all 24 are in it from my last view>>

ioscan -nfCdisk will show what drives are there and also will give a brief description from which you can figure out the type of disks.

HTH
raj
Take it easy.
John M. Gonzales_1
Regular Advisor

Re: Rename LVMs and Groups (this should be easy I think)

Users shouldn't be an issue, we've taken the device out of a full production environment.

Also the IOSCAN does show all the devices, and their types. We've made backups of the older FSTAB and LVMTAB files. The hard disks vary in make and sizes, most are made by SeaGate.

We have another engineer on site taking a peek at it as we speak.
If life really sucks so much, then why am I not enjoying the feeling?
John M. Gonzales_1
Regular Advisor

Re: Rename LVMs and Groups (this should be easy I think)

Just an update, we've tried the steps you guys gave me but we're still suffering the same issues.

Any other ideas on what to do with this problem? We're starting to get dead ends. Thanks for all the help.
If life really sucks so much, then why am I not enjoying the feeling?
Alan Riggs
Honored Contributor

Re: Rename LVMs and Groups (this should be easy I think)

Can you be more explicit in describing your problem? Were you unable to export the VGs? Did the import fail? Did the rename work but not solve some other problem?

The more detail you provide, the better we will, be able to help you.
Ian Dennison_1
Honored Contributor

Re: Rename LVMs and Groups (this should be easy I think)

Have you performed a 'strings /etc/lvmtab' and verified the contents match the configuration you are using?

I would be very curious to know the error messages you are receiving?

Share and enjoy! Ian
Building a dumber user
John M. Gonzales_1
Regular Advisor

Re: Rename LVMs and Groups (this should be easy I think)

Sorry for the delayed response but I'm working with an engineer in the field.

Here's the latest item of concern:

The devices do not reconstruct in the /dev/dsk and /dev/rdsk after a reboot or ioscan. One suggestion I read:

rename the /etc/io.config
run ioscan

I'm working on getting the other errors as they come through. Just both of us are putting out fires at different client sites, which makes this a bit difficult.

HTH
If life really sucks so much, then why am I not enjoying the feeling?
Joseph C. Denman
Honored Contributor

Re: Rename LVMs and Groups (this should be easy I think)

To rebuild the special file:

insf -e


...jcd...
If I had only read the instructions first??