Sunday, May 17, 2015

check which port use which service in solaris

#netstat -ua|grep 2321|grep LISTEN
pid is visible in 4th column of the output.


#ps -ef|grep <pid>


If required to kill it ,

 #kill -9 <pid>



LUN Recovery procedure in Solaris

LUN Recovery procedure in Solaris  

Lun discovery using Solaris :-

#sudo mpathadm list lu
#sudo luxadm -e forcelip /dev/cfg/c1
#devfsadm -Cv
#cfgadm -al

Best Practice Before Removing LUN(s) and/or Target(s) From a Solaris Server:-

cfgadm -o unusable_FCP_dev -c unconfigure c #::WWPN (for Solaris 8/9 and above)
or

cfgadm -o unusable_SCSI_LUN -c unconfigure c #::WWPN (for Solaris 10 and above)

................................................................................
................................................................................



# mpathadm list mpath-support
mpath-support: libmpscsi_vhci.so


# mpathadm list mpath-support
mpath-support: libmpscsi_vhci.so





Run the mpathadm list initiator-port command.


# mpathadm list initiator-port
Initiator-Port: iqn.1986-03.com.sun:01:080020b7ac2b.437a3b3e,4000002affff
Initiator-Port: 2000000173018713

ProcedureTo Get the Properties of a Particular Initiator Port
Display the properties of an initiator port by typing the show command.

Run the mpathadm list initiator-port command.


# mpathadm list initiator-port
Initiator-Port: iqn.1986-03.com.sun:01:080020b7ac2b.437a3b3e,4000002affff
Initiator-Port: 2000000173018713

Select an initiator port to use from the output.

Run the mpathadm show initiator-port initiator-port-name command.


# mpathadm show initiator-port 2000000173018713
initiator-port: 2000000173018713
    Transport Type: Fibre Channel
    OS Device File: /devices/pci@1f,2000/SUNW,glc@4/fp@0,0

ProcedureTo Get a List of Logical Units Discovered on the System
The mpathadm list lu command displays the list of logical units attached to the initiator. This list displays the number of paths and the operational path count to each logical unit listed.

Run the mpathadm list lu command.


# mpathadm list lu
    /dev/rdsk/c4t60020F20000035AF4267CCCB0002CEE2d0s2
        Total Path Count: 2
        Operational Path Count: 2
    /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
        Total Path Count: 2
        Operational Path Count: 2
    /dev/rdsk/c4t60003BA27D2120004204AC1A000F1D6Cd0s2
        Total Path Count: 2
        Operational Path Count: 2

ProcedureTo Get the Properties and Associated Path Information of a Particular Logical Unit by Name
Display the list of logical units, along with the properties for each logical unit through the mpathadm command. The list of logical units contains logical unit names that in turn can be used to display the properties of a particular logical unit.

Run the mpathadm list lu command.


# mpathadm list lu
    /dev/rdsk/c4t60020F20000035AF4267CCCB0002CEE2d0s2
        Total Path Count: 2
        Operational Path Count: 2
    /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
        Total Path Count: 2
        Operational Path Count: 2
    /dev/rdsk/c4t60003BA27D2120004204AC1A000F1D6Cd0s2
        Total Path Count: 2
        Operational Path Count: 2

Select a logical unit name from the output.

Run the mpathadm show lu logical-unit-name command.


# mpathadm show lu /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
logical unit: /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
    mpath-support libmpscsi_vhci.so
     Vendor:  SUN
     Product:  T4
     Revision:  0301
     Name Type:  SCSI Inquiry VPD page 83 type 3
    Name:  60003ba27d2120004204ac2b000dab00
     Asymmetric:  yes
     Current Load Balance:  round-robin
     Logical Unit Group ID:  NA
     Auto Failback:  on
     Auto Probing:  NA

     Paths:
          Initiator Port Name:  2000000173818713
          Target Port Name:  20030003ba27d212
          Override Path:  NA
          Path State:  OK
          Disabled:  no

         Initiator Port Name:  2000000173018713
          Target Port Name:  20030003ba27d095
          Override path:  NA
          Path State:  OK
          Disabled:  no

     Target Port Groups:
          ID:  2
          Explicit Failover:  yes
          Access State:  standby
          Target Ports:
               Name:  20030003ba27d212
               Relative ID:  0
    
          ID:  5
          Explicit Failover:  yes
          Access State:  active
          Target Ports:
               Name:  20030003ba27d095
          Relative ID:  0

ProcedureTo List All Logical Units Associated With a Particular Target Port
To list paths through a target port use the show command of a logical unit. 
First, retrieve the list of target ports associated with a logical unit. 
Then, use the target port to list all logical units associated with this target port.

