6/04/2020

SAP Diagnostics Agent 7.1 Troubleshooting

Introduction

Document Status

The Diagnostics Agent troubleshooting guide used to be available as a PDF document. It is now replaced by this wiki page. In case the content of this page does not address your problem, please refer to the former PDF document, being still available as DiagnosticsAgentTroubleshooting.pdf attachement to SAP Note 1833501.

Diagnostics Agent Installer

For more general information on installation strategy, installer versions, etc., please refer to Diagnostics Agents.

Troubleshooting Ressource Consumption and Booting Issues of the Diagnostics Agent

Check OS Settings on Linux Hosts (ulimit and umask)

After the installation of the Diagnostics Agent on UNIX platforms, remind to double check the following OS environment settings for the Diagnostics Agent OS user (often daaadm):

ulimit

  • Log on with the agent OS user, e.g. su – daaadm
  • Open an sh shell with the command sh
  • Execute the command ulimit -a
  • Compare the values with the recommendedations in the Installation & Setup Guide for the most recent installer (see SAP Note 1833501).
  • If you change the limits, remember to stop the Diagnostics Agent (sapstop), kill the Diagnostics Agent processes (sapstartsrv) and start the Agent again (sapstart). In this way the Diagnostics Agent will take the new settings into account.
If the user’s limit parameters for the OS Diagnostics Agent user are not correct, high CPU consumption situations or out-of-memory errors can result.

umask

Please refer to SAP note 1163751.

Trigger Thread Dumps for Diagnostics Agents

It is important to do thread dumps of the Diagnostics Agent process, to understand the problem context in case of a deadlock, not responding Diagnostic Agent or a high CPU time consumption situation.
Trigger a Thread Dump on Windows
The Diagnostics Agent is an SAP system and available in SAP MMC.

                         
In SAP MMC, open the node “AS Java Process Table” of the Diagnostics Agent identified by the SID and instance number. Select the desired Agent Node and right click on it to display the context menu, then click the item “Dump Stack Trace”.

Trigger a Thread Dump on Unix
For Diagnostics Agents 7.1x, 7.2x, 7.3x or installed with SWPM 1.0 SP 3 and higher, log on in a UNIX shell with the OS user of the Diagnostics Agent, navigate to the folder /usr/sap//SMDA/exe and execute command:
sapcontrol.exe -user adm -nr -function J2EEControlProcess smdagent DumpStackTrace
example:
./sapcontrol -user daaadm abc123 -nr 98 -function J2EEControlProcess smdagent DumpStackTrace
Alternatively a thread dump can be triggered via "kill -3 ", with being the process ID of the Diagnostics Agent's Java process.
Where Is the Thread Dump Stored?
The  thread dump is written into the file /usr/sap//SMDA/work/std_SMDAgent.out, provided that the agent is running on  a SAP JVM.

Trigger Heap Dumps for Diagnostics Agents

Verbose Class Loading

To enable verbose logging of the class loading of Diagnostics Agent add -verbose:class-verbose:class to the property smdagent.javaParameters in /usr/sap/<>/SMDA<>/SMDAgent/smdagent.properties. Restart the Diagnostics Agent and find the verbose class loading information at usr/sap/<>/SMDA<>/work/jvm_smdagent.out.

Common Issues Related to Ressource Consumption and Booting of the Diagnostics Agent

The Diagnostics Agent Log Contains Out-of-Memory Errors caused by abapReadSyslog

