UnixPedia : HPUX / LINUX / SOLARIS: HPUX : Extending a File system

Sunday, September 28, 2014

HPUX : Extending a File system

Extending a File system


Login to the system and follow the procedure given below for extending a filesystem.

1. # bdf /<filesystem to extend>

From the output of the above command note the volume group and logical volume associated with the filesystem.

Check if the VG has the required space to extend the logical volume.

2. # vgdisplay <vg name>

Note the following two parameters from the vgdisplay output.

PE Size (Mbytes)
Free PE

Available free space (in Mb) in the volume group = PE Size (Mbytes) x Free PE

If the VG Status is “available, exclusive” then the VG is cluster aware. If any changes are done to the VG status then the WI for (Extending a file system on a Cluster node.) has to be followed after the last step in this WI.

VG Status available, exclusive

Check if the logical volume that needs to be extended is mirrored.

3. # lvdisplay <lv name>

Note the following 2 parameters from the lvdisplay output.

Mirror copies 1
Allocation PVG-strict

In the case the logical volume is mirrored, then the available free space in the VG should be considered as half of the available free space:
Available free space (in Mb) in the volume group / 2

Also it is a good practice to confirm if the system has Online JFS installed. If not you will need to ask downtime (for the particular file system), from the customer, to extend it.

4. # swlist –l product | grep -i jfs
B3929BA B.11.00 HP OnLineJFS (Advanced VxFS)

If the available space in the VG is enough to extend the LV jump to step 8.

If the space available in the VG doesn’t fit the requirement, request Data Storage team to assign new LUN’s. (follow the WI Creating a Change request for requesting new LUNs” and “Configuring newly assigned LUN on a system”)

Before proceeding for pvcreate confirm the following:

a. Check the size of the disk that you will be adding to the existing VG -

# diskinfo /dev/rdsk/c20t6d2 | grep size
size: 35354880 Kbytes

b. Check the size of disk that can be added to the existing VG –

# vgdisplay vgsap |grep -i -e 'max pe' -e 'pe size'
Max PE per PV 1016
PE Size (Mbytes) 16

The size of the disk that can be added to the VG is = Max PE per PV x PE Size (Mbytes)

In our example the disk with size (1016x16) 16256 Mb can be added. So the

c. Check if the disk/s being configured in the VG are not already in use by another VG, this is just to make double sure you are looking at the correct disks.

5. # strings /etc/lvmtab | grep cXtYdZ

If the above command returns an output then you need to verify if you are looking at the correct disk. Proceed only after confirming.

6. # pvcreate /dev/rdsk/cXtYdZ (use -f option if required to force pvcreate)

Load balancing:
With vgdisplay –v <vgname>, note the sequence of disks under --- Physical volumes ---, and decide which device will be the next primary path.

Considering the output from the above point, extend the VG with the device file of the disk that will be the primary link, first.

7. # vgextend vgname /dev/dsk/<primary path> /dev/dsk/<secondary path>

Note: If powerpath is installed then do not use the alternate link.

Check for powerpath package installed.

# powerrmt display dev=all
If powerpath is installed then it will show the output.

For logical volumes with Allocation policy PVG-strict; edit the /etc/lvmpvg file to add the entry of the device file of the primary link.

8. # lvextend –L <size in Mb> /dev/vgname/lvoln pv_path
<size in Mb> = Total of (Current LV Size (Mbytes) + Add-on size in Mb)

9. # fsadm –b (size in Mb)M /<filesystem name> (use the same value as used in lvextend)

check the outputs of vgdisplay , lvdisplay and bdf to confirm.


Know errors with fsadm

Error:
fsadm -F vxfs -b 4096M /<file system name>
vxfs fsadm: /dev/vgsamba/rlvol1 is currently 2097152 sectors - size will be increased
vxfs fsadm: attempt to resize /dev/vgsamba/rlvol1 failed with errno 28

Solution:
If fsadm returns error 28 while trying to grow a VxFS file system, check to see if the file system is full or almost full. fsadm needs some work space to grow the file system. File system usage can be verified using the df command:
df –F vxfs –k
If error 28 is returned, first try to grow the file system in small increments until there is enough free space to grow to the full amount. If this does not work because the file system is completely full, it will be necessary to delete some files to free up space*. Occasionally, error
28 will be returned even when the file system does not seem to be full. This is usually caused by excessive fragmentation and can be avoided by defragmenting the file systems regularly.

*Move the files to a temporary location and back when the file system is extended


If fsadm fails with error 16 while attempting to resize the file system, one of three conditions exists:
1.) the file system is too busy to be resized
2.) the file system has a snapshot file system mounted on it
3.) the file system has some corruption and needs to be fsck’d

If error 16 occurs, try the following procedures to resolve the problem:
1.) try resizing the file system when it is less busy
2.) verify a snapshot file system is not mounted on it
3.) try unmounting the file system, running fsck, and mounting the file system again


Occasionally, shrinking a file system will fail because inodes and blocks that cannot be moved are allocated in the part of the file system
to be shrunk. When this occurs, defragmenting the file system is necessary. Once again, those situations can be avoided by
defragmenting file systems regularly using fsadm,

1 comment:

  1. Thanks for sharing this important information. You may also refer http://www.s4techno.com/blog/2016/06/17/extend-vxvm-filesystem/

    ReplyDelete