Run the mpathadm list lu command.


# mpathadm list lu
    /dev/rdsk/c4t60020F20000035AF4267CCCB0002CEE2d0s2
        Total Path Count: 2
        Operational Path Count: 2
    /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
        Total Path Count: 2
        Operational Path Count: 2
    /dev/rdsk/c4t60003BA27D2120004204AC1A000F1D6Cd0s2
        Total Path Count: 2
        Operational Path Count: 2

Select a logical unit name from the output.

Run the mpathadm show lu command.


# mpathadm show lu /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
logical unit: /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
    mpath-support libmpscsi_vhci.so
     Vendor:  SUN
     Product:  T4
     Revision:  0301
     Name Type:  SCSI Inquiry VPD page 83 type 3
    Name:  60003ba27d2120004204ac2b000dab00
     Asymmetric:  yes
     Current Load Balance:  round-robin
     Logical Unit Group ID:  NA
     Auto Failback:  on
     Auto Probing:  NA

     Paths:
          Initiator Port Name:  2000000173818713
          Target Port Name:  20030003ba27d212
          Override Path:  NA
          Path State:  OK
          Disabled:  no

         Initiator Port Name:  2000000173018713
          Target Port Name:  20030003ba27d095
          Override path:  NA
          Path State:  OK
          Disabled:  no

     Target Port Groups:
          ID:  2
          Explicit Failover:  yes
          Access State:  standby
          Target Ports:
               Name:  20030003ba27d212
               Relative ID:  0
    
          ID:  5
          Explicit Failover:  yes
          Access State:  active
          Target Ports:
               Name:  20030003ba27d095
          Relative ID:  0

Select a target port from the output list.

Run the mpathadm list lu -t command.


# mpathadm list lu -t 20030003ba27d212
     /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
          Total Path Count: 2
          Operational Path Count: 2
     /dev/rdsk/c4t60003BA27D2120004204AC1A000F1D6Cd0s2
          Total Path Count: 2
          Operational Path Count: 2

ProcedureTo List a Logical Unit With a Particular Name Derived From the Hardware Used by the System
Run the mpathadm list lu command.


# mpathadm list lu
    /dev/rdsk/c4t60020F20000035AF4267CCCB0002CEE2d0s2
        Total Path Count: 2
        Operational Path Count: 2
    /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
        Total Path Count: 2
        Operational Path Count: 2
    /dev/rdsk/c4t60003BA27D2120004204AC1A000F1D6Cd0s2
        Total Path Count: 2
        Operational Path Count: 2

Select a logical unit name from the output.

Run the mpathadm show lu logical-unit-name command.


# mpathadm show lu /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
logical unit: /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
    mpath-support libmpscsi_vhci.so
     Vendor:  SUN
     Product:  T4
     Revision:  0301
     Name Type:  SCSI Inquiry VPD page 83 type 3
    Name:  60003ba27d2120004204ac2b000dab00
     Asymmetric:  yes
     Current Load Balance:  round-robin
     Logical Unit Group ID:  NA
     Auto Failback:  on
     Auto Probing:  NA

     Paths:
          Initiator Port Name:  2000000173818713
          Target Port Name:  20030003ba27d212
          Override Path:  NA
          Path State:  OK
          Disabled:  no

         Initiator Port Name:  2000000173018713
          Target Port Name:  20030003ba27d095
          Override path:  NA
          Path State:  OK
          Disabled:  no

     Target Port Groups:
          ID:  2
          Explicit Failover:  yes
          Access State:  standby
          Target Ports:
               Name:  20030003ba27d212
               Relative ID:  0
    
          ID:  5
          Explicit Failover:  yes
          Access State:  active
          Target Ports:
               Name:  20030003ba27d095
          Relative ID:  0

Select an inquiry-string-name from the output.

Run the mpathadm list Lu -n inquiry-string-name command.


# mpathadm list lu -n 60003ba27d2120004204ac2b000dab00
mpath-support: libmpscsi_vhci.so
     /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
          Total Path Count: 2
          Operational Path Count: 2
ProcedureTo Configure Auto-Failback for a Particular Multipathing Support
Symmetrical devices allow for automatic failback to a possible optimal path. If a failover occurs on the initial path, the standby path becomes the new online path. Usually the standby path is a suboptimal path. When auto-failback is enabled, the initial path comes back online, failover to the initial path automatically occurs.

Run the mpathadm list mpath-support command.


# mpathadm list mpath-support
mpath-support: libmpscsi_vhci.so

Select an mpath support name from the output list.

Run the mpathadm modify mpath-support -a [on | off] mpath-support-name command.


# mpathadm modify mpath-support -a off libmpscsi_vhci.so

