1837078 Members
2513 Online
110112 Solutions
New Discussion

Re: Removing disks

 
Neil Harris
Regular Advisor

Removing disks

Hello all,

I have an rp5470 with 4 drives in it. 2 36G's and 2 9G's. These are mirrored pairs like drive for like and form vg00. There is also a san attached with spare capacity

I wish to remove the 2 9's from the sytem prior to adding 2 146G's (Not in same vg00). Currently there are parts of 2 file systems on the 9's

bdf shows:
/dev/vg00/lvol10 15360000 4306058 10710766 29% /oracle9i <== system not data
/dev/vg00/lvol5 4096000 1652984 2423976 41% /home

From this I am fairly convinced that there is actually only data on the 36's not the 9's. i.e. whilst the file sysems are extended on to the 9's there is no data, but that might be a misconception.

I have read many post here but am unable to find a good way to do this.

In essence I know that I need to reduce the size of the file system and take the drives out of vg.

My first thought was to copy the 2 file systems to a lun on the attached san, and switch them in fstab. Then lvreduce the vg to remove the drives but this seems a crude way to do it. Has anyone got a better idea? I do not have online jfs.

Neil

An inveterate hacker
25 REPLIES 25
Torsten.
Acclaimed Contributor

Re: Removing disks

First you should "draw" a clear picture about your VG layout using

# vgdisplay -v vg00
# pvdisplay -v

to see what is on the disks.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Neil Harris
Regular Advisor

Re: Removing disks

Thanks torsten

I will do that.

Neil
An inveterate hacker
Torsten.
Acclaimed Contributor

Re: Removing disks

If you know about the layout then, you may consider to backup the system with ignite, swap the disks and restore the backup, because you are very likely limited by the VG00 maximum settings (I guess these settings are made for your 36GB drives, so you cannot include the larger disks).

You may post a "vgdisplay -v vg00" to confirm this.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Neil Harris
Regular Advisor

Re: Removing disks

Hi Torsten

This is the output I think it confirms what I think.

Neil
An inveterate hacker
Neil Harris
Regular Advisor

Re: Removing disks

Hi Torsten,

I do not plan to put the new drives in vg00

Neil
An inveterate hacker
Rasheed Tamton
Honored Contributor

Re: Removing disks

Hi Neil,

As Torsten said, you have to start from looking the vgdisplay info.
LVM handles the disks, LVs, VGs, etc.
So, first thing is to make a backup, if in case things go wrong!

vgdisplay vg00|grep "Free PE"
vgdisplay vg00|grep "PE Size"

Multiplying the above two values would give you the total free disk space left on VG00. If you have more than 9GB left, that means you can reduce the 9GB disk.

vgdisplay -v vg00 |grep "PV N"
would give you the disks contains in vg00.

vgdisplay -v vg00 |grep "LV N"
gives the all the LVs on VG00

lvdisplay /dev/vg00/lvol1|grep Mirr
would show if there is mirror on lvol1 and repeat it on other lvols to see the mirrors

lvdisplay /dev/vg00/lvol?|grep Mirr

rgds.
Torsten.
Acclaimed Contributor

Re: Removing disks

Just to clarify - do you want to delete your lvol10 from vg00, create a new vg on the new disks and put the contents of lvol10 there (or anywhere else)?

So you can backup /oracle9i directory, create some new space anywhere outside vg00 (on SAN?) and restore the data.

Now look at your layout:

/dev/dsk/c1t0d0 (9GB)
has
/dev/vg00/lvol10

/dev/dsk/c1t2d0 (36GB)
lvol 1 to 8
has a part of
/dev/vg00/lvol10

/dev/dsk/c2t0d0 (9GB)
has
/dev/vg00/lvol5
/dev/vg00/lvol10

/dev/dsk/c2t2d0 (36GB)
has
lvol1 ... 8 except 5


If you now remove lvol10 and move lvol5 to c2t2d0 you are safe to remove the 9GB disks.


Remember, always do an ignite backup before modify.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Neil Harris
Regular Advisor

Re: Removing disks

Hi Rasheed,

# vgdisplay vg00|grep "Free PE"
Free PE 2266
# vgdisplay vg00|grep "PE Size"
PE Size (Mbytes) 8

so that gives 18128.

Neil
An inveterate hacker
Neil Harris
Regular Advisor

Re: Removing disks

Hi Torsten,

Clarification.

No I want to leave lvol5 and lvol 10 in vg00.

I Want to remove the 2 9s and install the 146G' and create a new volume group for them.

Neil
An inveterate hacker
Torsten.
Acclaimed Contributor

Re: Removing disks

May I understand now - you want only the 36GB disks in vg00?

You have currently 8584 PEs in use.

A 36GB disk has a total of 4340 PE.

2x 4340 = 8680.

So you have enough space.

c2t2d0 has still 2173 PEs free, so you can move the PEs from the 9GB disk to this disks.

see
man pvmove.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Neil Harris
Regular Advisor

Re: Removing disks

Hi Torsten,

Yes you are right.

I think that I need to do this.

