Operating System - HP-UX
1752295 Members
5331 Online
108786 Solutions
New Discussion юеВ

larger disk replace and move to new VG

 
SOLVED
Go to solution
Katherine Lynn
Occasional Advisor

larger disk replace and move to new VG

Hi,

I have an Oracle Apps system on HP-UX 11.11.

I have an 18G disk in my SC10 that I want to replace with a 36G disk. The VG that the physical disk resides in, /dev/vga02, has Max PE per PV set at 4341 and the PE size is 4M, so I can't put the new 36G disk in this VG according to everything I've read. (Please correct me if I'm wrong in any of my assumptions. I'm not a sys admin, just a DBA that attempts to do the bare minimum sys admin stuff on a system that I didn't set up.)

I have another VG, /dev/vga04, that has Max PE per PV as 8683, so my plan was to put the new larger physical disk into that volume group.

What are the commands I need to do to replace the disk and get it out of vga02 and into vga04? I thought I knew what to do, but my attempt failed with errors and the new disk coming up as "unavailable", so I just put the old disk back in. I obviously used the wrong commands or missed a command.

Thanks in advance,

Kathy
12 REPLIES 12
johnsonpk
Honored Contributor

Re: larger disk replace and move to new VG

Hi Kathy,

option -1

Regarding increasing MAX_PE per PV ,you could try contacting HP for Vgmodify (if you have a support contract with HP, but not sure whether HP is supporting that now for 11.11)

Check this link
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1154249

>> so I can't put the new 36G disk in this VG according to everything I've read.

option 2,

You can add 36G to vga02 ,but out of 36G only 16 GB can be used and rest space will become unusable because of current VG characteristics(Max PE per pV and PE size)



option 3,

Add new disk to vga04 create new LVs and do a backup restore from vga02's lv to vga04's LVs


>> I thought I knew what to do, but my attempt failed with errors and the new disk coming up as "unavailable", so I just put the old disk back in


How did you remove/replace and how u put the disk back ? is the data on that vg still available? whta are extac steps you followed?



Steven E. Protter
Exalted Contributor

Re: larger disk replace and move to new VG

Shalom,

Your assumptions on the original volume group depend on how it was set up initially. Its possible you will add the disk and get a warning all space will not be used.

If so, vgreduce and proceed with your plan.

The way to according to your plan is to set up the new larger disk in a new vg.

pvcreate
vgextend or vgcreate
lvcreate
newfs

After this you can take down the Oracle database and merely copy the database files over to the new file system.

After that you can do some slight of hand with mount points in /etc/fstab to have the file system names of the mount points remain the same but the left column, the logical volume is new and different.

You want to test this with a few umount commands followed by a mount -a. Oracle database needs to be down. Then start the Oracle database. Wala, new location.

A full system reboot test is now recommended.

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
Katherine Lynn
Occasional Advisor

Re: larger disk replace and move to new VG

Hi,

This was my plan - your option 3:

Add new disk to vga04 create new LVs and do a backup restore from vga02's lv to vga04's LVs.

I know all this, I guess I need specifics, i.e., commands -- before the creating of LVs and backup restore, etc., part, which I've done before.

Here is what I did and what happened:

- Shut down application and unmounted filesystem that contains Oracle files. The physical disk contained only the one filesystem and LV.

- Removed the disk.

- Ran ioscan, disk showed up as "CLAIMED".

- Tried pvcreate and got this error:

pvcreate /dev/rdsk/c4t8d0
pvcreate: The physical volume "/dev/dsk/c4t8d0" is already recorded in the "/etc/lvmtab" file.

- On vgdisplay, disk showed up as "unavailable".

- Panicked, as it's my production system had the tech put the previous 16G disk back and did vgcfgrestore and vgchange and got original data back.

So I'm back to square one, i.e., running out of space.

Did i miss a command? pvchange maybe? I saw that and tried it after the new disk was put in and it failed.
Katherine Lynn
Occasional Advisor

Re: larger disk replace and move to new VG

Forgot to put in the step after "removed the disk"

- Put in the new 36G disk

DOH!

shanmuhanandam
HPE Pro

Re: larger disk replace and move to new VG

Hi,

Procedure:1

If you have free scsi slot in your server, put the new disk in to that free slot.
run the ioscan and get the new device file.
create the new vg and lv on it.
copy the data from the old vg.
once thro, then edit the fstab and modify the vga02 enrtries with your new vg.

procedure:2

before removing the old (18GB) disk, do the data backup of that.
if there is no more PVs on that vg export the vg with map file.
rmove the old disk. and replace the new one(36GB).
run ioscan and create the vga02 on the new disk, also create the lvs.
restore the data.

procedure:3

vgmodify. check the documents for the same.



Thanks,
Shanmugam.
I am an HPE Employee

Accept or Kudo

johnsonpk
Honored Contributor

Re: larger disk replace and move to new VG

option 3
==========

create a new vg with 36 Gb disk and do backup restore from vg02's lv to the new vg

1)mkdir /dev/vga02_new
2)mknod /dev/vga02_new/group c 64 0xXX0000