Run the mpathadm show mpath-support mpath-support-name command to check the change.


# mpathadm show mpath-support libmpscsi_vhci.so
mpath-support: libmpscsi_vhci.so
     Vendor: Sun Microsystems
     Driver Name:  scsi_vhci
     Default Load Balance:  round-robin
     Supported Load Balance Types:
          round-robin
          logical-block
     Allows To Activate Target Port Group Access:  yes
     Allows path Override:  no
     Supported Auto Failback Config: yes
     Auto Failback:  on
     Failback Polling Rate (current/max):  0/0
     Supported Auto Probing config: no
     Auto Probing:  NA
     probing Polling Rate (current/max):  NA/NA
     Supported Devices:
          Vendor:  SUN
          Product:  T300
          Revision:
          Supported Load Balance Types:
               round-robin
          Vendor:  SUN
          Product:  T4
          Revision:
          Supported Load Balance Types:
               round-robin
Note –
The auto-failback display initiated by the mpathadm modify command setting is effective while the system is running. However, to keep the changed setting persistent, you must update the /kernel/drv/scsi_vhci.conf file. Refer to Configuring Automatic Failback.

ProcedureTo Fail Over a Logical Unit
This operation is applicable only to devices in the following two categories:

Asymmetric devices with a proprietary failover mechanism recognized and supported by multipathing support

Devices conforming to the T10 Standard Target Port Group Support libmpscsi_vhci.so and providing explicit mode asymmetric logical unit access

Run the mpathadm list lu command.


# mpathadm list lu
    /dev/rdsk/c4t60020F20000035AF4267CCCB0002CEE2d0s2
        Total Path Count: 2
        Operational Path Count: 2
    /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
        Total Path Count: 2
        Operational Path Count: 2
    /dev/rdsk/c4t60003BA27D2120004204AC1A000F1D6Cd0s2
        Total Path Count: 2
        Operational Path Count: 2

Select a logical unit name from the output.

Run the mpathadm show lu logical-unit-name command.


# mpathadm show lu /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
logical unit: /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
    mpath-support libmpscsi_vhci.so
     Vendor:  SUN
     Product:  T4
     Revision:  0301
     Name Type:  SCSI Inquiry VPD page 83 type 3
    Name:  60003ba27d2120004204ac2b000dab00
     Asymmetric:  yes
     Current Load Balance:  round-robin
     Logical Unit Group ID:  NA
     Auto Failback:  on
     Auto Probing:  NA

     Paths:
          Initiator Port Name:  2000000173818713
          Target Port Name:  20030003ba27d212
          Override Path:  NA
          Path State:  OK
          Disabled:  no

         Initiator Port Name:  2000000173018713
          Target Port Name:  20030003ba27d095
          Override path:  NA
          Path State:  OK
          Disabled:  no

     Target Port Groups:
          ID:  2
          Explicit Failover:  yes
          Access State:  standby
          Target Ports:
               Name:  20030003ba27d212
               Relative ID:  0
    
          ID:  5
          Explicit Failover:  yes
          Access State:  active
          Target Ports:
               Name:  20030003ba27d095
          Relative ID:  0
Run the mpathadm failover lu logical-unit-name command.


# mpathadm failover lu /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
If this operation is successful, the access state of the devices’ target port groups changes as a result of the logical unit failover.

Run the mpathadm show lu logical-unit-name command to verify the access state change.


# mpathadm show lu /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
logical unit: /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
    mpath-support libmpscsi_vhci.so
     Vendor:  SUN
     Product:  T4
     Revision:  0301
     Name Type:  SCSI Inquiry VPD page 83 type 3
    Name:  60003ba27d2120004204ac2b000dab00
     Asymmetric:  yes
     Current Load Balance:  round-robin
     Logical Unit Group ID:  NA
     Auto Failback:  on
     Auto Probing:  NA

     Paths:
          Initiator Port Name:  2000000173818713
          Target Port Name:  20030003ba27d212
          Override Path:  NA
          Path State:  OK
          Disabled:  no

         Initiator Port Name:  2000000173018713
          Target Port Name:  20030003ba27d095
          Override path:  NA
          Path State:  OK
          Disabled:  no

     Target Port Groups:
          ID:  2
          Explicit Failover:  yes
          Access State: active
          Target Ports:
               Name:  20030003ba27d212
               Relative ID:  0
    
          ID:  5
          Explicit Failover:  yes
          Access State: standby
          Target Ports:
               Name:  20030003ba27d095
          Relative ID:  0

Saturday, February 21, 2015

Basic Commands (Unix) General Unix Commands :

Basic Commands (Unix)  General Unix Commands :

