Operating System - HP-UX
1834249 Members
2071 Online
110066 Solutions
New Discussion

Re: How do I add space to a file system?

 
SOLVED
Go to solution
David Heard
Occasional Advisor

How do I add space to a file system?

How do I add space to a file system?
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: How do I add space to a file system?

lvextend
extendfs
-or, if you have online jfs-
lvextend
fsadm


Pete

Pete
TommyT
Valued Contributor

Re: How do I add space to a file system?

Hi!
You can allways use SAM.

//Tommy
tompa
Mark Grant
Honored Contributor
Solution

Re: How do I add space to a file system?

echo " " > /filesystem

Sorry, couldn't help it.

What do you mean by adding space? If you mean you want to increase it, then you need to increase the logical volume it sits on "lvextend" and then increase the filesystem "fsadm". If you have OnlineJFs then you can do this online, otherwise you need to unmount the filesystem first.

Youcan see that there are a few more question here that perhaps you could answer for us. Also, do you have any free space in the volume group or are you going to add more disks.

Never preceed any demonstration with anything more predictive than "watch this"
John Carr_2
Honored Contributor

Re: How do I add space to a file system?

Hi

it also depends which file system if you are not using JFS you cannot extend root or stand on the fly.

which file system do you wish to extend ?

John.
Jeff Schussele
Honored Contributor

Re: How do I add space to a file system?

Hi David,

To add space to an FS:

1) Determine if free space left in VG
vgdisplay -v /dev/vg_name
IF NOT - add a disk to VG
vgextend /dev/vg_name /dev/dsk/cXtYdZ

2) Extend the LV with the new space
lvextend -L XXXX /dev/vg_name/lv_name
where XXXX=new size in MB - must be larger than existing size of course

3) If you have OnLine JFS - extend the FS on the fly
fsadm -F vxfs -b XXXXM /mnt_point
where XXXX equals new, larger size & the "M" tells the command it's in MB

If you don't have OnLine JFS you'll have to unmount the FS before the lvextend commans & use
extendfs -F vxfs /dev/vg_name/lv_name
to extend the FS - it will use the entire new larger size by default & then mount the FS again & check the size

As you can see it's much easier w/OnLine JFS.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
John Carr_2
Honored Contributor

Re: How do I add space to a file system?

remember to backup your file system before extending - play safe :-)

John.
Geoff Wild
Honored Contributor

Re: How do I add space to a file system?

That depends...

Is there room left in the VG?

# vgdisplay /dev/vgXX

Check "Free PE"

If no - then you need to add more disk.

If yes, then what is your "PE Size (Mbytes)"

Multiply that by the "Free PE"

Next, lvdisplay /dev/vgXX/lvolXX

If "Allocation" is "strict/contiguous" - then you can only add to it if there are extents immediatley following that lvol...

If it's just "strict" - you are in business....

Do you have Online JFS?

If yes:

lvextend -L /dev/vgXX/lvolXX
fsadm -b M /filesystemmountpoint

If no, un mount the file system, then:
lvextend -L /dev/vgXX/lvolXX
extendfs -L /dev/vgXX/rlvolXX

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.