DISCLAIMER : Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility.If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.


EMC ODM definations cleanup

Before making any changes, collect host logs to document the current configuration. At a minimum, save the following: inq, lsdev -Cc disk, lsdev -Cc adapter, lspv, and lsvg
Shutdown the application(s), unmount the file system(s), and varyoff all volume groups except for rootvg. Do not export the volume groups.

# varyoffvg

Check with lsvg -o (confirm that only rootvg is varied on)

If no PowerPath, skip all steps with power names.

For CLARiiON configuration, if Navisphere Agent is running, stop it:
# /etc/rc.agent stop

Remove paths from Powerpath configuration:
# powermt remove hba=all

Delete all hdiskpower devices:
# lsdev -Cc disk -Fname grep power xargs -n1 rmdev -dl

Remove the PowerPath driver instance:
# rmdev -dl powerpath0

Delete all hdisk devices:For Symmetrix devices, use this command:
# lsdev -CtSYMM* -Fname xargs -n1 rmdev -dl

For CLARiiON devices, use this command:
# lsdev -CtCLAR* -Fname xargs -n1 rmdev -dl

Confirm with lsdev -Cc disk that there are no EMC hdisks or hdiskpowers.
Remove all Fiber driver instances:
# rmdev -Rdl fscsiX(X being driver instance number, i.e. 0,1,2, etc.)

Verify through lsdev -Cc driver that there are no more fiber driver instances (fscsi).
Change the adapter instances in Defined state
# rmdev -l fcsX(X being adapter instance number, i.e. 0,1,2, etc.)

Create the hdisk entries for all EMC devices:
# emc_cfgmgror
# cfgmgr -vl fcsx(x being each adapter instance which was rebuilt).

Skip this part if no PowerPath.
Configure all EMC devices into PowerPath:
# powermt config

Check the system to see if it now displays correctly:
# powermt display
# powermt display dev=all
# lsdev -Cc disk
# /etc/rc.agent start


Recovering emc dead path

# powermt display dev=all
And you notice that there are "dead" paths, then these are the commands to run in order to set these paths back to "alive" again, of course, AFTER ensuring that any SAN related issues are resolved.

To have PowerPath scan all devices and mark any dead devices as alive, if it finds that a device is in fact capable of doing I/O commands, run:

# powermt restore To delete any dead paths, and to reconfigure them again:
# powermt reset
# powermt config

Or you could run:
# powermt check

Using the “tar” and “gzip” commands


In UNIX files are packed using the Unix Tape ARchive utility (derived from tape archive and commonly referred to as “tarball”), otherwise are compressed and stored using the GNU zip utilities.

The purpose of this post in not do a detailed and exhaustive description about “tar” and “gzip” commands, but present the essential to use it of an easy way. I hope you enjoy the post!

Basically the “tar”(Tape ARchive) command allows pack/unpack, and the gzip(GNU zip) command compress/uncompress files.

tar

The “tar” command allows us group and ungroup( pack and unpack), a set of files and/or folders into a single file.

tar


To pack some folders and files listed above into a single file, we can run the “tar” command with the following parameters.

tar -cvf application.tar *
or

tar –cvf application.tar java PERL requirements.txt config.xml

tar -cvf

tar -cvf

The parameters of this command can be specified without the hyphen:

tar cvf application.tar java PERL requirements.txt config.xml


Regardless of how the parameters can be referred, below is listed a description of the used parameters:

Option Meaning Description
-c Create Create a new archive
-v Verbose Verbosely list files which are processed
-f File=ARCHIVE Use archive file or device


Otherwise the “tar” command can be used to the reverse process: unpack or extract a set of files, directly from the “tar” file:

Option Meaning Description
-x eXtract Extract files from an archive

Un tar

Un tar

gzip

This command simply allow to compress a file: any type of file(with the “tar” extension or any other).

To compress a file we can use the following syntax:

gzip

gzip

As the “tar” command is used to pack and unpack, the “gzip” command also can be used to compress and uncompress a file.