Symptom:
The log contains an exception like this:
[MAIJobObserver] ERROR occurred for metric collection 00000000000000000003[com.sap.smd.mai.model.collector.SAPControlWSCollector].
[EXCEPTION]
com.sap.smd.agent.plugin.connectors.webservice.WebServiceInvocationException: Webservice invocation error occured on BindingProvider JAX-WS RI 2.1.6 in JDK 6: Stub for http://mySystem:myPort/SAPControl.cgi
        at com.sap.smd.agent.plugin.connectors.webservice.JaxWebserviceInvocationHandler.invoke(JaxWebserviceInvocationHandler.java:114)
        at com.sun.proxy.$Proxy36.abapReadSyslog(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sap.smd.agent.facade.hostagent.HostAgentSyncProxy$SyncHandler.singleInvoke(HostAgentSyncProxy.java:127)
        at com.sap.smd.agent.facade.hostagent.HostAgentSyncProxy$SyncHandler.invoke(HostAgentSyncProxy.java:85)
        at com.sun.proxy.$Proxy43.abapReadSyslog(Unknown Source)
        at com.sap.smd.mai.model.collector.SAPControlWSCollector.abapReadSysLog(SAPControlWSCollector.java:1112)
        at com.sap.smd.mai.model.collector.SAPControlWSCollector.collect(SAPControlWSCollector.java:217)
        at com.sap.smd.mai.job.MetricJobRunner.run(MetricJobRunner.java:32)
        at com.sap.smd.server.exec.TaskRunner.run(TaskRunner.java:47)
        at com.sap.smd.server.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:785)
        at java.lang.Thread.run(Thread.java:763)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
Cause:
The syslog size is at least nearly as big as the Java maximum heap size.
Resolution:
  • To resolve the issue increase the Java maximum heap size (see below) to be sufficiently bigger than the syslog size.
  • Alternatively, limit the size of the syslog or delete it.

The Diagnostics Agent Log Contains other Out-of-Memory Errors


Symptom:
java.lang.OutOfMemoryError: Java heap space and java.lang.OutOfMemoryError: GC overhead limit exceeded can be found in the log file.
Cause:
By default, the SMD Agent's Java heap maximum size is set to 256 MB.  In the event of a large data collection, a heap size of 512 MB or more is required.
Resolution:
To resolve the issue, do the following for the Diagnostic Agent on host :
1.  On your managing host, browse to the following directory:
     Windows      :\usr\sap\DAA\SMDA98\SMDAgent
     Unix      /usr/sap/DAA/SMDA98/SMDAgent
     Note: In the above example DAA is the name of the SID and the instance number is 98.  This may differ on your system.
2.  Open the file smdagent.properties using a text editor
3.  Locate the property smdagent.javaParameters then locate the parameter -Xmx
4.  Change the value of -Xmx to -Xmx512m then save the changes.  For example:
smdagent.javaParameters=-DP4ClassLoad=P4Connection -Xmx512m -Xms256m -XX:MaxPermSize=128m
5.  Restart the managing SMD Agent.

The Diagnostics Agent Does Not Start

For issues related to the start-up of the Diagnostics Agent, please refer to this Wiki page.

Extracting Configuration From Secure Store File Failed

If the SMDSystem.*.log contains errors similar to the entries listed below, the secure store of the Diagnostics Agent might be broken due to incompatible updates of the Diagnostics Agent or the JVM:
java.io.IOException: javax.crypto.BadPaddingException: Invalid PKCS#5 padding length: 33
at javax.crypto.CipherInputStream.a(DashoA13*..)
at javax.crypto.CipherInputStream.read(DashoA13*..)
at javax.crypto.CipherInputStream.read(DashoA13*..)
at java.util.Properties$LineReader.readLine(Properties.java:434)
at java.util.Properties.load0(Properties.java:353)
at java.util.Properties.load(Properties.java:341)
Extracting configuration from secstore file /usr/sap/DAA/SMDA98/SMDAgent/applications.config/com.sap.smd.agent.application.e2emai.std.collectors/_Default_Configuration.properties Failed.
The secret key could not be read in secure storage
com.sap.security.core.server.secstorefs.FileInvalidException: Getting Secure Store failed: File "/usr/sap/DAA/SMDA98/SMDAgent/configuration/secstore.properties" is invalid: software version 6.30.000.001 is incompatible with file version 7.00.000.001.
File "/usr/sap/DAA/SMDA98/SMDAgent/./temp/smdserver/secstore/TechnicalSecStorea8e9da9b2f1d7a8a9b079d5d1804a6c4.properties" is invalid: record with key "$internal/mode" is missing
Unable to create SSLContext because of KeyStore Exception java.security.UnrecoverableKeyException: Cannot recover key

