1833652 Members
3703 Online
110062 Solutions
New Discussion

Mirror Disk Again

 
SOLVED
Go to solution
grace white
Advisor

Mirror Disk Again

Hi All

Just a quick check i have a L2000 and i want to exent a volume group vg01. If i do an lvdisplay i get the the following information :-
/dev/vg01/lvol12 17776640 16272837 1410632 92% /home3
vg01

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c5t9d0 4340 4340
/dev/dsk/c7t9d0 4340 4340


what i want to confirm these are two 18Gig drives and i am including a 36 Gig drive into this so what is required to perform this action as i am a little confused do i just need to do.

in my example do i need to do as followed

1. pvcreate -B /dev/rdsk/
2. mkboot -l /dev/rdsk/
3. mkboot -a "hpux -lq(;0)/stand/vmunix" /dev/rdsk/
4. vgextend /dev/vg00 /dev/dsk/
5. lvextend -m 2 /dev/vg00/lvol6 /dev/dsk/
6. lvlnboot -r
7. lvlnboot -s
8. lvlnboot -R
9. lvlnboot -v
10. vgcfgbackup /dev/vg00

Thanks
Grace
UNIX/ORACLE DBA
12 REPLIES 12
Pete Randall
Outstanding Contributor
Solution

Re: Mirror Disk Again

Grace,

