Operating System - HP-UX
1834827 Members
2483 Online
110070 Solutions
New Discussion

Re: Add more space to a Lvol

 
SOLVED
Go to solution
Dan Decker
Frequent Advisor

Add more space to a Lvol

 
It's not done Till I am satisfied
13 REPLIES 13
Pete Randall
Outstanding Contributor

Re: Add more space to a Lvol

Use SAM.

Pete
John Carr_2
Honored Contributor
Solution

Re: Add more space to a Lvol

Hi

umount the filesystem

eg

lvextend -L 2048 /dev/vg00/lvol9

extendfs -F vxfs /dev/vg00/rlvol9

mount /dev/vg00/lvol9 /name_dir

John.
Sachin Patel
Honored Contributor

Re: Add more space to a Lvol

You can expand your lvol if you have any free PEs.

Say your lvol1 is belongs to vg01
#vgdisplay vg01
Free PE 30
and 1 PE=4mb then you can extend your lv by 120MB.

#umount /dev/vg00/lvol1

#lvextend -L new_size /dev/vg01/lvol1
where new_size= original_size+120

Then
extendfs -F hfs /dev/vg01/rlvol1

mount /dev/vg01/lvol1 mount_point

Sachin
Is photography a hobby or another way to spend $
Jeff Schussele
Honored Contributor

Re: Add more space to a Lvol

If you have free space in the VG you can just
lvextend -L xxxx /dev/vg_name/lv_name

And if you have On-Line JFS you don't even have to unmount. If not you'll have to unmount
umount /mnt_point

If no free space in VG.
Add disk & initialize it
pvcreate -f /dev/rdsk/cxtydz
Add it to the VG
vgextend vg_name /dev/dsk/cxtydz
extend the LV
lvextend -L xxxx /dev/vg_name/lv_name

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Martin Johnson
Honored Contributor

Re: Add more space to a Lvol

If the lvol is mirrored, I would recommend breaking the mirror first, extend, then remirror.


Marty
Ameet_HP
Frequent Advisor

Re: Add more space to a Lvol

If you have sufficient Free PEs in current LV, just go to lvextend. Or add any other hard disk in the volume group. You will need to unmount only if you are not using Online JFS.

vgextend /dev/vg01 /dev/dsk/c20t5d3
vgcfgbackup /dev/vg01

lvcreate -n lvf1 /dev/vg01

SZ=current allocated PEs + No. of PEs you add

lvextend -l SZ /dev/vg01/lvf1 /dev/dsk/c18t5d2
lvdisplay /dev/vg01/lvf1
mount -F vxfs /dev/vg01/lv1 /f1

Ameet
Dan Decker
Frequent Advisor

Re: Add more space to a Lvol

I appreciate all the responses however I never even got a chance to explain what I want to do or what the problem is I hit the wrong key in typing and before I know it I got all the responses and I really haven't explained anything yet gosh you guys are good.

Now let me say this I have 1 vg it contains 11 lvol. One of those is at 98% and it is 1/3 set at 4007201 kbytes than I have another that is part of a group 1/8 set at 4019546 kbytes this is a total of 11 lvol, again this is all in the same vg. I would like to expand both of those lvol's. Can I take from some of the other lvols that aren't even close to these two and redistribute some of there space to these two that are in need of some space.

I am really new at doing this, However this system is going to be shut down in the near future and we aren't looking to add any disk to this system.

I hope I make sense by all this and I do thank you all.
It's not done Till I am satisfied
Martin Johnson
Honored Contributor

Re: Add more space to a Lvol

What version of the OS are you on? On earlier versions of HPUX, doing an lvreduce could cause data corruption. It is recommended you back up the data, lvremove the logical volume, then lvcreate a new logical volume at the smaller size.

Marty
Sanjay_6
Honored Contributor

Re: Add more space to a Lvol

Hi Dan,

To redistribute the space allocated to some other lv, you have to take a backup of the lv you want to redistribute, then remove the lv, increase the size of the other lv's, recreate the lv that was removed and then restore the data.

backup data from spare lv,
remove spare lv
increase the size of other lv
create spare lv with lower size
restore data to spare lv.

Hope this helps.

Regds
Pete Randall
Outstanding Contributor

Re: Add more space to a Lvol

Sorry Dan, I probably started the reply flood with my vain attempt at humor. I hope you get everything straightened out. I'll check back on Monday and see how you're doing. Have a (hopefully) good weekend.

Pete

Pete
Jeff Schussele
Honored Contributor

Re: Add more space to a Lvol

Ahh...Pete...quit beating yourself up...we *kinda* knew where he was going.

Yep, Dan, you gotta backup the one that you want to decrease, remove it, extend the one(s) you want to (no backups needed for those), recreate the "old" big one (smaller now) & restore to it.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Pete Randall
Outstanding Contributor

Re: Add more space to a Lvol

Well, I fibbed. It's not Monday, it's Sunday and I'm doing the "enjoy your weekend by patching your productions server" thing. Since I don't see any panic messages from Dan, I'll assume that you've received the advice you needed and are well on your way to redistributing your lvol's.

Pete

Pete
Dan Decker
Frequent Advisor

Re: Add more space to a Lvol

Thanks Pete and the rest of you! I have the information however I needed to do a back up and then as we all know something else crops up and requires our immeditate attention. I will get back with you on this progress. I know I can count on all of you so thanks a bunch and keep up the good work.
It's not done Till I am satisfied