After the execution of the previous command the result is the file “application.tar.gz”.

In order to perform the decompression can also be used the “gzip” command with the parameter “d”(that means: decompress):
 
uncompress


uncompress

To unzip also is usual to use the “gunzip” command:

gunzip myfile.tar.gz

The “tar” also allows compress the “tar” result file, by the “z” option as shown below:

tar cvzf archive_name.tar.gz dirname
The “z”option: compress and pack simultaneously, or simply filters the archive through “gzip”.

tar and gzip

 

Oftentimes can be confused to understand the meaning of “tar” and “gzip” commands, because they are used together at the same command line through the pipe operator “|”.



Tar and gzip - Extracted from "Wikipedia"
 
Example 1

tar cvf * | gzip > oracle.tar.gz

The first command(before the pipe) is the “tar”, which pack all files in the current directory.

After this, the ”tar” file is compress :”gzip”(after the pipe) and produce the final file(by the redirection operator “>”) : “oracle.tar.gz”.

Example 2

gunzip < oracle.tar.gz | tar xvf -

In this example the “oracle.tar.gz” file is unzip and the result is a “tar” file that is placed in the “tar” command to unpack. With the hyphen the data resulting from the “gunzip” command is used as input in the tar command.

 

Useful list

 

Below you can see a list of very useful actions included these commands:
  • List the contents of “tar” file
Listing the “tar” archive  contents without any extraction(only lists the contents).

tar tvf archive_name.tar
  • Extract a single file from “tar” file
This syntax allows to extract a single file:”java/MyLib.java”  from the  ”tar” file.

tar xvf oracle.tar  java/MyLib.java
  • Add a file  to an existing  ”tar” file
To add a file to an existing “tar” file, only is necessary to use  the “r” parameter:

tar rvf oracle.tar conf.cnf
  • Untar an archive to a different directory
To untar an archive to a different directory, use the following syntax:

tar -zxf oracle.tar.gz -C ora

How to add a new network gateway or static route on Red Hat Enterprise Linux host?

To add a static route or gateway on Red Hat Enterprise Linux host, such as when adding for a second (or tertiary) interface, use the /etc/sysconfig/network-scripts/route-<interface> files. These configuration filesare read during network service initialization. For example to add static route for eth0, create a file /etc/sysconfig/network-scripts/route-eth0 and add the routes as explained below.

There are two possible formats for this file. The first is with ip command arguments and the second is with network/netmask directives.

Format 1:
  • For ip commands, the ifup-route script supplies ip route add and the contents of the file are all parameters necessary to set up the route. For example, to set up a default route, the file would contain the following:
    default via X.X.X.X
    Y.Y.Y.Y via Z.Z.Z.Z
    
    e.g
    default via 192.168.1.1
    10.10.10.0/24 via 192.168.1.2
    
  • In the above, X.X.X.X is the gateway IP address. The second line adds another static route where Y.Y.Y.Y is the network, Z.Z.Z.Z is the gateway IP address. Multiple lines will be parsed as individual routes.

Format 2:
  • The alternative format is as follows:
    ADDRESS<N>=X.X.X.X
    NETMASK<N>=Y.Y.Y.Y
    GATEWAY<N>=Z.Z.Z.Z
    
    e.g.
    ADDRESS0=10.10.10.0
    NETMASK0=255.255.255.0
    GATEWAY0=192.168.1.2
    ADDRESS1=20.20.20.0
    NETMASK1=255.255.255.0
    GATEWAY1=192.168.1.2
    
  • This format deals with three fields: GATEWAY, NETMASK, and ADDRESS. Each field should have a number appended to it indicating which route it relates to.
  • In the above example, Z.Z.Z.Z is the gateway IP address. Subsequent entries must be numbered sequentially (for example ADDRESS1=, NETMASK1=, GATEWAY1=). Note, that multiple entries must be sequentially numbered and must not skip a value (0 must be followed by 1, not a number greater than 1).