Search This Blog

Sunday, November 10, 2013

vxfs fsadm: attempt to resize......failed with errno 28

When extending the filesystem online using fsadm command its failing with below error:

# fsadm -F vxfs -b 10240M /fs_test 
vxfs fsadm: /dev/vg00/rfstest is currently 5636096 sectors - size will be increased
vxfs fsadm: attempt to resize /dev/vg00/rfstest failed with errno 28 
vxfs fsadm:  Retry the operation after freeing up some space

Error number 28 means ENOSPC from /usr/include/sys/errno.h
#define ENOSPC          28      /* No space left on device      */


Why is the ENOSPC
error while running fsadm even though there is enough free space on the filesystem?
Solution
NOTE: If a file system is full, busy or too fragmented, the resize operation may fails.

Follow the below steps to extend the filesystem online using fsadm :
Checked and found filesystem is heavily fragmented. As it can be seen from the above output that there is no free extent of 8KB or above.

# fsadm -F vxfs -D -E /fs_test 

  Directory Fragmentation Report
             Dirs        Total      Immed    Immeds   Dirs to   Blocks to
             Searched    Blocks     Dirs     to Add   Reduce    Reduce
  total          2887      1996      2131         0         3          99

  Extent Fragmentation Report
        Total    Average      Average     Total
        Files    File Blks    # Extents   Free Blks
        47977          85           5     1513016
    blocks used for indirects: 26820
    % Free blocks in extents smaller than 64 blks: 100.00
    % Free blocks in extents smaller than  8 blks: 100.00
    % blks allocated to extents 64 blks or larger: 90.52
    Free Extents By Size
           1:     215670            2:     221005            4:     213834
           8:          0           16:          0           32:          0
          64:          0          128:          0          256:          0
         512:          0         1024:          0         2048:          0
        4096:          0         8192:          0        16384:          0
       32768:          0        65536:          0       131072:          0
      262144:          0       524288:          0      1048576:          0
     2097152:          0      4194304:          0      8388608:          0
    16777216:          0     33554432:          0     67108864:          0
   134217728:          0    268435456:          0    536870912:          0
  1073741824:          0   2147483648
Ran the defragmentation on the filesystem.

# fsadm -F vxfs -d -e /fs_test 
NOTE: Defragmentation can take long time depending on the degree of fragmentation, disk speed and number of inodes in the filesystem. In this case it took about 45 min. More information is available on man 1M fsadm_vxfs command.
Fragmentation report after defragmentation of filesystem:

# fsadm -F vxfs -D -E /fs_test 

  Directory Fragmentation Report
             Dirs        Total      Immed    Immeds   Dirs to   Blocks to
             Searched    Blocks     Dirs     to Add   Reduce    Reduce
  total          2887      1879      2131         0         2           5

  Extent Fragmentation Report
        Total    Average      Average     Total
        Files    File Blks    # Extents   Free Blks
        47977          84           1     1539889
    blocks used for indirects: 48
    % Free blocks in extents smaller than 64 blks: 4.94
    % Free blocks in extents smaller than  8 blks: 0.52
    % blks allocated to extents 64 blks or larger: 91.40
    Free Extents By Size
           1:       1029            2:       1144            4:       1165
           8:       1319           16:       1253           32:       1170
          64:       1023          128:        879          256:        611
         512:        388         1024:        171         2048:         89
        4096:         36         8192:         12        16384:          4
       32768:          4        65536:          0       131072:          1
      262144:          0       524288:          0      1048576:          0
     2097152:          0      4194304:          0      8388608:          0
    16777216:          0     33554432:          0     67108864:          0
   134217728:          0    268435456:          0    536870912:          0
  1073741824:          0   2147483648:          0
Now its looks much better. Free extents are larger blocks.
Tried extending the filesystem now using fsadm command and its successful now:

# fsadm -F vxfs -b 10485760 /fs_test
UX:vxfs fsadm: INFO: V-3-25942: /dev/vg00/rfstest size increased from 5636096 sectors to 10485760 sectors

# bdf /fs_test 
Filesystem              kbytes    used   avail %used Mounted on
/dev/vg00/fstest      10485760 4097395 5990074   41% /fs_test 

Saturday, October 19, 2013

How To Install and Configure EMC PowerPath License on HPUnix

Question: How do I install EMC Powerpath License?

Answer: Before you start EMC powerpath License installation, please check whether EMCPower Path software is been installed.

1. Checking EMC Powerpath Software installed or not

