1833863 Members
1946 Online
110063 Solutions
New Discussion

Re: Increasing a Volume

 
SOLVED
Go to solution
Jeff Tolly
Advisor

Increasing a Volume

Inherited a server running 10.20 and am a complete newbie to this so if you have a solution please have details so I can properly solve this.

Have a Volume #8 out of 10 that is at 96% capacity and need a way to create more avaible disk space. My LVDisplay info is below....

LV Name /dev/vg00/lvol8
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 92
Current LE 23
Allocated PE 23
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

I have plent of space on other Volumes but this one was set small and seems to grow much quicker than the others.

What are the steps needed to accomplish this?

Thank you!
13 REPLIES 13
RAC_1
Honored Contributor

Re: Increasing a Volume

if you have enough space in vg00 you can increase this lvol. or add disk in vg00 and then increase this lvol.

or

delete unwanted file in lvol8 and then check.
There is no substitute to HARDWORK
James R. Ferguson
Acclaimed Contributor

Re: Increasing a Volume

Hi:

A similar question just arose. Essentially, you will need to 'lvextend' your logical volume (if you have space on the physical volume), and then resize your filesystem.

I suggest you use SAM if you are new to this.

I also suggest that you first have a look at the chapter on managing disks and files in "Managing Systems and Workgroups: A Guide for HP-UX System Administrators":

http://docs.hp.com/hpux/onlinedocs/B2355-90742/B2355-90742.html

A quick read will help you understand your options much better. SAM can guide you through the mechanics or you can use the actual LVM commands.

Regards!

...JRF...
Martin Johnson
Honored Contributor

Re: Increasing a Volume

On my systems lvol8 is /var. If this is an HFS file system, you will need to reboot to extend it, because HFS require the file system to be umounted while extending and /var cannot be umounted while the system is running.

Another way to handle the problem is to offload some of the files in /var. A good candidate is /var/adm/sw. Simply tar the files in this directory to a backup, do:

cd /var/adm/sw
rm -R *
cd /
use sam to create a new logical volume and use /var/adm/sw as the mount point. Make sure the lvol is large enough to contain all the files that were in /var/adm/sw plus room to spare (needed when you install patches). finally, untar the files into /var/adm/sw.

HTH
Marty
Michael Tully
Honored Contributor

Re: Increasing a Volume

Which mount-point does /dev/vg00/lvol8 reside on?
Either use the output of 'bdf' or view the /etc/fstab file.
Depending on the mount-point will determin if the change can be completely done on line or a reboot maybe required.
Anyone for a Mutiny ?
Helen French
Honored Contributor

Re: Increasing a Volume

