UnixPedia : HPUX / LINUX / SOLARIS: September 2014

Tuesday, September 30, 2014

HPUX : How to remove the one LE via fsadm and lvreduce method



  How to remove the one LE via  fsadm and lvreduce method

How to remove the one LE via  fsadm and lvreduce method.  If data is fragmented , it is Good advice to  run  defragmentation  step before   going   for shrinking of File system.

[root@sandbox:/tmp]#
#-> bdf /usr
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol9    8388608 3968860 4143896   49% /usr
[root@sandbox:/tmp]#
#-> vgdisplay /dev/vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      14    
Open LV                     14    
Max PV                      16      
Cur PV                      2     
Act PV                      2     
Max PE per PV               5000        
VGDA                        4  
PE Size (Mbytes)            16       ----------one PE size.        
Total PE                    8748   
Alloc PE                    7026   
Free PE                     1722   
Total PVG                   0       
Total Spare PVs             0             
Total Spare PVs in use      0                    

[root@sandbox:/tmp]#
#-> lvdisplay -v /dev/vg00/lvol9 |tail
   00503 /dev/dsk/c2t1d0    02645 current  /dev/dsk/c2t0d0    02773 current 
   00504 /dev/dsk/c2t1d0    02646 current  /dev/dsk/c2t0d0    02774 current 
   00505 /dev/dsk/c2t1d0    02647 current  /dev/dsk/c2t0d0    02775 current 
   00506 /dev/dsk/c2t1d0    02648 current  /dev/dsk/c2t0d0    02776 current 
   00507 /dev/dsk/c2t1d0    02649 current  /dev/dsk/c2t0d0    02777 current 
   00508 /dev/dsk/c2t1d0    02650 current  /dev/dsk/c2t0d0    02778 current 
   00509 /dev/dsk/c2t1d0    02651 current  /dev/dsk/c2t0d0    02779 current 
   00510 /dev/dsk/c2t1d0    02652 current  /dev/dsk/c2t0d0    02780 current 
   00511 /dev/dsk/c2t1d0    02653 current  /dev/dsk/c2t0d0    02781 current 

[root@sandbox:/tmp]#
#->  
[root@sandbox:/tmp]#
#->
[root@sandbox:/tmp]#
#-> lvdisplay /dev/vg00/lvol9
--- Logical volumes ---
LV Name                     /dev/vg00/lvol9
VG Name                     /dev/vg00
LV Permission               read/write  
LV Status                   available/syncd           
Mirror copies               1           
Consistency Recovery        MWC                
Schedule                    parallel    
LV Size (Mbytes)            8192           
Current LE                  512      
Allocated PE                1024       
Stripes                     0      
Stripe Size (Kbytes)        0                  
Bad block                   on          
Allocation                  strict                   
IO Timeout (Seconds)        default            

[root@sandbox:/tmp]#
#-> bc
8192-16
8176
[root@sandbox:/tmp]#
#-> fsadm -b 8176M /usr
fsadm: /etc/default/fs is used for determining the file system type
vxfs fsadm: /dev/vg00/rlvol9 is currently 8388608 sectors - size will be reduced
vxfs fsadm: allocations found in shrink range, moving data
[root@sandbox:/tmp]#
#-> bdf /usr
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol9    8372224 3968860 4128536   49% /usr
[root@sandbox:/tmp]#
#-> lvreduce -L 8176  /dev/vg00/lvol9
When a logical volume is reduced useful data might get lost;
 do you really want the command to proceed (y/n) : y
Logical volume "/dev/vg00/lvol9" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
[root@sandbox:/tmp]#
#-> lvdisplay /dev/vg00/lvol9       
--- Logical volumes ---
LV Name                     /dev/vg00/lvol9
VG Name                     /dev/vg00
LV Permission               read/write  
LV Status                   available/syncd          
Mirror copies               1           
Consistency Recovery        MWC                
Schedule                    parallel    
LV Size (Mbytes)            8176           
Current LE                  511      
Allocated PE                1022       
Stripes                     0      
Stripe Size (Kbytes)        0                  
Bad block                   on          
Allocation                  strict                   
IO Timeout (Seconds)        default            