testhost:/root#swlist -l product EMCpower
# Initializing...
# Contacting target "testhost"...
#
# Target:  testhost:/
#
  EMCpower      HP.5.1.SP2_b113 PowerPath IA64

2. Register EMC Powerpath

Before you can use the EMC powerpath software, you should register it using the EMC Powerpath License key received when you purchased the software from EMC.

Use emcpreg tool to install EMC Powerpath license key as shown below.


# emcpreg -install
===========   EMC PowerPath Registration ===========
Do you have a new registration key or keys to enter?[n] y
Enter the registration keys(s) for your product(s),
one per line, pressing Enter after each key.
After typing all keys, press Enter again.Key (Enter if done): **emc-powerpath-license-key**
1 key(s) successfully added.
Key successfully installed.Key (Enter if done):
Key  is invalid, ignored.
Try again or press Enter if done.
1 key(s) successfully registered.


3. Verify EMC Powerpath Registration

Use EMC powermt command to check the registration as shown below.


# powermt check_registration
Key **emc-powerpath-license-key**
  Product: PowerPath
  Capabilities: All

4. Verify Multiple Paths

Once you’ve installed EMC powerpath, execute powermt display dev=all as shown below to verify whether multiple paths as displayed accordingly.

# powermt display dev=all
Pseudo name=emcpowera
CLARiiON ID=00000000000 [db-server]
Logical device ID=12121212121212 [LUN 1]
state=alive; policy=CLAROpt; priority=0; queued-IOs=0
Owner: default=SP A, current=SP A
==============================================================================
---------------- Host ---------------   - Stor -   -- I/O Path -  -- Stats ---
### HW Path                 I/O Paths    Interf.   Mode    State  Q-IOs Errors
==============================================================================
  1 QLogic Fibre Channel 2300 sdb        SP A4     active  alive      0      0
  1 QLogic Fibre Channel 2300 sdd        SP B4     active  alive      0      0
  2 QLogic Fibre Channel 2300 sdf        SP A5     active  alive      0      0
  2 QLogic Fibre Channel 2300 sdh        SP B5     active  alive      0      0

Monday, September 16, 2013

This target or source is already in use either within this same session or by another session

Error:

# swremove -x mount_all_filesystems=false sudo

=======  09/07/13 04:41:48 METDST  BEGIN swremove SESSION
         (non-interactive) (jobid=testmachine-0125)

       * Session started for user "#".
       
       * Beginning Selection
ERROR:   "testmachine:/":  This target or source is already in use either
         within this same session or by another session.  A read or
         write lock was denied.
       * Target connection failed for "testmachine:/".
ERROR:   More information may be found in the daemon logfile on this
         target (default location is
         testmachine:/var/adm/sw/swagentd.log).
       * Selection had errors.
       
       

=======  09/07/13 04:41:49 METDST  END swremove SESSION
         (non-interactive) (jobid=testmachine-0125)


Solution:
#[/var/adm/sw/products]: ls -lrt|grep swlock
-r--r--r--   1 root       sys              0 Jun 23  2005 swlock


#[/var/adm/sw/products]: mv swlock swlock.bk
#[/var/adm/sw/products]: cd -
/sbin/init.d
#[/sbin/init.d]: /sbin/init.d/swagentd stop
The swagentd daemon is stopped.
#[/sbin/init.d]: /sbin/init.d/swagentd start

Which solved the issue

Friday, August 9, 2013

Starting, Stopping and Aborting Veritas Tasks

When mirrors and RAID5 devices are created with Veritas Volume Manager, the volume contents need to be synchronized to an initial consistent state (e.g., parity and mirrors need to be synchronized). Veritas assigns a unique task id to each operation, and allows tasks to be monitored and displayed with the vxtask(1m) utility:
$ vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   172           ATCOPY/R 05.57% 0/209698816/11689984 PLXATT oravol04 oravol04-02 oradg


Since synchronization can be extremely I/O intensive, you might want to pause a synchronization task until a later time. This is easily accomplished by passing the task id to vxtask(1m)’s pause option:

$ vxtask pause 172
$ vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   172           ATCOPY/P 05.76% 0/209698816/12077056 PLXATT oravol04 oravol04-02 oradg


Once you are ready to resume the task, you can use vxtask(1m)’s resume option:
$ vxtask resume 172
$ vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   172           ATCOPY/R 06.02% 0/209698816/12613632 PLXATT oravol04 oravol04-02 oradg


Similarly, if you want to abort the TaskId you can do it by:

# vxtask abort <taskid>
# vxtask abort 172

This is super useful, and it looks to have caught on.