Operating System - HP-UX
1830657 Members
28704 Online
110015 Solutions
New Discussion

How to use online jfs to extend a filesystem?

 
SOLVED
Go to solution
BrianDoyle
Trusted Contributor

How to use online jfs to extend a filesystem?

Hi,

I need to extend of our filesystems need from 2GB to 5GB.
Is online jfs the best way to do it?

In CommandView EVA the vdisk it shows the "Allocated Capacity", it also has a place to enter the "Requested Capacity". Is it as simple as entering 5GB in here.(After umounting and unpresenting the vdisk first).
5 REPLIES 5
Pete Randall
Outstanding Contributor

Re: How to use online jfs to extend a filesystem?

Berd
Trusted Contributor
Solution

Re: How to use online jfs to extend a filesystem?

You are talking about two different things here. The storage presented via the EVA, and what is available to the filesystem.

Use vgdisplay ti identify the free space in your volume group. If you have 3GB spare, and Online JFS on your box, then

lvextend -L
fsadm -F vxfs -b M

so

lvextend -L 5120 /dev/vg00/your_lvol
fsadm -F vxfs -b 5120M /your mount point

If you do not have sufficient free space in your volume group, then you will need to present further disk from your array.

HTH

Berd
Matti_Kurkela
Honored Contributor

Re: How to use online jfs to extend a filesystem?

If you can afford to umount the disk, OnlineJFS is not necessary.

I assume you need to extend the filesystem without losing the current data.

There are multiple levels you should think about: the storage (EVA) level, the HP-UX LVM level and the filesystem level.

On the storage level, you may be able to increase the size of an existing vdisk easily; however, HP-UX LVM will not understand that the size of a PV has changed.

Instead, you will have to define and present *additional* vdisks and use the LVM level to join them to your existing volume group. This is the normal procedure.

You need to check the parameters of the LVM volume group you intend to change: some of these parameters cannot be changed after volume group creation.

If your filesystem is located e.g. on "/dev/vgNAME/lvolX", run "vgdisplay vgNAME" to see how much extra space the VG can accept. The interesting things are "Max PV", "Cur PV", "Max PE per PV" and "PE Size".

If your "Cur PV" is equal to "Max PV", you cannot add any more disk space to your volume group. Your only option then is to backup the data, destroy the volume group and recreate it with different parameters (hopefully leaving enough room for future expansion).

Without destroying and rebuilding the volume group, you can add at most
(Max LV) - (Cur LV)
individual vdisks, and each of them can be at most
(Max PE per PV) * (PE Size)
megabytes in size.

First, you define one or more new vdisks at the storage level as necessary. They should appear as new disk devices in HP-UX ioscan listing. When you can see the new vdisks in ioscan, run "insf" to create device files for the new vdisks. (Take care to remember which devices are the new ones!)

After that, you use "pvcreate" command to initialize the new disks, then "vgextend" to join them to your old volume group. All these things can be done while the system is running and the disk is mounted.

After all this is done, you should note that the unallocated capacity (Free PE) in the vgdisplay listing has increased. Now you can proceed with extending the logical volume and then the filesystem contained in the logical volume.

First, run
"lvextend -L /dev/vgNAME/lvolX"
to extend the logical volume. This can always be done while the filesystem is mounted.

If you have OnlineJFS installed, you can then run
"fsadm -F vxfs -b /mountpoint"
to extend the filesystem without umounting it.

If you don't have OnlineJFS, you'll have to umount the filesystem, run
"extendfs /dev/vgNAME/lvolX"
and then mount the filesystem again.

The order of the operations is important: when extending a filesystem, always extend the underlying LV first. If you're reducing a filesystem, use the reverse order: the filesystem must *NEVER* be bigger than the underlying LV.
MK
Patrick Wallek
Honored Contributor

Re: How to use online jfs to extend a filesystem?

Please be aware that you cannot extend a LUN on your EVA and have HP-UX use the additional space. HP-UX does not support that at this time.

What you must do if you don't have unallocated space in your VG is:

1) Create another LUN on the EVA and present it to the HP-UX server.
2) Make sure HP-UX sees the LUN and can access it. Create appropriate device files.
3) Add the new LUN to your VG. (vgextend)
4) Extend you LV. (lvextend)
5) Extend the filesystem. (fsadm -b)
BrianDoyle
Trusted Contributor

Re: How to use online jfs to extend a filesystem?

exported the VG then recreates it from start- quicker