To reset the secure store, proceed as follows:
  1. Stop the Diagnostics Agent
  2. Delete  /usr/sap//SMDA/SMDAgent/configuration/secstore.properties.
  3. Delete /usr/sap//SMDA/SMDAgent/configuration/security/.CertificatesKeyStore 
  4. Start the Diagnostics Agent.
  5. In the Agent Administration → Non-Authenticated Agents select the respective Diagnostics Agent and click on Trust Agent.
In case the issue persists after the execution of the steps above, it is possible to follow the steps in the following article to correct this scenario.
  • 2447919 - Diagnostic Agent does connect to Solution Manager with the error: 'record with key "$internal/mode" is missing.'

The Diagnostics Agent is Blocking HANA Client Ports

When the Diagnostics Agent is started, all connections from the Solution Manager to the SAP HANA fail (e.g. Telnet on port 22 or the HANA port that is used by the Solution Manager server). 
Solution:
A possible cause might be that there are enough ports, but they cannot be reused fast enough. This can be configured using the below mentioned parameters. At SAP Note 2382421 especially check the sections "net.ipv4.ip_local_port_range" and "SAP Host Agent Configuration". The latter points to SAP Note 401162, which should also be taken into account. Furthermore, check the parameters "net.ipv4.tcp_tw_reuse" and "net.ipv4.tcp_tw_recycle" as described at SAP Note 2382421.

SAP Solution Manager Java Stack Scalability Settings

Please refer to SAP Note 2417827

SAP FAQ - End to End Root Cause Analysis

FAQ - End to End Root Cause Analysis


Purpose

The purpose of this page is to offer a solution to common issues encountered while using End to End Root Cause Analysis Work Center in Solution Manager 7.0 Ehp1

Overview

