Operating System - HP-UX
1832466 Members
3064 Online
110043 Solutions
New Discussion

Re: Renaming Logical Volume

 
musaddaq_2
Frequent Advisor

Renaming Logical Volume

Hi
We have a small problem.
We have 9iRAC(9.2.0.5) implmented with
(RAW Devices) on HP-UX platform. it is 24 x 7 system and we cannot afford any down time.
now the problem is as we have raw devices we have already created some LV's in advance and kept it as we fall short of space in any of the tablespace we alot those lv's and add a datafile to it.
Now the thing is the name of LV and datafile has to b the same so v have kept some standered naming. But i want my newly added datafile name resembling to tablespace_name so that i can make out which datafile belongs to which tablespace.
and one thing more v have our LV's shared and mirrored. So can anyone give me the solution for this.
I need to do it online.

Thanks

Musaddaq
6 REPLIES 6
Victor Fridyev
Honored Contributor

Re: Renaming Logical Volume

Hi,

Try to use soft links for this purpose:
ln -s /dev/vgXX/lvolY NEEDED_NAME

HTH
Entities are not to be multiplied beyond necessity - RTFM
Bill Hassell
Honored Contributor

Re: Renaming Logical Volume

Actually, logical volumes can be renamed without a problem. The names are not kept in /etc/lvmtab or any other structures other than /etc/fstab (if they are mountable filesystems or raw swap space). Just remember that the name for the new lvol must have a raw companion that starts with "r" as in: lvol2 rlvol2

So rename them in pairs so you don't forget to rename for device files:

mv /dev/vg03/lvol2 /dev/vg03/ora33
mv /dev/vg03/rlvol2 /dev/vg03/rora33

NOTE: You cannot rename the volume group directories, only the lvols.


Bill Hassell, sysadmin
Sanjay_6
Honored Contributor

Re: Renaming Logical Volume

Hi Musaddaq,

As long as you are not using the lv at present on any node, you can rename it without any problem. You can use the move "mv" command to do this. Do remeber you have to do this on all the nodes and you must do the "mv" for the block as well as the character device for the lv.

mv old_lv_namd new_lv_name
mv rold_lv_name mv rnew_lv_name

This is pretty common when the vg's are preallocated and at the time new lvs are required to be added into the database, just rename then and use them. Remember do this on all the nodes. I remember that in the env where we use this, we need to change the owner:group of the character device file to oracle:dba to allow the dba to create tablespaces on the raw lv and for oracle to use them. This also must be done on all nodes.

Hope this helps.

Regds
Colin Topliss
Esteemed Contributor

Re: Renaming Logical Volume

Actually names are also stored in the lvmconf
directory in a map file - but only if the VG contains mountable filesystems.

If your volume group only contains raw filesystems you will be OK. If there is a mixture then you must remember to do a vgcfgbackup of the volume group (I think that will be enough).

If you look under /etc/lvmconfig you'll see (for example):

vg00.conf
vg00.mapfile
vg_oradb.conf

This implies that vg00 has mountable filesystems, and vg_oradb.conf does not (hence no map file).

To be honest with you I don't have a vg with both mounted and raw files - so I'm not 100% sure that the raw lvols will appear in the map file. The usual contents would be something along the lines of:

2 lv_db01
1 lv_db02
3 lv_db03
4 lv_db04
5 lv_db05
6 lv_db06

etc etc.

Col.
musaddaq_2
Frequent Advisor

Re: Renaming Logical Volume

Thanks a lot for all ur reponses.
it seems real helpfull.I will try ur suggestions and will get back to u all.

Thanks and wish u all a very happy and prosperous new year.

Musaddaq
Steven E. Protter
Exalted Contributor

Re: Renaming Logical Volume

Renaming isn't the issue.

If you run out of space in one of those raw files, you will need to break mirrors to extend the size of the raw devices.

There will be a peformance hit while you are building the mirorrs and exposure during the operation itself.

Because I can, I've always renamed my raw adabas devices with the database down.

A simple, carefully executed mv command should be possible to execute the rename.

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