(XX should be uniq)
3) pvcreate on new 36 Gb disk (i guess that disk is still free and you haven't added to any VG)

#pvcreate
4)vgcreate -s 32 /dev/vga02_new
(-s 32 -- defines pe size as 32 MB)
5)Lvcreate -L -n /dev/vga02_new

(better to keep same lvname as that of original vga02)

6)newfs -F vxfs -o largefiles /dev/vga02_new/

7) mount the new lv under new mount point
mkdir -p
mount /dev/vga02_new/

8) copy data from old fs to new mount point

9)once copying is done..unmount both fs and edit fstab according to new vg/lvname

10)mount -a
11)start application and verify
12)once everything is verified you can destroy old vg (as per ur post , you have only one LV and one disk in that Vg)
vgexport vga02
13) do pvcreate on the 18Gb disk and add that to new vg
pvcreate -f
vgextend vga02_new <18Gb disk>

14) extend the LV and Fs if required (can be online if you have online JFS)


Katherine Lynn
Occasional Advisor

Re: larger disk replace and move to new VG

I tried Johnsonpk├в s first 3 steps initially (my original plan was to create a new volume group to eventually put the 36G disk in):

1)mkdir /dev/vga02_new
2)mknod /dev/vga02_new/group c 64 0xXX0000

(XX should be uniq)
3) pvcreate on new 36 Gb disk (i guess that disk is still free and you haven't added to any VG)

#pvcreate

As I mentioned, when I tried pvcreate I got this error:

pvcreate /dev/rdsk/c4t8d0
pvcreate: The physical volume "/dev/dsk/c4t8d0" is already recorded in the "/etc/lvmtab" file.

(The disk obviously isn├в t free ├в it thinks it├в s still in vga02.) Just as a reminder, the 18G disk will be replaced in the SC10 ├в I don├в t have any more free scsi spots anywhere ├в by the 36G.

When I checked vgdisplay, the replacement disk showed up as ├в unavailable├в .

I think the problem is getting the disk to not show up as part of vga02 before I can add it to another volume group.

Also, I├в m not planning on using the replaced 18G disk for anything ├в I don├в t have any more slots for it. I have a lot of other lvols and filesystems on the vga02 volume group, so I don├в t want to export the vg or anything like that. Since there is only the one lvol and filesystem on the 18G disk being replaced, I have a backup of it and my plan is to restore the data to the new replaced 36G disk (after I create the lvol, fs, etc.) I need the extra space that the new disk can give me for future data requirements. That├в s the purpose of the whole exercise ├в I├в m running out of free space.
Thanks in advance for your help.

Kathy



Henry Fauni
Valued Contributor

Re: larger disk replace and move to new VG

pvcreate: The physical volume "/dev/dsk/c4t8d0" is already recorded in the "/etc/lvmtab" file ---> this error is telling you that "/dev/dsk/c4t8d0" is already a part of /dev/vga02. LVM rule says a physical volume can only be a part of 1 and only 1 Volume Group, and so you have to remove it from vga02 first before being able to use it for vga04.

Remember that although you're replacing the 18-GB disk with the new 36-GB disk, the device file doesn't change, so the system thinks it's still part of vga02. The first step is to remove it by doing a vgexport on vga02.
Henry Fauni
Valued Contributor
Solution

Re: larger disk replace and move to new VG

"I have a lot of other lvols and filesystems on the vga02 volume group, so I don't want to export the vg or anything like that."

Sorry, I didn't see this important piece of information right away! :)

OK, so what you want to do is determine exactly what logical volume is in that disk before you take it out, then remove the logical volume residing on that disk, then vgreduce c4t8d0 from vga02.

1. Confirm a good backup of that filesystem

2. Verify logical volume on 16-GB disk you're going to replace:

# pvdisplay -v /dev/dsk/c4t8d0
Note logical volume name:

3. Unmount filesystem
# umount /

4. Remove logical volume from vga02
# lvremove /dev/vga02/

5. Reduce /dev/dsk/c4t8d0 from vga02
# vgreduce /dev/vga02 /dev/dsk/c4t8d0

6. Confirm device is out of VG
# vgdisplay -v vga02
Confirm /dev/dsk/c4t8d0 is no longer showing

7. Take 18-GB disk out, and replace it with new 36-GB disk

8. Do an ioscan
# ioscan -f -C disk

9. Confirm new disk is OK
# diskinfo -v /dev/rdsk/c4t8d0
Verify size showing 36 GB

10. Prepare disk for LVM
# pvcreate /dev/rdsk/c4t8d0
If this gives you an error, then that new 36-GB disk has already been used as part of LVM before, so you give it a "force" option
# pvcreate -f /dev/rdsk/c4t8d0

11. Extend vga04 VG
# vgextend vga04 /dev/dsk/c4t8d0

12. Create your new logical volume on vga04
# lvcreate -L /dev/vga04
This will create new logical volume, the next incremental lvol number--> new_lvol

13. Create filesystem
# newfs -F vxfs /dev/vga04/rnew_lvol
Note the "r" before new_lvol name. Give it other options that you require i.e. largefiles etc.

14. Edit /etc/fstab file and replace the old entry on vga02 with new logical volume on vga04

15. Mount filesystem, and restore data.

Then hopefully you still have another 18-GB space to play with.