[root@sandbox:/tmp]#
#->  lvdisplay -v /dev/vg00/lvol9 |tail
   00502 /dev/dsk/c2t1d0    02644 current  /dev/dsk/c2t0d0    02772 current 
   00503 /dev/dsk/c2t1d0    02645 current  /dev/dsk/c2t0d0    02773 current 
   00504 /dev/dsk/c2t1d0    02646 current  /dev/dsk/c2t0d0    02774 current 
   00505 /dev/dsk/c2t1d0    02647 current  /dev/dsk/c2t0d0    02775 current 
   00506 /dev/dsk/c2t1d0    02648 current  /dev/dsk/c2t0d0    02776 current 
   00507 /dev/dsk/c2t1d0    02649 current  /dev/dsk/c2t0d0    02777 current 
   00508 /dev/dsk/c2t1d0    02650 current  /dev/dsk/c2t0d0    02778 current 
   00509 /dev/dsk/c2t1d0    02651 current  /dev/dsk/c2t0d0    02779 current 
   00510 /dev/dsk/c2t1d0    02652 current  /dev/dsk/c2t0d0    02780 current 

[root@sandbox:/tmp]#
#->

Monday, September 29, 2014

HPUX :vmunix: vxfs: WARNING: msgcnt 3 mesg 014: V-2-14: vx_iget - inode table overflow


Error Message :
vmunix: vxfs: WARNING: msgcnt 1 mesg 014: V-2-14: vx_iget - inode table overflow
vmunix: vxfs: WARNING: msgcnt 1 mesg 014: V-2-14: vx_iget - inode table overflow
vmunix: vxfs: WARNING: msgcnt 2 mesg 014: V-2-14: vx_iget - inode table overflow
vmunix: vxfs: WARNING: msgcnt 2 mesg 014: V-2-14: vx_iget - inode table overflow
vmunix: vxfs: WARNING: msgcnt 3 mesg 014: V-2-14: vx_iget - inode table overflow
vmunix: vxfs: WARNING: msgcnt 3 mesg 014: V-2-14: vx_iget - inode table overflow
vmunix: vxfs: WARNING: msgcnt 4 mesg 014: V-2-14: vx_iget - inode table overflow

You can monitor the inode usage using vxfsstat command.
"/opt/VRTS/bin/vxfsstat -i / " command will provide you the inode cache statistics. If the inode usage is high, it's recommended to increase it.
And yes, if it's too inode cache is too low, it may cause system hang.
It may be possible that the inode cache filling up could cause the system to hang.  If a new process starts and cannot add needed entry into the inode cache, then I can see what that would cause an application to hang or cause the system to appear to hang.
 
# kctune vx_ninode
Tunable Value Expression Changes
vx_ninode 40000 40000 Immed
# kctune vx_ninode=131072
==> Update the automatic 'backup' configuration first? once
* The automatic 'backup' configuration has been updated.
* Future operations will ask whether to update the backup.
* The requested changes have been applied to the currently
running configuration.
Tunable Value Expression Changes
vx_ninode (before) 40000 40000 Immed
(now) 131072 131072
# kctune vx_ninode
Tunable Value Expression Changes
vx_ninode 131072 131072 Immed

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,

Configuring newly assigned LUN on a system.

Configuring newly assigned LUN on a system.
(LUN from HP Storage)


The storage team will mention the CU:LDev number of the LUN/s assigned, in the change request.

Examples of log comment from storage group:
Added 1 X LUN to TPW nlxhnk20 - details are...
/dev/rdsk/c11t9d7 cc 09 4f CL1B 07:2f OPEN-E 00063057
/dev/rdsk/c21t9d7 b1 09 4f CL2B 07:2f OPEN-E 00063057
Where 07:2f is the number of the disk and 00063057 is the number of the storage box.

OR”
06:5c
06:c5
07:26
07:2d

Check if the new devices are seen on the system, else to create new device files for the new assigned LUN’s, execute the commands:

# ioscan –fnC disk
# insf –v

Always use insf –v to create device files for new devices connected to the system. It is not good to run insf –e, as it will over write any manually created device files.

Note: only if insf –v does not work try 'insf -ev' to force re-scanning of all devices