pvmove -n /dev/vg01/lvol10 /dev/dsk/c1t0d0 /dev/dsk/c2t2d0

and pvmove -n /dev/vg01/lvol5 /dev/dsk/c1t0d0 /dev/dsk/c2t2d0

Neil
An inveterate hacker
Neil Harris
Regular Advisor

Re: Removing disks

There will be a make recovery done prior to this.

Neil
An inveterate hacker
Neil Harris
Regular Advisor

Re: Removing disks

Torsten,

correction I of course mean vg00 not vg01

Neil
An inveterate hacker
Torsten.
Acclaimed Contributor

Re: Removing disks

This looks good, Neil.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Rasheed Tamton
Honored Contributor

Re: Removing disks

My concerns:
Are your all LVs mirrored. If so, do you use strict allocation policy.

If not you can vgreduce a PV. What makes you think the vgreduce would not work.

lvdisplay on all LVs would give you a better understanding of your system.
Neil Harris
Regular Advisor

Re: Removing disks

Hi Rasheed

I have no reason to belive vgreduce would not work, I am just not sure how I would do it without jfs and would it preserve the data.

Neil
An inveterate hacker
Rasheed Tamton
Honored Contributor

Re: Removing disks

Hi Neil,

My understanding was it is possible and LVM takes care of this. After you lvreduce -m 0, then you could do it. But I can't test it now and I last time I did was couple of years back - so can't be very sure - especially on a root volume!

Having an ignite tape is always better.

lvreduce -m 0 /dev/vg00/lvo?? /dev/dsk/cxtxdx
vgreduce /dev/vg00 /dev/dsk/cxtxdx

If you go with pvmove, then lvol5 is not in /dev/dsk/c1t0d0 but in c2t0d0 and c2t2d0. As there is no lvdisplay outputs, it is difficult to guess.
Neil Harris
Regular Advisor

Re: Removing disks

Hi Rasheed,

The mirrors are strict.

I have attched the output from lvdisplay

Neil
An inveterate hacker
Torsten.
Acclaimed Contributor

Re: Removing disks


lvol1 Current LE 38
lvol2 Current LE 512
lvol3 Current LE 25
lvol4 Current LE 150
lvol5 Current LE 500
lvol6 Current LE 500
lvol7 Current LE 242
lvol8 Current LE 700
lvol10 Current LE 1875

This makes 4542 extends.

Your 36GB disks have only 4340.

I now noticed your lvol5 is not mirrored.

2 possible solutions:

1) you keep all lvols (execept lvol5) mirrored between the 2 36GB disks - lvol5 will remain unmirrored and uses both disks.

Remember, if 1 disk fails lvol5 is gone.

Not a perfect solution, but this is also your current situation.

2) backup with ignite and restore to the 2x 36 GB disks - adjust (decrease) the lvol sizes to a set values so you can mirror all of your lvols. "bdf" will tell you where you can safe some space.

IMHO the better solution.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: Removing disks

to prevent a misunderstanding - in (2) you restore the backup to 1 disk and after this you mirror to the second.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Neil Harris
Regular Advisor

Re: Removing disks

ok

I have read and considered all this.

Space seems to be an issue here an lvol5 is home.

Being safe

I am begining to think that the thing to do here is copy the 2 file systems to the san switch them in fstab reboot and drop them from vg00. That will get them out of the 9g's.

I will then remove the 9gs and recreate lvol5 on the 36's and copy back to that.

I will put lvol10 on the the 146g's drives which is quite acceptable.

I just have one question.

Having removed the file systems from vg00 how do I remove the the 9g drives from vg00. Can I just unconfigure them in sam ?

Neil

An inveterate hacker
Rasheed Tamton
Honored Contributor

Re: Removing disks

If LVs and file systems removed, then you can just vgreduce the 9gb disk from vg00 as in my above post

vgreduce /dev/vg00 /dev/dsk/cxtxdx

Your Lvol10 spans on three disk including the mirror.
/dev/dsk/c1t0d0 1085 1085
/dev/dsk/c1t2d0 1875 1875
/dev/dsk/c2t0d0 790 790

When you create the VG for 146GB you have to make sure that you give correct values for Max PE per PV and PE Size

rgds.
Torsten.
Acclaimed Contributor

Re: Removing disks

OK Neil, if you want to put your /oracle9i directory to another vg, then I have another plan for you.

1) create a new (temp) vg and lvol on your SAN
2) backup /oracle9i and /home (for example with tar) and umount them
3) lvremove lvol5 and lvol10

Now you have 2167 extends in use on your 36GB disks - 2173 are still free.

4) Both 9GB disks are now free and you can use vgreduce to remove them.

Now you have only 2x 36GB disks in vg00.

5) swap the disks
6) create a new vg/lvol on your new disks
and restore /oracle9i
7) adjust /etc/fstab
8) create lvol5 in vg00 and mirror to the other disk
9) restore the data and mount everything

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Neil Harris
Regular Advisor

Re: Removing disks

Hi Torsten,

Thank you thats a good plan and fits perfectly with what I need todo.

I will post the results on Friday.

Neil
An inveterate hacker