Operating System - HP-UX
1748163 Members
3744 Online
108758 Solutions
New Discussion юеВ

"spread" extents from 1 disk to 2 disks

 
SOLVED
Go to solution
Romalfox
Occasional Advisor

"spread" extents from 1 disk to 2 disks

Team,

I have a pretty good VG00.
My "normal" lvols (lvol1, 2, 3 etc) are mirrored.
But later on, someone created a new my_lvol on the remaining space. As a result, physical disk 1 is full and physical disk 2 is almost full.

Now I want to extend /home lvol5, but since to strict mirroring and P_disk 1 full, no can do.

Question: is there a way to say to my_lvol to spread its extent over P_disk_1 and P_disk_2
so that there are free extents on P_disk_1 and P_disk_2 and I can do the lvextend of lvo5 with strict mirroring ?

thanks,


Raf
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: "spread" extents from 1 disk to 2 disks

I think you would need to run lvchange to turn off the strict allocation policy:

lvchange -s n . . . . . . .


Pete

Pete
Eric SAUBIGNAC
Honored Contributor
Solution

Re: "spread" extents from 1 disk to 2 disks

Bonjour,

you can move extends from a disk to another one inside the VG with command "pvmove". The problem is that you can't say wich extends you want to move. The little object you can treat with pvmove is "all extends from a specific LV on a specific PV". Suppose that you need 5 more extends for lvol5, you can't say "I would like to move 5 extends of the new my_lvol from disk1 to disk2" ... :-(

You can also change lvol5 properties with lvchange from strict allocation to not strict, but it has no sense ...

So, what I would do, assuming you have free space on my_lvol and that you have OnlineJFS product, is trying to reduce the new my_lvol to free up extends on disk2 and disk1. If you can't reduce it, maybe you could create an new VG and copy to it data from this f......g my_lvol, then remove my_lvol on vg00.

HTH

Eric
Romalfox
Occasional Advisor

Re: "spread" extents from 1 disk to 2 disks

I think
fsadm decrease size my_lvol_fs
lvreduce /dev/vg00/my_lvol
lvextend /dev/vg00/my_lvol to P_disk2
fsadm increase size my_lvol_fs

lvextend /dev/vg00/lvol5 /home ...

is the only way....
Hope anybody has a better idea ?
sujit kumar singh
Honored Contributor

Re: "spread" extents from 1 disk to 2 disks

hello Sir,

can i get the lvdisplay -v /dev/vg00/lvol5 that is ur /home and lvdisplay -v /dev/vg00/my_vol O/Ps?
Also will need to know the pvdisplay -v O/Ps for the disks in the root VG that is /dev/vg00.

I hope that will clear more the ststus of the disks and allocation ploicices for the said LVOLs in the VG vg00.
Then u can know the full feasibilty of all that u want to do.


Sujit
can u please send me those O/Ps?
Eric SAUBIGNAC
Honored Contributor

Re: "spread" extents from 1 disk to 2 disks

You are right, the general idea is there. Some details and an example :

>>> "fsadm decrease size my_lvol_fs"

Be aware that new size of my_lvol_fs should be a multiple of extend size of the VG. First compute the new size of my_lvol regarding vg parameters and extends occupancy on disk2 and disk1.

To compute new size of my_lvol, and assuming that my_lvol is not mirrored, I see things like this:

- Suppose my_lvol is 1000 extends, 700 first on disk1 and 300 next on disk2. Suppose you need to add 50 extends + mirroring on lvol5 (so it means you have at least 100 free extends in vg00), so you need to free up 50 extends on disk1. It means that you must take 350 extends from my_lvol. So new size of my_lvol will be 650 extends. If PE size is 16 Mo in the VG, it means :
650 PE x 16 Mo x 1024 = 10649600 Ko

--> fsadm -b 10649600 /mount_point_of_my_lvol

>>> "lvreduce /dev/vg00/my_lvol"

--> lvreduce -l 650 /dev/vg00/my_lvol

>>> "lvextend /dev/vg00/my_lvol to P_disk2"

--> lvextend -l 1000 /dev/vg00/my_lvol /dev/dsk/disk2"

>>>"fsadm increase size my_lvol_fs"

New size (in other words old size ;-)
1000 PE x 16 Mo x 1024 = 16384000 Ko

--> fsadm -b 16384000 /mount_point_of_my_lvol

Now, you should have 50 free extend on disk1. Check with pvdisplay /dev/dsk/disk1

HTH

Eric
Romalfox
Occasional Advisor

Re: "spread" extents from 1 disk to 2 disks

Since I'm pretty sure Eric pointed out the only feasable solution, I will close this thrread. Thanks all for the suggestions.


Raf