Command Example Description
1.   ls ls
ls -alF Lists files in current directory
List in long format
2.   cd cd tempdir
d ..
d ~dhyatt/web-docs Change directory to tempdir
ove back one directory
ove into dhyatt's web-docs directory
3.   mkdir mkdir graphics Make a directory called graphics
4. rmdir rmdir emptydir Remove directory (must be empty)
5.   cp cp file1 web-docs
cp file1 file1.bak Copy file into directory
Make backup of file1
6.     rm rm file1.bak
rm *.tmp Remove or delete file
Remove all file
7.   mv mv old.html new.html Move or rename files
8.     more more index.html Look at file, one page at a time
9.   lpr lpr index.html Send file to printer
10. man man ls Online manual (help) about command

Friday, February 20, 2015

Sharing directories with NFS in Solaris 10

Sharing directories with NFS in Solaris 10

To share a directory in Solaria, the home of the users, or a directory with binaries.
With svcs the service status can be checked, so lets check the status of the nfs server:

#svcs network/nfs/server
STATE STIME FMRI
offline 2:19:03 svc:/network/nfs/server:default
The service is offline, so you have to enable it and start it, lets do it:
#svcadm enable -r network/nfs/server
#svcadm enable -s network/nfs/server
#svcadm restart network/nfs/server
Now it is started:
#svcs network/nfs/server
STATE STIME FMRI
online 2:29:51 svc:/network/nfs/server:default
Now, to share a directory, edit /etc/dfs/dfstab and add:
share -F nfs /export/test
Save the file and execute:
#shareall -F nfs
Now check the shares:
#share
- /export/test rw "" 

Monday, September 8, 2014

Step by Step creating partition in Red Hat Linux / How to create partition in Red Hat Linux environment ?

Create a 500MB new partition and should be mounted under /mountpoint as ext4 type.

Answer:

# fdisk -cul (for viewing the partition information)
# fdisk -cu /dev/vda
# m (for help)
# n (for new partition)
# e (for all spaces extended partition)
# Not p (because primary partition limit only 4)
# 3 (for partition number)
# Enter (for first cylinder)
# Enter (for last cylinder)
# w (for save)
# reboot (for rebooting the machine)

After rebooting the machine:    

# fdisk -cul (for viewing partition)
# fdisk -cu /dev/vda
# m (for help)
# n (for new partition)
# l (for logical partition)
# Enter (for first cylinder)
# +500M Enter (for last cylinder)
# w (for save)
# reboot (for rebooting the machine)

After rebooting the machine:    

# fdisk -cul (for viewing partition)
# mkfs.ext4 /dev/vda5
# mkdir -p /mountpoint (p for focely created one directory in another)
# mount /dev/vda5 /coss/new/
# df -h (for mounting information)
# vim /etc/fstab (for permanently mount)

  /dev/vda5         /mountpoint          ext4                       defaults               0 0

# mount -a

# df -h

difference between data and metadata



Metadata
 describes about data. It is ‘data about data’. It has information about how and when, by whom a certain data was collected and the data format. It is essential to understand information that is stored in data warehouses and xml-based web applications.

So, "meta" simply means "about the thing you're talking about". So metadata is data about the data. Data is information. Metadeta is information about the information. For example, you might have a chart that lists the population of each US State. You might then have details about that chart - what color it is, if it's a bar chart or a pie chart, what symbols are on it, etc. That would be metadata. 



Data dictionary is a file which consists of the basic definitions of a database. It contains the list of files that are available in the database, number of records in each file, and the information about the fields.

So,A data is individual facts, statistics, or items of information.Metadata describes other data. It provides information about a certain item's content. For example, an image may include metadata that describes how large the picture is, the color depth, the image resolution, when the image was created, and other data. A text document's metadata may contain information about how long the document is, who the author is, when the document was written, and a short summary of the document. 

Changing the Hostname (RedHat)

Changing the Hostname (RedHat)

hostname command by default will display the current hostname 

for temporarily change the hostname you may type :- 

# hostname xxx.yyyy.com                                                 

And it will be gone after reboot so , for permanently change it ,

RedHat based system use the file /etc/sysconfig/network to read the saved hostname at system boot.

# vi /etc/sysconfig/network 


NETWORKING=yes
HOSTNAME=xxx.yyyy.com


And after that reboot your system and hostname will be changed .








You may also check this links :- details provided with snapshot :- )
http://computernetworkingnotes.com/network-administration/network-setup-in-rhce6.html

Featured Post

Managing CA Certificates on Red Hat Linux 9: Understanding update-ca-trust extract

  Managing CA Certificates on RHEL9 RHEL8 OracleLinux9 OracleLinux8 In today's digital landscape, securing communications and verifying ...