The insf command installs special files in the devices directory, normally /dev. If required, insf creates any subdirectories that are defined for the resulting special file. If no options are specified, special files are created for all new devices in the system. New devices are those devices for which no special files have been previously created. A subset of the new devices can be selected with the -C, -d, and -H options. With the -e option, insf reinstalls the special files for pseudo-drivers and existing devices. This is useful for restoring special files when one or more have been removed. Normally, insf displays a message as the special files are installed for each driver. The -q (quiet) option suppresses the installation message. The -v (verbose) option displays the installation message and the name of each special file as it is created.

# auopath discover
# autopath display all | grep Details | awk '{print $5}' > /opt/Autopath/disklist
# for DISK in `cat /opt/Autopath/disklist`
do
autopath set_lbpolicy SST ${DISK}
done

The autopath set_lbpolicy command sets the load balance policy for the specified device path.

# autopath display all (to check)
# xpinfo –il | grep 07:2f

/dev/rdsk/c11t9d7 cc 09 4f CL1B 07:2f OPEN-E 00063057
/dev/rdsk/c21t9d7 b1 09 4f CL2B 07:2f OPEN-E 00063057

Confirm with ioscan if the new disk/s are seen ok.
Configuring newly assigned LUN on a system.
(LUN from EMC Storage)


The storage team will mention the LUN id and the hardware address of the LUN’s assigned.

Access to an EMC LUN was set up as follows:
EMC LUN 9E0 should be visible to nlscuxj1 as target 0.12.1
OR
7 luns have been assigned as follows....
EMC luns 314/8/C 320/4/8/C should be visible as target 'X'1d2-1e0 (i.e. 1.d=13.2 to 1.e=14.0)
1.13.3, 1.13.3……1.13.7 & 1.14.0, 1.14.1…….1.14.7

NOTE: ‘X’ denotes the number following is Hexadecimal

# ioscan -fnCdisk | awk '/0\.12\.1/{print;getline;print;}'

disk    202  1/0/12/1/0/4/0.48.56.0.0.12.1  sdisk    CLAIMED     DEVICE       EMC     SYMMETRIX
disk    203  1/0/14/1/0/4/0.52.56.0.0.12.1  sdisk    CLAIMED     DEVICE       EMC     SYMMETRIX

If the device files for the new devices are not listed, create the device files with the command;

# insf -v

insf: Installing special files for sdisk instance 261 address 1/0/12/1/0/4/0.48.56.0.0.12.1
insf: Installing special files for sdisk instance 260 address 1/0/14/1/0/4/0.52.56.0.0.12.1 


# ioscan -fnCdisk | awk '/0\.12\.1/{print;getline;print;}'

disk    202  1/0/12/1/0/4/0.48.56.0.0.12.1  sdisk    CLAIMED     DEVICE       EMC     SYMMETRIX
                            /dev/dsk/c24t12d1   /dev/rdsk/c24t12d1
disk    203  1/0/14/1/0/4/0.52.56.0.0.12.1  sdisk    CLAIMED     DEVICE       EMC     SYMMETRIX
                            /dev/dsk/c22t12d1   /dev/rdsk/c22t12d1

Note: Two device files are created for the same device, this is because of two physical paths for the same device i.e. Alternate links

This can be confirmed with the command:

# syminq | grep t12d1

          Device                   Product                   Device
------------------------- --------------------------- ---------------------
Name               Type   Vendor    ID           Rev  Ser Num      Cap (KB)
------------------------- --------------------------- ---------------------
/dev/rdsk/c24t12d1 M(4)   EMC       SYMMETRIX    5671 99009E0000   35354880

# syminq /dev/rdsk/c22t12d1

Device Product Device
------------------------- --------------------------- ---------------------
Name Type Vendor ID Rev Ser Num Cap (KB)
------------------------- --------------------------- ---------------------
/dev/rdsk/c22t12d1 M(4) EMC SYMMETRIX 5671 99009E0000 35354880


# syminq | grep t12d1

/dev/rdsk/c22t12d1 M(4) EMC SYMMETRIX 5671 99009E0000 35354880
/dev/rdsk/c24t12d1 M(4) EMC SYMMETRIX 5671 99009E0000 35354880
Where the serial # for the device means

99009E0000 = DMXid 00 LUNid 000