Many topics are covered based on most common problems encountered in Root Cause Analysis in Solution Manager 7.0 Ehp1, such as: error messages, missing data, lack of error logs, unexpected window behaviors. This page also clarifies some common questions such as: how to know what webpages are Java based or ABAP Based.
More general Diagnostics Agent questions are discussed here: FAQ Diagnostics Agent.

    Frequently Asked Questions on End to End Root Cause Analysis

    I'm getting a pop up screen asking for User name and Password each time I navigate in E2E Workload Analysis tabs.

    This is the standard behavior in SAPGui with WebDynpro, BSP and SSO. Because of this behavior the usage of WebDynpro is not officially supported in SAPGui, but only in Standalone Browsers or the NWBC. SAP note 1098009 states:  " Web Dynpro ABAP does not provide a controlled behavior for the new  window (Ctrl+N) functionality of Web browsers. This browser  function should not be used as part of the application flow. " It is exactly what happens when you click on the E2E Workload Analysis tabs, it opens a IFRAME, hence it is a new window.
    The solution is to call the Solution Manager Workcenter in the Web Browser. You can use the following URL:
    http://:/sap/bc/webdynpro/sap/ags_workcenter
    Last but not least, remember to properly set SSO to ensure there's no issue with HTTPS. Refer to SAP note 1121248 .
    The issue is not related to Solution Manager directly but a general restriction of displaying BI web templates in a WebDynpro iFrame User Interface element within an HTML control in SAPGUI.
    You can assume that this will not change in future Solution Manager releases as it is a limitation of the infrastructure rather than of the application itself.

    I have performed a system copy but the old host name is still in use in the URLs.

    In transaction RZ10, select Instance Profile, Extended Maintenance, maintain the proper icm host name parameter. Please restart the system the parameter change, as it is a non-dynamic parameter.
    The main SAP notes that contains information about URL and PORT changes are 1297849 & 805344

    How can I address Error messages in Workload Analysis ?

    You are receiving messages similar to this while browsing the Workload Analysis tabs:
    • Notification number BRAIN 278, BRAIN 277
    • "Web application processing terminated"
    • Error in template 0TPL_0SMD_MPEH_WA_Q0001
    Note that the template name and BRAIN error code may vary.
    In any case you must refer to SAP note 1342231 : ST: Manual actvtn. of BI Content for E2E diagnostics

    While using the Solution Manager Workcenter, how can I know which URL is JAVA and which one is ABAP ?

    Sometimes it is common to see some Root Cause Analysis tools working and others don't. In most cases, it is caused by problems in one of the stacks, ABAP or JAVA. To identify which stack is used in the Workcenter, check the URL after the port number:
     /webdynpro/dispatcher -> Java
     /sap/bc -> ABAP

    Error message.unauthorized while accessing Diagnostics Setup (http://:/smd)

    When accessing a Diagnostics Java UI (such as "/smd" shortcut), an authorization check is executed against the Solution Manager ABAP stack. This is using a Jco/RFC connection, based on the definition of the WEBADMIN JcoRFC destination defined in your Solution Manager Java stack. Most likely, this definition is missing or is not valid in your case.
    Please check the WEBADMIN destination with Visual Admin tool in Server -> Services ->JcoRFC Provider:
    • If it does not exist, please run SOLMAN_SETUP as described in the setup documentation. The "Configure Diagnostics" activity will create this RFC destination.
    • If it does exist, please make sure its settings are correct, specially if the user/password is valid. You may also delete it from Visual Admin tool, and run SOLMAN_SETUP -> "Configure Diagnostics" to recreate it.

    In E2E Trace Analysis, the client plugin is not recording.

    Refer to the wiki page Client plugin not recording

    I cannot see dashboards in Wily Introscope for SAP BOE 4.0.

    Refer to SAP note 1540591 - Wily Introscope Setup for SAP BOE 4.0

    Related Content

    Related Documents

    Related Notes

    SAP Note 1435043: E2E Workload Analysis - No applicable data found
    SAP Note 1121248: SSO Setup for Diagnostics
    SAP Note 1098009: Limitations for Web Dynpro ABAP
    SAP Note 1010428: End-to-End Diagnostics
    SAP Note 1297849: Root Cause Analysis URL generation
    SAP Note 805344: How URLs are generated automatically in BW
    SAP Note 1342231: ST: Manual actvtn. of BI Content for E2E diagnostics SP18-28
    SAP Note 1540591: Wily Introscope Setup for SAP BOE 4.0

    FAQ Diagnostics Agent SAP

    Purpose

    The purpose of this page is to answer Frequently Asked Questions about Diagnostics Agents.
    Below you can find the index of all FAQs on this page:

    Frequently Asked Questions about Diagnostics Agents

    What is the entry point for Diagnostics Agent related Information

    Please refer to the "General Information" section here Diagnostics Agents.

    On which platforms can the Diagnostics Agent be installed?

    Platform coverage is documented in the Product Availability Matrix (PAM) for the Diagnostics Agent. Please refer to the "General Information" section here Diagnostics Agents, which descibes where the PAM information is located.

    On which platforms can the Diagnostics Agent be installed for the EEM Robot use case?

    Where can I find an overview of Diagnostics Agent Maintenance Procedures?

    See the documentation at page Diagnostics Agent Maintenance Procedures.

    How can I upgrade the SAP Kernel for the Diagnostics Agent?

    See related documentation at page Diagnostics Agent Maintenance Procedures.

    How can I upgrade the SAP JVM for the Diagnostics Agent?

    See related documentation at page Diagnostics Agent Maintenance Procedures.

    Where do I find High Availability (HA) Support documentation?

    A dedicated document on this topic exists here Diagnostics Agent and HA Support.

    Where do I find Troubleshooting documentation?

    Please refer to this Diagnostics Agent 7.1 Troubleshooting information.

    Related FAQ Documents

    1/31/2020

    How to fix "SSH is responding very slowly" ?

    When we try to connect to other nodes in the cluster, SSH is responding very slowly. this is usually a dns issue, so we turn it off. For more information, please refer to: https://www.serverpronto.com/accounts/knowledgebase.php?action=displayarticle&id=16 

    Solution

    To test this issue, use:
    1 2 arp -a # To check a lookup arp -an # To check for a reverse look up


    To solve the issue, either update /etc/resolv.conf with the proper nameserver ip addresses or follow the steps below.

    Update the ssh config:

    1 sudo /etc/ssh/sshd_config
    Find #useDNS yes

    Replace with useDNS no

    Restart the sshd service:

    1 service sshd restart

    How to fix "waagent logs disk space usage" ?


    Sometimes, in the Azure environment, the waagent rsyslog can get out of control.

    To Confirm

    Look for the waagent in the process table and see it’s resource usage.

    1 nice top -c
    1 ps -ef | grep waagent
    To Fix

    Move the /etc/syslog.d/10-* files out of the way
    • 1 2 mkdir -p /tmp/old-stuff mv /etc/syslog.d/10-* /tmp/old-stuff
    • Restart rsyslogd
      1 sudo systemctl restart rsyslogd

    When the system comes back, the waagent config files should be back in place and the system running much better.

    TLS openssl check connection



    IT sec would like to audit the TLS connection type provided by the web servers used by application

    These instructions assume that you're using the RHEL or CentOS - like operating Systems.

    Instructions

    Use the standard openssl commands to check the connection type


    TLS version 1.1 openssl s_client -tls1 -connect :443
    TLS version 1.1 openssl s_client -tls1_1 -connect :443
    TLS version 1.2 openssl s_client -tls1_2 -connect :443

    Good Example

    For this example, we used a self-signed cert, so your output may be a little different.

    openssl s_client -tls1_2 -connect 1.2.3.4:443

    CONNECTED(00000003)

    depth=0 CN = 10.215.17.68
    verify error:num=18:self signed certificate
    verify return:1
    depth=0 CN = 10.215.17.68
    verify return:1
    ---
    Certificate chain

    0 s:/CN=10.215.17.68

    i:/CN=10.215.17.68

    ---

    Server certificate

    ----BEGIN CERTIFICATE-----

    [Server Certificate]

    ----END CERTIFICATE-----
    subject=/CN=10.215.17.68
    issuer=/CN=10.215.17.68

    ---
    No client certificate CA names sent
    Peer signing digest: SHA512
    Server Temp Key: ECDH, P-256, 256 bits
    ---
    SSL handshake has read X bytes and written Y bytes
    ---
    New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
    Server public key is 2048 bit
    Secure Renegotiation IS supported
    Compression: NONE
    Expansion: NONE
    No ALPN negotiated
    SSL-Session:
    Protocol : TLSv1.2
    Cipher : ECDHE-RSA-AES256-GCM-SHA38
    Session-ID: [64 char id]
    Session-ID-ctx:
    Master-Key: [Key Hash]
    Key-Arg : None
    Krb5 Principal: None
    PSK identity: None
    PSK identity hint: None
    TLS session ticket lifetime hint: 300 (seconds)
    TLS session ticket:
    [Returned TLS Key Hash]
    Start Time: 1560364043
    Timeout : 7200 (sec)

    Verify return code: 18 (self signed certificate)

    How to disable IPv6 Linux

    On the node in question, become root then:
    1 2 3 4 5 6 7 vi /etc/sysctl.conf # At the end, add: net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 # Save and quit
     To make this stick, execute:
    1 sysctl -p

    ssh connection speed test

    Test ssh connection speed

    
    #!/bin/bash
    # scp-speed-test.sh
    
    # Usage:
    #   ./scp-speed-test.sh user@hostname [test file size in kBs]
    #
    
    ssh_server=$1
    test_file=".scp-test-file"
    
    # Optional: user specified test file size in kBs
    if test -z "$2"
    then
      # default size is 10kB ~ 10mB
      test_size="10000"
    else
      test_size=$2
    fi
    
    
    # generate a 10000kB file of all zeros
    echo "Generating $test_size kB test file..."
    `dd if=/dev/zero of=$test_file bs=$(echo "$test_size*1024" | bc) \
      count=1 &> /dev/null`
    
    # upload test
    echo "Testing upload to $ssh_server..."
    up_speed=`scp -v $test_file $ssh_server:$test_file 2>&1 | \
      grep "Bytes per second" | \
      sed "s/^[^0-9]*\([0-9.]*\)[^0-9]*\([0-9.]*\).*$/\1/g"`
    up_speed=`echo "($up_speed*0.0009765625*100.0+0.5)/1*0.01" | bc`
    
    # download test
    echo "Testing download to $ssh_server..."
    down_speed=`scp -v $ssh_server:$test_file $test_file 2>&1 | \
      grep "Bytes per second" | \
      sed "s/^[^0-9]*\([0-9.]*\)[^0-9]*\([0-9.]*\).*$/\2/g"`
    down_speed=`echo "($down_speed*0.0009765625*100.0+0.5)/1*0.01" | bc`
    
    # clean up
    echo "Removing test file on $ssh_server..."
    `ssh $ssh_server "rm $test_file"`
    echo "Removing test file locally..."
    `rm $test_file`
    
    # print result
    echo ""
    echo "Upload speed:   $up_speed kB/s"
    echo "Download speed: $down_speed kB/s"

    12/27/2017

    Logical Volume Manager (LVM). Part 4 Use case

    Continue to describe LVM from the practical point of view.
    The previous parts are available here:

    - Logical Volume Manager (LVM). Part 1.Basics
    - Logical Volume Manager (LVM). Part 2 Commands
    - Logical Volume Manager (LVM). Part 3 Commands

    Another typical situation is when you need to arrange access to a file system Volume Group from
    different servers. The disks are 
    physicallylocatedin the disk array, for example, in network SAN
    (Storage Area Network) and multiple servers have access to those drives. 
    This configuration is
    required for the Organization of the work of the failover cluster on the basis of the MC/ServiceGuard
    .

    The sequence is as follows:

    1. Create the Volume Group (c) Logical Volumes and file systems with mount points on the
      same server. 
      Name it the source (host1).
    2. Unmount file systems and deactivate the Volume Group on the source server:
      • umount /data
      • vgchange -a n/dev/vg01  
    3. Create a special mapping file Volume Group on the source server and copy it to the new
      server. 
      Lets name it target  (host2).
      • vgexport -p -s -m /vg01.map/dev/vg01 - pay attention to the-p option
        (mode, when the export Volume Group vg01 is not deleted on the source server),
      • rcp /vg01.map host2:/vg01.map
    4. On the destination server to prepare disks presented with disk array, which were included
      in the Volume Group vg01 on the source server, create a directory and a file for Volume
      Group vg01:
      • the ioscan -fnC disk - in case when devices were not created, to create use the
         command: insf-C disk , nothing to do else with the disks then.
      • mkdir /dev/vg01
      • mknod /dev/vg01/group c 64 0x010000 -to search for free junior rooms use the
         command: ls-al /*/group
    5. Import to the target server using the mapping file that you obtained in step 3:
      • vgimport-s-m/vg01.map/dev/vg01 -team itself finds the disks and add them to a new
         Volume Group; the failover command to verify that you can use the command:
        strings /etc/lvmtab
    6. You can now activate the Volume Group on the target server, save the configuration to
      restore, create a mount point, mount the file system and, if necessary, prescribe automatic
       mounts in/etc/fstab:
      • vgchange -a y /dev/vg01 
      • vgcfgbackup /dev/vg01
      • mkdir /data 
      • mount /dev/vg01/lvol1/data
      • vi /etc/fstab
    By this method the Volume Groups can be migrated from one server to another. In this case it
    is necessary to remove them after the migration on the source server with the following command:
    • vgexport /dev/vg01

    Logical Volume Manager (LVM). Part 3 Commands

    Command to gather information about file systems, the structure of the LVM, etc.:
    •  bdf -list of mounted file systems.
    •  ls -ltra /*/group  -cool command to view control files of all Volume Groups on the server.
       
      Is often useful when finding free minor-rooms for the new Volume Group.
    •  lvdisplay -v/dev/vg01/lvol1 -information about Logical Volume, you can try lvol1 general case:
    •  cat /etc/fstab -a list of all the file systems that are mounted at startup OS
    •  vgdisplay -v - information about all Volume Groups
    •  vgdisplay-v vg01 -  information about the specific group.
    •  lvdisplay -v/dev/vg01/lv * -information about all Logical Volume from a Volume Group vg01.
    • pvdisplay -v /dev/dsk/c1t1d2 -information on the Physical Volume.
    Expansion Volume Group (adding disk) Logical Volume:
    1.  pvcreate -f /dev/rdsk/c1t1d2 -to prepare a disk for connecting to LVM,
    2.  vgextend vg01 /dev/dsk/c1t1d2 -add to an existing Volume Group vg01 new drive.
    3.  lvextend -L /dev/vg01/lvol1 48000 -extend Logical Volume size to 48000 lvol1 MB.
    Extend filesystem on lvol1 (prior to this event, though the drive (Logical Volume) and became more,
     but the file system will not be able to use it):

    • umount /data -unmount file system
    • extendfs -F vxfs/dev/vg01/rlvol1 -extend the file system on any space
    • mount /data -mount extended file system
    • bdf -check out the new size.
    Reducing of the file system and Logical Volumes is very rare operation, because prior to this,
    you must delete the data by making a backup, and after you reduce the file system and Logical Volume commands newfs and lvreduce command
    .

    Commands to delete Logical Volume:

    1.  umount /data -unmount file system
    2.  lvremove -f /dev/vg01/lvol1 -remove a Logical Volume with option "force" (in spite of
       the existence of the file system and data)
    3.  vi /etc/fstab -edit the list of mounted file systems in Windows is restarted,
    4.  vgdisplay -v vg01 -verify that Logical Volume.
    Remove a physical disk from a Volume Group:
    1.  pvmove/dev/dsk/c1t1d2 /dev/dsk/c1t2d1 -move data from disk c1t1d2 on another
       disk in the Volume Group (if you do not specify a second disk, the command will place itself
       on the remaining disks in the Volume Group, of course, subject to the availability of places on them),
    2.  pvdisplay -v /dev/dsk/c1t1d2 -check that there is no data on the disk (a single physical
       extent-PE)
    3.  vgreduce vg01 /dev/dsk/c1t1d2 -remove the disk from the Volume Group vg01,
    4.  vgdisplay -v vg01 -check changes.
    Removing a Volume Group:
    1.  lvremove -f /dev/vg01/lvol1 -remove all Logical Volumes,
    2.  vgreduce vg01/dev/dsk/c1t1d2 -remove all but one of the disks
    3.  vgremove vg01 -Delete Volume Group vg01,
    4.  rm-irf/dev/vg01 - force remove of a directory vg01.
    You can remove a single command: 
    -  vgexport/dev/vg01 - remove everything about anything without asking. :)

    Activation and deactivation of the Volume Group:

    •  vgchange-a n vg01 -deactivates the Volume Group vg01, removing it from the LVM kernel
       tables,
    •  vgchange-a y vg01 -activates the Volume Group vg01, making possible the mounting of
       file systems (automatic activation is performed when Windows is restarted)
    •  vgchange-a r vg01 -activate Volume Group vg01 in read-only mode.
    Command sequences are correct for the file systems HFS, JFS. There is an additional option,
    which can be purchased at the HP Online JFS. 
    There's "cool things"  like reducing - extending
    the file system without unmount etc. The main command - 
    fsadm.

    Logical Volume Manager (LVM). Part II

    In the first part of the article about LVM I described the structure and basic configuration files. The second part will focus on  LVM configuration commands.


    Create Volume Group vg01:
    1. Find free disks. Useful commands:
      - ioscan-funC disk -lists the drives in the system,
      - insf-C disk -creates device files to disk (if there was),
      - bdf -list of mounted file systems (helps define engaged wheels)
      - swapinfo-d -displays the disks and filesystems, used as a swap area
      - strings/etc/lvmtab -list existing volume group and drives in them
      - vxdisk list -a list of drives employed in VxVM (another system/disk management).
    2. Check the availability and integrity of the selected disks. For example,/dev/dsk/c0t1d0:
      1. diskinfo/dev/rdsk/c1t1d2 -information about the disk
      2. dd if =/dev/rdsk/c1t1d2 of =/dev/null bs = 1024 k -read the contents of a disk, a
        search for "bad blocks".
    3. Prepare disks by creating them physical volumes (PV):
      pvcreate-f/dev/rdsk/c1t1d2 for slow disks, you can specify a larger timeout by adding the
      option "-t 180".
    4. Create a directory and a control file (group special file):
      1. mkdir/dev/vg01
      2. chmod 755/dev/vg01
      3. mknod/dev/vg01/group c 64 0x010000 the control file is always character type-c
        major (major) always-64 and younger (minor) is encoded 0xhh0000, where hh is a unique
        hexadecimal number of the VG
        .
      4. chown-R root: sys/dev/vg01
      5. chmod 640/dev/vg01/group
    5. Create A Volume Group:
      - vgcreate/dev/vg01/dev/dsk/c1t1d2 if multiple disks, then scroll through the gap. 
      A set
       of parameters that can be set:
      -s 1-256 ( default  4 MB ) the size of the physical extent (pieces that are distributed)
      -p
       1-255 ( default 255 ) the maximum number of PV 
      -l 1-255 ( default 255 ) the maximum number of LV,
      -e 1-65535 (default, 1016  which corresponds to 4 GB) is the maximum number of physical
      extents on disk (physical). 
      Is very important and is set depending on the size of the volume
      by the formula: PV size < >/< > size of the extent.

      Does not change in the future, making it impossible to add more disks larger than the original,
      in the Volume Group
      .
    6. View VG settings command:
      - vgdisplay vg01
    Now you can create the Logical volume: lvol1
    1. Reserve the name:
      - lvcreate-n lvol1 vg01
    2. Expand the LV to the desired size by selecting what disk in VG:
       lvextend-L 200/dev/vg01/lvol1/dev/dsk/c1t1d2 the key-L Specifies the size, in MB
       and the key-l specifies the size in extents. 
      Be careful.
    3. You can set additional parameters:
      - lvchange-a y | n/dev/vg01/lvol1 -resolution | ban on the use of LV.
      - lvchange-p r | w/dev/vg01/lvol1 -the right to "read-only" | " read-write when using a
        Logical Volume
      .
      - lvchange-r y | n | N/dev/vg01/lvol1 -options for working with "bad blocks": move the
       "bad blocks" | does not move and I/O error | disables the mechanism for the use of disk array,
       for example.
    4. Show volume settings you can command: lvdisplay/dev/vg01/lvol1
    You can create a Logical Volume in a single command lvcreate, immediately indicating the size,
    but the above sequence of commands allows you to specify which drive of the VG will be a LV. 
    This adds flexibility when creating.

    Use Logical Volume lvol1:
    • As the file system:
      1. newfs-F vxfs/dev/vg01/rlvol1
      2. mkdir/data
      3. mount/dev/vg01/lvol1/data
      4. vi/etc/fstab -add a file system to mount after reboot.
    • As a swap area:
      1. swapon/dev/vg01/lvol1
      2. vi/etc/fstab -add to use after the reboot.
    Before using read the documentation man:


    12/13/2017

    Logical Volume Manager (LVM) Part I Basics

    LVM stands for Logical Volume Management. It is a system of managing logical volumes or file systems, that is much more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a filesystem.

    This article primarily related to HP-UX operating system. 

    However other operating systems may have their own peculiarities and nuances, but the basis is certainly one.

    The disk that is part of the LVM has a specific structure and contains service information.

    LVM structure: one or more disks are combined into a Volume Group (VG) within which
    you can create one or more Logical Volume (LV),  between which to allocate the disk space of the volume group drives. On Logical Volume, create file systems or swap areas and specify mount points.

    Useful directories and files: /DEV/DSK/CXTXDX and/DEV/RDSK/CXTXDX device files (block and raw) of the hard drives in the system /dev/vgxxx/group -Device file for Volume group Vgxxx /dev/vgxxx/lvxxx and /dev/vgxxx/rlvxxx -Logical volume (block and raw) files from the Volume Group VGxxx, /etc/lvmtab is a binary file that contains a list of the system's Volume Groups and a list of their hard drives (physical volumes). Some of the information from the file can be viewed by the strings command /etc/lvmconf - a directory with the backups of the Volume Group configuration files. is updated with the volume Group or Logical volume change commands or a single command - vgcfgbackup. A list of file systems and mount points used to automatically mount file systems at the start of the OS is a list of what is currently being installed. Information is used by the Mount/umount(2) and DF/BDF.

    Logical volume manager
    Добавьте подпись

    Popular Posts