Normally vg00/lvol8 will be /var file system(see command bdf) and 92MB for /var is very less. You can have a look at the file system (even if it's not /var) and then remove unwanted files from it. Find out if you have available space on vg00 (vgdisplay -v /dev/vg00) and then determine how much you want to increase.

If you don't have enough space available on vg00, then you can add another disk to this vg first (if you have a free disk). You can then increase lv size through SAM. If you don't have Online JFS installed, you might want to bring the server to single user mode and then unmount the file system first. Once the FS is extended, you can mount it back and bring the system to normal run level.
Life is a promise, fulfill it!
Chris Vail
Honored Contributor
Solution

Re: Increasing a Volume

First, you need some more information. The first of this is the amount of free space in the vg00 volume group. Find this out with the command "vgdisplay /dev/vg00". You need 2 bits of information. The results of this command on one of my systems is:
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 12
Open LV 12
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4350
VGDA 4
PE Size (Mbytes) 8
Total PE 8680
Alloc PE 3751
Free PE 4929
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

The two bits of information are PE size, and free PE. Multiply these two together to find out how many megabytes of space is available for assignment in the vg00 volume group. If the number isn't enough to meet your anticipated needs, there are a few things you can do; the easiest of these is to add hard disk(s) to the volume group.

If there is enough unallocated space, the next step is to extend the logical volume. The best way to do this is to calculate the number of PE's you need. In the above case, a PE is 8 megabytes. So if I want to add 32 megabytes to the filesystem, I need 4 PE's.

The next information to collect is the number of PE's in the logical volume that you wish to extend. The command "lvdisplay /dev/vg00/lvol8" will show you what you need. Here's what mine looks like:
LV Name /dev/vg00/lvol8
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 1000
Current LE 125
Allocated PE 125
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

So my logical volume #8 (/dev/vg00/lvol8) is 125 PE's times 8 megabytes, or 1000 bytes large.

Simple math: add the number of PE's currently in the logical volume to the number you need. In my example, I would need 129 (125 PE's +4 PE's).

Next, extend the filesystem. Do this with "lvextend -L 129 /dev/vg00/lvol8". This adds the 32 megabytes to the 1000 that are already there.

The last step depends on whether or not your system has fsadm installed. If you do, your job is about done. The command "fsadm -b 1032M /opt" extends the mounted filesystem, and you don't have to unmount it beforehand. You can check that the free space has increased by the specified amount with "bdf".

If you don't have fsadm, you need to schedule a reboot. You first have to unmount the filesystem with "umount /dev/vg00/lvol8". Next "extendfs /dev/vg00/lvol8" will extend the filesystem to the maximum amount defined by the logical volume. After a reboot, you should see the space that you allocated.

Good luck, and let us know how this works out for you.

Chris
Peter Nikitka
Honored Contributor

Re: Increasing a Volume

Hi,
since other replies guided you already to
lvextend / extendfs, I just want to remark, that it might be not a simple task to unmount /var or similar filesystems.
I use to call only the lvextend-command. Additionally I have this commands added in
/sbin/bcheckrc just before the final for-loop:
/sbin/umount /dev/vg00/lvol8 2>/dev/null
/sbin/extendfs /dev/vg00/rlvol8

During the reboot, the volume gets extended without problems.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Jeff Tolly
Advisor

Re: Increasing a Volume

I've tried the vgdisplay /dev/vg00/lvol8 command but am getting, vgdisplay: Volume group "/dev/vg00/lvol8" does not exist in the "/etc/lvmtab" f.
vgdisplay: Cannot display volume group "/dev/vg00/lvol8".

/dev/vg00
My PE size = 4
My PE free = 136

Also, is there a way to have keyboard history like "doskey up arrow" functionality?
Helen French
Honored Contributor

Re: Increasing a Volume

You had the wrong command. You need to use lvdisplay and not vgdisplay. vgdisplay will list info about volume groups where as lvdisplay for logical volumes:

# lvdisplay -v /dev/vg00/lvol8

Also for getting command hostory, you can set the HISTFILE argument in your local profile file:
HISTSIZE=4096
HISTFILE=/.sh_history

Or you can execute this for temp. usage:
# ksh -o vi
Life is a promise, fulfill it!
Pete Randall
Outstanding Contributor

Re: Increasing a Volume

Jeff,

It's "vgdisplay /dev/vg00" (or just vg00 without the dev) not "vgdisplay /dev/vg00/lvol08".

Secondly, to enable keyboard history:
export EDITOR=vi
set -o vi
k
will then recall your last command. It's based on vi so I hope you have some familiarity with vi.

Pete

Pete
Jeff Tolly
Advisor

Re: Increasing a Volume

OK, I have a PE Size of 4 and PE Free at 136 so my total MB can be 544 to extend.

My Vol8 has 23 PE so the Vol is currently 92MB

So to double the size I would type...

lvextend -L 401 /dev/vg00/lvol8

How do I check to see if I have FSADM on our server?

I typed fsadm and received...

fsadm: not specified
usage: fsadm [-F FStype] [-V] [-o specific_options] special

If I do have it then I type
fsadm -b 1032M /opt

How do you retrieve the last command? What key(s) to press? I tried the up arrow but that didn't work. Currently I am accessing the server via Reflection, VT320
Marco Santerre
Honored Contributor

Re: Increasing a Volume

Actually if you want to double the size you have to type the total amount that your logical volume will have after the addition so :

lvextend -L 1000 /dev/vg00/lvol8

and to see if you have Online JFS, you just have to do

#swlist -l product|grep Adv

if Advanced JFS shows up, you're in business and can do the fsadm -F vxfs -b 1024000 /opt
Cooperation is doing with a smile what you have to do anyhow.
Helen French
Honored Contributor

Re: Increasing a Volume

For the last question:

The parameter after -L should be in Mbytes. If you want to specify -l, then use the LE numbers.

# lvextend -L 500 lv_name will increase the space to 500MB.

# swlist -l product - will tell you if you have Online JFS installed on the system. If yes, you can use fsadm command for extending it.

"Esc+k" will repeat the last command you typed. Also use 'vi' commands for operations - h, j, k and l for moving.
Life is a promise, fulfill it!