The first problem you're going to run into is that adding a 36GB drive into a vg with 18GB drives, you're not going to be able to use half of the new drive. The max PE per PV that was calculated when the VG was originally setup for the 18GB drives is goint to be too small for you to see all of the 36GB drives. Unfortunately, the only way around that is to re-create the VG on the 36GB drive and add the 18GB drives to it (you could also manually raise the PE size or the MaxPE number but it's still done only at creation time).


Pete



Pete
Jeff Schussele
Honored Contributor

Re: Mirror Disk Again

Hi Grace,

Very first thing to do is a vgdisplay vg01 & check the Max PE/PV value. Because if you used the default value when you originally created the VG, then that value will not be large enough to use the entire 36 GB of that new disk.
Unfortunately this can only be changed by recreating the VG.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
A. Clay Stephenson
Acclaimed Contributor

Re: Mirror Disk Again

Well, that depends. I suppose that you would like your new 36GB drive to be 36GB rather than 18GB. The problem is that you should have created the VG with the largest physical drive first so that enough PE's would have been allocated. You do not need the pvcreate -B or the lvlnboot commands for vg01 because it is not a boot drive.

If you want to use this 36GB drive then I would do it as a brand new VG (e.g. vg02) - using pvcreate and vgcreate. Make your lvols so that they match those on your existing vg01 and build new filesystems. Next copy using cpio -p your existing files in vg01 to vg02. You can then umount the filesystems in vg01 and mount them using identical mountpoints in vg02. Next I would vgexport the old vg01, pvcreate -f both 18GB drives, vgextend vg02 using the 18GB drives, and as a last step lvextend -m 1 each LVOL in the new vg02.
If it ain't broke, I can fix that.
grace white
Advisor

Re: Mirror Disk Again

Hi

I have taken over the system and due to there is no space left to extend i need to add this new disk to existing mirror to create space.

Output from vgdisplay

gdisplay vg01
--- Volume groups ---
VG Name /dev/vg01
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4341
VGDA 4
PE Size (Mbytes) 4
Total PE 8680
Alloc PE 8680
Free PE 0
Total PVG 2
Total Spare PVs 0
Total Spare PVs in use 0

Output from BDF

/dev/vg01/lvol12 17776640 16272837 1410632 92% /home3
Will it be ok to do as i previously applied or how do i go about this.

Thanks
Grace
UNIX/ORACLE DBA
Patrick Wallek
Honored Contributor

Re: Mirror Disk Again

Sure, you can add it to the VG, but as others have stated you are only going to be able to use roughly 1/2 of the disks available.

Your Max PE/PV value is 4341 and your PE size is 4 MB. So you will only be able to use 17364 MB of that disk. Also, if your LV is mirrored, adding a single disk to the mix will *not* allow you to maintain your mirror.

Also, if you are extending VG01, you don't need to 'pvcreate -B' as that creates a boot area on the disk and VG01 probably is not your boot VG. You also do not need to do any of the mkboot commands or the lvlnboot commands as those are reserved strictly for VG00. You could do your vgcfgbackup but back up vg01 instead of vg00.

The steps you would need to do for VG01 really are only:

pvcreate /dev/rdsk/c?t?d?
vgextend /dev/vg01 /dev/dsk/c?t?d?

Now you just need to extend your LV however you want.

Be aware though that if you really *NEED* to use the entire 36GB disk and not just 17GB, you will *HAVE* to backup your data in VG01, blow it away, and recreate with different / larger MAX PE/PV values and probably a larger PE Size value.

Good luck.
John Dvorchak
Honored Contributor

Re: Mirror Disk Again

Grace I see a couple of problems with you list of commands. Aside from the fact that you will only get 18 gb of that 36 GB drive, your vg01/lvol looks like it is mirrored. While it is possible to extend the lvol and mirror on a single disk (why would you want to?) it is not getting the redundancy that you wanted when you mirrored the lvol in the first place.

Second your list of commands if for vg00 and mirroring a boot disk. It has a lot of steps that are not necessary for expanding vg01.

What I would suggest is to NOT use the 36gb disk and use 2 18gb disks instead. Then the commands would look like this:

pvcreate /dev/rdsk/
pvcreate /dev/rdsk/
vgextend vg01 /dev/dsk/ /dev/dsk/
lvextend -l 4340 /dev/vg01/ /dev/dsk/ /dev/dsk/

These steps will extend the lvol. You will need Online JFS if you want to expand the mounted filesystem online. If you don't have Online JFS, then you will need to umount the /home directory, extendfs the lvol and then mount it back. Of course this would be done in single user mode.
If it has wheels or a skirt, you can't afford it.
grace white
Advisor

Re: Mirror Disk Again

Thanks Guys

As this is a Short term fix until new Server is implemented.

Thanks
Grace
UNIX/ORACLE DBA
Todd McDaniel_1
Honored Contributor

Re: Mirror Disk Again

Grace,

You simply cant add the 36GB disk to the VG01, you will lose 18g of it and wont be able to mirror it either...

If you have 2 18GB disks currently as the primary and mirror... I would create a new VG with the 36GB disk and then transfer the data from the current VG01 to the new VGXX...

then use the 2 18GB as the mirrors for the new 36GB drive... that will be the best you can hope for.

Primary Mirror

36GB 18GB
- ......... -
- ......... -
- ......... -
- ......... -
- ......... -
- ......... -
- ......... 18GB
- ......... -
- ......... -
- ......... -
- ......... -
- ......... -
- ......... -

Unix, the other white meat.
grace white
Advisor

Re: Mirror Disk Again

Hi

Thanks for the adivice what I would like to do is check this is the correct procedure to enable me to carry this out.


1. pvcreate /dev/rdsk/
2. vgchange -a n /dev/vg01
3. vgexport -p -m mapfile vg01
4. vgexport -m mapfile vg01
5. vgimport -p -v -m mapfile /dev/dsk/cxtydz /dev/dsk/

Now mirror the existing volume group


1. mkboot -l /dev/rdsk/
2. mkboot -a "hpux -lq(;0)/stand/vmunix" /dev/rdsk/
3. vgextend /dev/vg00 /dev/dsk/
4. lvextend -m 2 /dev/vg00/lvol6 /dev/dsk/
5. lvlnboot -r
6. lvlnboot -s
7. lvlnboot -R
8. lvlnboot -v
9. vgcfgbackup /dev/vg00
UNIX/ORACLE DBA
Todd McDaniel_1
Honored Contributor

Re: Mirror Disk Again

Grace,

you cant merely vgexport and then vgimport the VG b/c the # of extents are too few... as defined by the header info you created VG01 with. That is based on an 18GB and you need a # of extents based on a 36GB drive.

You will have the same problem I described, and others, about having only 18gB of your 32GB disk avaliable b/c you dont have enough extents...

You must either do one of 2 things...

1) backup and destroy VG01 and then recreate it with 32GB disk then mirror with 2 18GB disks..

2) Make a new VGXX and create it in the normal way with the 32GB disk Then move/cp data from old VG01 to new VGXX.


Unix, the other white meat.
Todd McDaniel_1
Honored Contributor

Re: Mirror Disk Again

After reading your original post again. I think you have some things confused there...

You reference commands to create a new bootable VG00, but you say in your intial sentence that you want to extend VG01...

Which is it? those are 2 totally different things. I imagine that you are talking about VG01 and misposted a script to modify vg00 by accident.
Unix, the other white meat.
grace white
Advisor

Re: Mirror Disk Again

Hi

Thanks for getting back to me what i have is a volume group (vg01) which has now space available which is mirrored over two disks /dev/dsk/c5t9d0 and /dev/dsk/c7t9d0 which are both 18Gig.

Now i have a new disk available which is 36Gig and intend to use this to give me the required space.

Henece due to this is a mirror i require to add the new disk to this mirror

Thanks
Grace
UNIX/ORACLE DBA