Operating System - HP-UX
1833758 Members
3485 Online
110063 Solutions
New Discussion

Re: Increasing size of existing filesystem

 
SOLVED
Go to solution
Phil Storer
Advisor

Increasing size of existing filesystem

Can someone confirm that the following is the correct way to increase the size of a file system. There's plenty of free space on the volume group.

==> lvextend -L 500 /dev/vg01/lvol1
==> umount the filesystem associated with the logical volume
==> extend filesytem i.e. extendfs /dev/vg01/lvol1
==> remount the filesystem



12 REPLIES 12
Michael Tully
Honored Contributor
Solution

Re: Increasing size of existing filesystem

Yes this is correct providing that the existing logical volume does not have any special features like strict/contigous. You can check by using the 'lvdisplay -v /dev/vg01/vg01' command.

Also if you have the OnLine JFS product it is possible to extend it on the fly, using the 'fsadm' command.
Anyone for a Mutiny ?
Con O'Kelly
Honored Contributor

Re: Increasing size of existing filesystem

Hi Phil

Yes thats correct.
Be aware that the "-L" option specifies the new size of the Logical Volume rather than the amount to increase it by.

Obviously if you have On-line JFS you do not need to unmount the filesystem and can use the fsadm command to extend the filesystem.

Cheers
Con
Karthik S S
Honored Contributor

Re: Increasing size of existing filesystem

Be aware that the new size of the LV will be 500MB. Often people are confused with that. If you are having a 500MB LV and you want to extend it by 500MB then the switch should read "-L 1000".

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Phil Storer
Advisor

Re: Increasing size of existing filesystem

I did notice that the output of lvdisplay -v on the logical volume show's the Allocation as strict. Will this cause problems with the extension of the file system?
Michael Tully
Honored Contributor

Re: Increasing size of existing filesystem

yes it will. WHat is the existing logical volume used for?

If I suspect it is / or /stand or primary swap, these should be strict.
You want to create a new volume if possible and the defaults will not it strict. It is also possible to change the strict flag, but use caution.
Anyone for a Mutiny ?
Jeroen Peereboom
Honored Contributor

Re: Increasing size of existing filesystem

Strict means that mirrors of logical extents will not be on the same phyiscal volume ( or even volumegroup).

So you must check if all physical volumes used by your logical volume have enough space.

JP.
Jeroen Peereboom
Honored Contributor

Re: Increasing size of existing filesystem

By the way,

you may also use SAM to do this for you, but the filesystem must be 'unmountable'

JP.
Gerhard Roets
Esteemed Contributor

Re: Increasing size of existing filesystem

By definition you should also have the space available in the VG ;)

500Mb if it is a "vanilla lv" but more if mirrored. The space will also change depending on special attributes bound to this LV.
Phil Storer
Advisor

Re: Increasing size of existing filesystem

Michael,
The logical volume is used for application software and user's home directories. mounted on /d01.
As you hinted it is possible to remove the 'Allocation=strict' entry. How do I do that?
Phil Storer
Advisor

Re: Increasing size of existing filesystem

Forgot to mention that the logical volume is not mirrored so I'm not sure how it's set to strict
Michael Tully
Honored Contributor

Re: Increasing size of existing filesystem

The answer is in the 'lvchange' command.

This should do it:

# lvchange -s n /dev/vg01/lvolX

How it got that way, well someone must have set it that way. When an lv is created, the strict option is not used as part of the default setting. Once you have removed the 'strict' allocation policy, you should be okay in extending the volume. Have a look at the man pages for both lvcreate/lvextend/lvchange
Anyone for a Mutiny ?
Con O'Kelly
Honored Contributor

Re: Increasing size of existing filesystem

Hi Phil

I'd actually say in your case that if your Logical Volume is not mirrored you don't need to worry about the strict option. It only applies to mirrored volumes.
When an LV is created then "strict" is the default.

A problem might only arise if the volume is mirrored or is contiguous.

The command you have will increase the LV to 500MB. This will work perfectly if you have the space free in the Volume Group.

Cheers
Con