Operating System - HP-UX
1837785 Members
3608 Online
110119 Solutions
New Discussion

Re: Increase logical volume, how much space left

 
SOLVED
Go to solution
Ratzie
Super Advisor

Increase logical volume, how much space left

I am running short on a partition and need to increase the size. I know when I created the server that I left some drive space, and did not allocate it it all.

Question is I forgot how to find out, lets day out of a 72GB drive is left for me to use.

I also need to extend a logical volume by 4GB, but how do I do that? Where? Does the server need to be rebooted?

/dev/vg00/lvol9 2048000 482982 1467264 25% /opt/app/oracle/archivelog/database

This partition will fill up completely when I tried to test backups.
10 REPLIES 10
Pete Randall
Outstanding Contributor

Re: Increase logical volume, how much space left

Take a look at the output of "vgdisplay vgname". You'll see Total PE, Free PE and PE size. The number of free PEs times the PE size will tell you how much free space there is.


Pete

Pete
Jeff Schussele
Honored Contributor
Solution

Re: Increase logical volume, how much space left

Hi,

vgdisplay is the command to determine free space

vgdisplay /dev/vg_name

Check the "Free PE" field & if it's >0 then multiply that by the "PE Sizs (Mbytes)" value for the total amount free.
Then just extend the LV to the desired size with

lvextend -L XXXXXM /dev/vg_name/lv_name

where XXXXX is the value in Megabytes you want to become - NOT the addition but the new total size.
At that point IF you have OnLineJFS you can extend the filesystem with

fsadm -F vxfs -b XXXXXM /mnt_point

again where XXXXX is the new total size.
If you don't have OnLineJFS you'll need to unmount the FS & use extendfs to increase it & then remount it.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Etienne Roseau
Frequent Advisor

Re: Increase logical volume, how much space left

hi,
no many things to add; except :
if you resize you FS by line commands, obviously you have to check your sys-space with lvdisplay / vgdisplay...
put a # in the /etc/fstab and unmount it.
when recreate, mount it, drop the #, and check the /etc/mnttab.
otherwise, SAM will do everything for you.
see the doc attached.
if you need translation, i'll do !
hope it will help !
Geoff Wild
Honored Contributor

Re: Increase logical volume, how much space left

No reboot - but you shouldn't have oracle on vg00!

vg00 should just be for the OS.

Should have a separate disk for oracle.

Anyways,

vgdisplay -v /dev/vg00

Look at:

PE Size (Mbytes) 8
Total PE 8680
Alloc PE 5010
Free PE 3670

multiply Free by Size - if for then 4GB, then:

Looks like lvol9 is 2GB

so,

lvextend -L 6144 /dev/vg00/lvol9
fsadm -b 6144M /opt/app/oracle/archivelog/database

That't if you have online jfs, else you will have to shutdown oracle, umount opt/app/oracle/archivelog/database, lvextend -L 6144 /dev/vg00/lvol9, extendfs /opt/app/oracle/archivelog/database

Rgds...Geoff


Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Ratzie
Super Advisor

Re: Increase logical volume, how much space left

how do you know if you have online jfs
john kingsley
Honored Contributor

Re: Increase logical volume, how much space left

# swlist -l fileset | grep -i onlinejfs

output on my machine:
# Online JFS B.11.11 Online features of the VxFS File System
OnlineJFS B.11.11 VxFS File System
Hein van den Heuvel
Honored Contributor

Re: Increase logical volume, how much space left


As others replies, vgdisplay is your main tool to help resolve this. But it is cryptic (PE vs MB) and verbose (many lines).
I like my information more dense and so i created a perl script to help me understand vgdisplay info more readily. I use it 'all the time' maybe it helps you too?

I'll include it, and attach it (nicer spacing).

Hein.

print "Type Name Allocated Total Free\n";
print "----- ----------------------------- -------- -------- --------\n";
foreach $_ (`/usr/sbin/vgdisplay -v`) {
if (/ PVG /) {
$pvg = 1; # Don't know what to do with Private Volume Groups
next;
}
if ($pvg) {
next unless (/^$/);
$pvg = 0;
}

if (/^(\s*\w\w) Name\s+(\S+)/) {
$type = $1;
$name = $2;
$name =~ s/\/dev//;
if ($type =~ /LV/) {
$stripes = 0;
foreach $_ (`/usr/sbin/lvdisplay /dev$name`) {
$stripes = $1 if (/^Stripes\s+(\d+)/);
$ssize = $1 if (/^Stripe S.*\s(\d+)/);
}
$name .= " $stripes x $ssize" if ($stripes);
}
}
if (/^PE Size \(Mbytes\)\s+(\w+)/) {
$pe = $1;
$name = sprintf ("%-28s%2d", $name, $pe);
}
$alloc = int($1) if (/Allo.* PE\s+(\w+)/);
$total = int($1) if (/Total PE\s+(\w+)/);
$free = int($1) if (/Free PE\s+(\w+)/);
if (/^$/) {
if ( 0 == $alloc + $total + $blank_line++) {
print "\n";
} else {
printf ("%-6s%-30s%9d%9d%9d\n",
$type, $name, $pe * $alloc, $pe * $total, $pe * $free);
}
$name = $type = " ";
$alloc = $total = $free = $blank_line = 0;
}
}
Jan Sladky
Trusted Contributor

Re: Increase logical volume, how much space left

you can figure out by mount -v command (fs has to be mounted before)

if fs is unmouted you will use

fstype /dev/vg00/lvol1

br Jan


GSM, Intelligent Networks, UNIX
Petr Simik_1
Valued Contributor

Re: Increase logical volume, how much space left

Hi,
I use man lvextend and there is example step-by-step how to extend LV. Works good.

Increase the size of a file system existing on a logical volume.

First, increase the size of the logical volume.
lvextend -L 400 /dev/vg06/lvol3

Unmount the file system.
umount /dev/vg06/lvol3

Extend the file system to occupy the entire (larger) logical volume.
extendfs /dev/vg06/rlvol3

Remount the file system.
mount /dev/vg06/lvol3 /mnt
Ratzie
Super Advisor

Re: Increase logical volume, how much space left

Thanks