Operating System - HP-UX
1836689 Members
2452 Online
110108 Solutions
New Discussion

Incorporating data disks under LVM

 
SOLVED
Go to solution
Syed Naseer
New Member

Incorporating data disks under LVM

Hi,

I have a set of disks (say set A) that already have data with JFS, and another set (say B) of free disks (without any data).

Is it possible to incorporate set A under LVM control and mirror it to set B, without losing the existing data on set A ? Pls exclude the option of backing up set A and then restoring after pvcreate/vgcreate/lvcreate.

Thanks.
7 REPLIES 7
harry d brown jr
Honored Contributor

Re: Incorporating data disks under LVM

Is set A, an HP JFS? And if so, what revision.

If set a is a volume group, then you can add the disks from set B to the volume group and mirror the logical volumes.
Live Free or Die
A. Clay Stephenson
Acclaimed Contributor

Re: Incorporating data disks under LVM

Yes this is possible - the only gotcha is that if your new disks are larger than the largest of the old, you won't be able to use all the space on the new drive(s).

Let's say that your new drives are c1t5d0 and c2t4d0 and that the volume group is vg02.
I assume that you have Mirror/UX installed.

0) Have a good backup.
1) vgdisplay -v /dev/vg02 | lp (so that you will have a hardcopy in front of you)
2) pvcreate -f /dev/rdsk/c1t5d0
pvcreaste -f /dev/rdsk/c2t4d0
3) vgextend /dev/vg02 /dev/dsk/c1t5d0 /dev/dsk/c2t4d0
5) for each lvol listed
lvextend -m 1 /dev/vg02/lvolxx
(if you like you can also specify a specific drive to mirror)
lvextend -m 1 /dev/vg02/lvolxx /dev/dsk/c1t5d0

That should do it.

By the way, you can actually do all the step under SAM->Disks&Filesystems

Clay
If it ain't broke, I can fix that.
Syed Naseer
New Member

Re: Incorporating data disks under LVM

SOme more info:

I am running HP-UX 11.0 on V2200, with JFS.
Set A is currently not under LVM (.ie. not a vg).
Sridhar Bhaskarla
Honored Contributor

Re: Incorporating data disks under LVM

Syed,

As long as your "set"s are imaginary it's fine. But in practical when you do mirroring all the disks will become a "single set" and should be bunched together in one volume group.

If your idea is to seperate setA (volume group 1) and setB(volume group 2) and mirror - it's not possible.

You can follow the procedure as outlined by Clay.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
Mladen Despic
Honored Contributor

Re: Incorporating data disks under LVM

Syed,

If the set A is not in a volume group now, was it a part of a volume group when the data was written to it? If yes, you can try using 'vgimport' to bring the set A into a new volume group. Then use Clay's instructions.

Mladen
Syed Naseer
New Member

Re: Incorporating data disks under LVM

Thanks for your suggestions. I think i did not phrase my question right. Let me make it simpler.

I have a JFS filesystem on a single disk, which is not part of any VG. I want to bring it under LVM so that i can mirror it with another new disk.

Q: can i make my existing data disk part of a VG, without having to initialize it thru pvcreate (and thereby lose the data on it)?
melvyn burnard
Honored Contributor
Solution

Re: Incorporating data disks under LVM

the answer is basically NO.
what you could do is set up your set B disc(s) under lvm, create fs's etc.
create a new mount point and mount under there.
Then copy everything from setA to setB, unmount everything, mount the new setB under the origional mount point and then add setA into the vg using pvcreate etc.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!