Main Menu

Search

Showing posts with label boyella. Show all posts
Showing posts with label boyella. Show all posts

LINUX - HOW TO MOUNT SYSTEM DISK IMAGE FILE OF UEK4 & LATER KERNELS OF ORACLE LINUX VM USING KPARTX COMMANDS AND RUN FSCK?


Below are steps for mounting VM System disk image file using the Logical volume (LVM based) and running fsck.

1. Kpartx command to mount system image file on the available device
 
# kpartx -av vm0-disk.img

add map loop2p1 (249:0): 0 1024000 linear /dev/loop2 2048
add map loop2p2 (249:1): 0 248479467 linear /dev/loop2 1026048
 
2. List the device mappers
 
# ls -lrt /dev/mapper/*

crw-rw---- 1 root root 10, 236 Jul 6 16:25 /dev/mapper/control
lrwxrwxrwx 1 root root 7 Nov 25 17:19 /dev/mapper/loop2p2 -> ../dm-1
lrwxrwxrwx 1 root root 7 Nov 25 17:19 /dev/mapper/loop2p1 -> ../dm-0
 
3. Run fsck command on the mounted logical volume

# fsck -vy /dev/mapper/loop2p1

fsck from util-linux-ng 2.17.2
e2fsck 1.43-WIP (20-Jun-2013)
/boot: clean, 52/126000 files, 147492/512000 blocks
# fsck -vy /dev/mapper/loop2p1
fsck from util-linux-ng 2.17.2
e2fsck 1.43-WIP (20-Jun-2013)
/boot: clean, 52/126000 files, 147492/512000 blocks
# fsck -vy /dev/mapper/loop2p2
fsck from util-linux-ng 2.17.2
fsck: fsck.LVM2_member: not found
fsck: Error 2 while executing fsck.LVM2_member for /dev/mapper/loop2p2
# fsck -vy /dev/mapper/loop2p1
fsck from util-linux-ng 2.17.2
e2fsck 1.43-WIP (20-Jun-2013)
/boot: clean, 52/126000 files, 147492/512000 blocks
 
4. Remove the mounted logical volume device.
 
# kpartx -dv /dev/loop2
del devmap : loop2p2
del devmap : loop2p1
 
# losetup -dv /dev/loop2
 
# ls -lrt /dev/mapper/*
crw-rw---- 1 root root 10, 236 Jul 6 16:25 /dev/mapper/control
#
 

LINUX: MOUNT COMMAND TO MOUNT NFSV4 SHARE

Following is mount command to mount NFSv4 share

mount -t nfs4 192.168.XX.XX:/export/common/testshare testsharenfsv4


LINUX: PS COMMAND / SCRIPT TO CHECK PROCESSES USING PARTICULAR CPU CORE OR VCPU


Following command can be used to find processes using particular, core. In below command example we are finding processes running on CPU core 4. Replace CPU/Core Number as needed for CORENUM argument

CORENUM=4; ps -e -o pid,psr,cpu,cmd | grep -E  "^[[:space:]][[:digit:]]+[[:space:]]+${CORENUM}


Below is sample output of above command.
 

 1027   4   - [scsi_eh_6]

 1779   4   - /bin/bash /usr/sbin/OSWatcher -i 30 -m 48 -l /var/log/oswatcher/log /var/log/oswatcher

 3002   4   - [kworker/4:1H]

 3620   4   - [alias_guid1]

 3651   4   - [mcast_wq]

 4187   4   - [krds_cp_wq_14]

 5542   4   - [fcoethread/4]

 5563   4   - [bnx2fc_thread/4]

 5643   4   - [o2net]

 5702   4   - [nfsiod]

 7114   4   - /usr/bin/python /usr/lib64/python2.6/site-packages/agent/daemon/stats.py

 7372   4   - /sbin/mingetty /dev/tty3

Cisco Management Switch - How To Check SNMP Community String?

Following are steps to verify SNMP Community string being set on the Cisco Management switch.
 
1. Login to the Cisco Management Switch as "admin" user. You will be logged into telnet prompt ">"


>

2. Enter into "Enable" mode by running below "enable" command to run the Cisco Management switch related commands. 


enable
 
3. Now run below command to list the SNMP community strings.

show running-config
 
As an example below is sample output. 

 
snmp-server community public RO  
        
snmp-server community private RW     

 
In this sample output, "public" is the read-only community string and "private" is the read-write community string.   

Above steps will list the SNMP Community strings for Cisco Management Switch.

Once you are done with getting the SNMP community string information, logout of "Enable" mode of Cisco Management switch by running below "disable" command. You will return back to to main Cisco Switch telnet prompt ">". You can then run "exit" command to log out of the Cisco Switch. 

LINUX - FInd Command to FInd and Replace Particular String in All files Inside A Directory (SED Command) (How To Doc)

Below is find command to find and replace particular string in all files in current directory.

In this command example we are replacing host1 inside all files which has it in current directory with host2 word.


find ./ -type f -exec sed -i 's/host1/host2/g' {} \;



Products to which Article Applies
All Linux Operating Systems

Article Author: Tarun Boyella

INFINIBAND: How to upgrade Firmware version on Infiniband (IB) Switches?

Below are steps for upgrading Firmware version on Infiniband Switches.

1. Login to IB switch as root user and then switch to ILOM prompt by running "spsh" command.

2. Run load source command as follows to load the Firmware version package
-> load -source <URL to Firmware version package>
URL can be HTTP, FTP which is reachable from IB Switch. Once we run load source command the Firmware upgrade for Switch will begin.

Wait for firmware upgrade to complete. Switch will reboot as part of Firmware upgrade.

3. Log back in to the switch again and run below commands to verify upgrade succeeded.
version
fwverify

Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella

EXALOGIC: INFINIBAND: Command to Check Symbol Errors on IB Ports on Compute Nodes (How To Doc)

Below command can be used on Exalogic Compute nodes to check for Symbol Errors on IB Ports on Compute Nodes.
cat /sys/class/infiniband/mlx4_0/ports/*/counters/symbol_error
Below is example snippet of above command. In this case there are zero symbol errors on both the IB ports.
# cat /sys/class/infiniband/mlx4_0/ports/*/counters/symbol_error 
0 
0 

Products to which Article Applies
Exalogic racks using Infiniband Switches
Article Author: Tarun Boyella

EXALOGIC: INFINIBAND: "perfquery" command to check Symbol Errors and Other details of Compute Nodes Ports (How To Doc)

Following perfquery command can be executed on Compute node to check the Symbol Errors and Other details of Compute Nodes Ports.
perfquery <Baselid> <Port>
We can get Base lid and Port details from "ibstat" command of the Compute Node. Below is example snippet of "ibstat" command.
CA 'mlx4_0' 
CA type: MT26428 
Number of ports: 2 
Firmware version: 2.11.2010 
Hardware version: b0 
Node GUID: XXXXXXXXXXXXX 
System image GUID: XXXXXXXXXXXXX 

Port 1: 
State: Active 
Physical state: LinkUp 
Rate: 40 
Base lid: 7 
LMC: 0 
SM lid: 41 
Capability mask: 0x02510868 
Port GUID: XXXXXXXXXXXXX 
Link layer: IB 

Port 2: 
State: Active 
Physical state: LinkUp 
Rate: 40 
Base lid: 9 
LMC: 0 
]SM lid: 41 
Capability mask: 0x02510868 
Port GUID: XXXXXXXXXXXXX 
Link layer: IB 
From above output we can see Base lid for Ports 1 and 2 of Compute Nodes. Now if we want to run perfquery on Port 1 on lid 7 command will look as follows:

perfquery 7 1
Below is example snippet of above command. If we notice Symbol Errors increasing in above command output, then it indicates that there is an issue with Compute node IB Port (bad cable, loose cable or other issues).
 # Port counters: Lid 7 port 1 (CapMask: 0x1400) 
PortSelect:......................1 
CounterSelect:...................0x0000 
SymbolErrorCounter:..............0 
LinkErrorRecoveryCounter:........0 
LinkDownedCounter:...............0 
PortRcvErrors:...................0 
PortRcvRemotePhysicalErrors:.....0 
PortRcvSwitchRelayErrors:........0 
PortXmitDiscards:................2 
PortXmitConstraintErrors:........0 
PortRcvConstraintErrors:.........0 
CounterSelect2:..................0x00 
LocalLinkIntegrityErrors:........0 
ExcessiveBufferOverrunErrors:....0 
VL15Dropped:.....................0 
PortXmitData:....................4294967295 
PortRcvData:.....................4294967295 
PortXmitPkts:....................4294967295 
PortRcvPkts:.....................1088593887 
PortXmitWait:....................65418428 

Products to which Article Applies
Exalogic racks using Infiniband Switches

Article Author: Tarun Boyella

INFINIBAND: How to check Node, System Image and Port GUID of IB Switch? (ibstat)

"ibstat" command can be used on IB Switch to check Node, System Image and Port GUID of IB Switch.

Below is example snippet of "ibstat" command.
Switch 'is4_0' 
Switch type: MT48436 
Number of ports: 0 
Firmware version: 7.4.3002 
Hardware version: a1 
Node GUID: 0x0010e0620028c0a0 
System image GUID: 0x0010e0620028c0a3 
Port 0: 
State: Active 
Physical state: LinkUp 
Rate: 40 
Base lid: 12 
LMC: 0 
SM lid: 27 
Capability mask: 0x4250084a 
Port GUID: 0x0010e0620028c0a0 

Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella

EXALOGIC: INFINIBAND: How to correlate which Physical Connector Ports of IB Switch are connected to which Compute Nodes?

On IB Switches typically Switch ports will have physical name for connector ports which is different than the Switch Port numbers seen in "ibnetdiscover" command. Names for Switch Ports will be 1A, 1B ... 14A, 14B ... etc. These names can be mapped to Switch Port numbers by looking at "listlinkup" command output.

For e.g. if you want to track the Switch connector port 13A below is how we can do it.

Run "listlinkup" command to see to which Switch Port the Switch Connector port 13A maps to. For e.g. from listlinkup command example output below we see as follows that connector port 13A corresponds to Switch Port 9.
 Connector 13A Present <-> Switch Port 9 up (Enabled) 
Now run "ibnetdiscover" command. From ibnetdiscover output we see switch Port 9 of both Switches is connected to Compute node 6 as seen in below example output. 

 Ca 2 "H-XXXXXXXXX" # "el01cn06 EL-C  XX.XX.XX.XX HCA-1" 
[2](ZZZZZZZZZZZZZZ) "S-00XXXXXXXXXX0a0"[9] # lid 25 lmc 0 "SUN IB QDR GW switch el01gw02 XX.XX.XX.XX leaf:2" lid 11 4xQDR 
[1](ZZZZZZZZZZZZZZ) "S-00XXXXXXXXXX0a0"[9] # lid 24 lmc 0 "SUN IB QDR GW switch el01gw01 XX.XX.XX.XX leaf:1" lid 41 4xQDR  



Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella

INFINIBAND: "getportcounters" Command to check if there are any Issues on Ethernet ETH Connector Ports of IB Switch.

Below "getportcounters" Command can be used to check if there are any Issues on Ethernet ETH Connector Ports of IB Switch.
getportcounters <Connector Port>
For example if you want to check the counters on port 0A-ETH-1 above command looks as follows:
getportcountersm 0A-ETH-1
Below is sample output of above command. If we see RX CRC count increasing then it indicates a problem with connector port (either bad cable, loose cabling or issues with Switch connector port or external switch to which Switch connector port is cabled).

Port counters for connector 0A-ETH-1 Bridge-0 port Bridge-0-2 
RX bytes.........................4867164034 
RX packets.......................42669859 
RX Jumbo packets.................0 
RX unicast packets...............28356686 
RX multicast packets.............12729499 
RX broadcast packets.............1583674 
RX no buffer.....................0 
RX CRC...........................0 
RX runt..........................0 
RX errors........................0 
TX bytes.........................52228156 
TX packets.......................126667 
TX Jumbo packets.................80133903301347 
TX unicast packets...............116537 
TX multicast packets.............10105 
TX broadcast packets.............25 
TX errors........................0 

Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella

INFINIBAND: "getportcounters" Command to check if there are any Symbol Errors, Link Issues on Switch Ports of IB Switch.

Below "getportcounters" Command can be used to check if there are any Symbol Errors, Link Issues on Switch Ports of IB Switch.
getportcounters <Switch Port>
For example if you want to check the counters on port 6 above command looks as follows:
getportcounters 6
Below is sample output of above command. If we see SymbolErrors increasing then that indicates there is an issue with the Switch port (loose cable, bad cable, bad switch port or something else)
SymbolErrors.....................0 
LinkRecovers.....................0 
LinkDowned.......................0 
RcvErrors........................0 
RcvRemotePhysErrors..............0 
RcvSwRelayErrors.................297 
XmtDiscards......................6 
XmtConstraintErrors..............0 
RcvConstraintErrors..............0 
LinkIntegrityErrors..............0 
ExcBufOverrunErrors..............0 
VL15Dropped......................0 
XmtData..........................4294967295 
RcvData..........................4294967295 
XmtPkts..........................717430186 
RcvPkts..........................634187063 
XmtWait..........................1338332 

Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella

INFINIBAND: "getportstatus" command to check status and details (MTU, Speed) of Ethernet ETH connector port on IB Switches (How To Doc)

Following getportstatus command can be used to check status and details (MTU, Speed) of Ethernet ETH connector ports on IB Switches.
getportstatus <Connector Port>
If you want to check status of 0A-ETH-1, command looks like follows:
getportstatus 0A-ETH-1
Below is example output of above command.
Adminstate.......................Enabled 
State............................Up 
Link state.......................Up 
Protocol.........................Ethernet 
Link Mode........................XFI 
Speed............................10Gb/s 
MTU..............................9600 
Tx pause.........................Global 
Rx pause.........................Global 

Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella

INFINIBAND: "showgwports" command to check status of Ethernet ETH connector ports on IB Switches (How To Doc)

"showgwports" command can be used to check status of Ethernet ETH connector ports on IB Switches (How To Doc)

Below is example output of showgwports command for reference.

In below output 0A-ETH-1 is enabled which means it is connected and link state is Down (likely due to port issue on upstream data center switch). 0A-ETH-3 is Disabled which means that it is not even connected to upstream switch. 0A-ETH-2 is the connector port which is enabled and link state is UP which means that it is operational.
Port      Bridge      Adminstate Link  State       MTU  TxPause  RxPause 
------------------------------------------------------------------------- 
0A-ETH-1  Bridge-0-2  Enabled    Down  Reset       9600 Global   Global 
0A-ETH-2  Bridge-0-2  Enabled    Up    Up          9600 Global   Global 
0A-ETH-3  Bridge-0-1  Disabled   Down  Reset       9600 Global   Global 
0A-ETH-4  Bridge-0-1  Enabled    Down  Reset       9600 Global   Global 

Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella

INFINIBAND: How to enable Ethernet ETH Connector Ports on IB Switch?

Below command can be used to enable Ethernet ETH Connector Ports on IB Switch.
enablegwport <Connector Port>
For example if connector port 0A-ETH-3 has to be enabled, command will look as follows:
enablegwport 0A-ETH-3

Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella

INFINIBAND: How to disable Ethernet ETH Connector Ports on IB Switch?

Below command can be used to disable Ethernet ETH Connector Ports on IB Switch.
disablegwport <Connector Port>
For example if connector port 0A-ETH-3 has to be disabled, command will look as follows:
disablegwport 0A-ETH-3

Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella

INFINIBAND: How to Move (Failover) SM Master (Subnet Manager Master) From One IB Switch to Other IB Switch?

Follow below steps for doing SM Master failover.

1. Verify that SM is enabled with correct SM settings on two or more IB Gateway Leaf Switches (depending on the configuration you have). For validating if SM is running following command can be executed on all the IB Switches.
service opensmd status
For validating the current SM settings following command can be executed.

setsmpriority list
2. Identify the Switch running the SM Master. For this run below command on any of the IB Switches.
getmaster
3. Login to IB Switch running SM Master (identified in above step 1) and disable SM using below command.
disablesm
After running above command SM Master will move to one of the other Switches which has SM enabled.

4. Verify that the SM master has moved to different Switch by running "getmaster" command on one of the IB Switches.

5. Enabled back the SM again on the Switch which was running the SM master before (identified in above step 2). For this run below command.
enablesm

Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella

INFINIBAND: smpartition command to abort the changes done to partitions on IB Switch (How To Doc)

Below smpartition abort command can be used to abort any changes made to the partition.
smpartition abort
For making changes to partitions we first run "smpartition start", make changes to partitions using smpartition commands and then finally commit the changes using "smpartition commit" command. If for some reason if changes made to partitions has to be aborted, above "smpartition abort" command can be executed instead of "smpartition commit" command


Products to which Article Applies
Infiniband Switches


Article Author: Tarun Boyella

Cisco Management Switch: How to validate if Cisco Switch is healthy?

"show tech-support" command output can be reviewed to validate if Cisco Switch is healthy.

Below is snippet of show tech-support command output from Cisco Switch where we see NO indication of any issues with the cisco switch. no temperature alarms etc. All Sensors are OK, Green and good status.
Module Sensor                     Temperature          Status  
------+--------------------------+--------------------+------------  
1      air inlet                  47C (58C,73C,76C)              ok  
1      air outlet                 47C (65C,81C,84C)              ok  

Power                                             Fan      Inline  

Supply  Model No          Type       Status       Sensor   Status  
------  ----------------  ---------  -----------  -------  -------  
PS1     PWR-XXXX-300AC-F  AC 300W    good         good     n.a.  
PS2     PWR-XXXX-300AC-F  AC 300W    good         good     n.a.  

Power supplies needed by system    : 1  
Power supplies currently available : 2  

Chassis Type : WS-C4948E-F 
 
Power consumed by backplane : 0 Watts  

Switch Bandwidth Utilization : 0%  

Supervisor Led Color : Green   

Module  1 Status Led Color  : Green  

Fantray : Good  

Fantray removal timeout : 80  

Power consumed by Fantray : 30 Watts  

Switch uptime is 2 years, 7 weeks, 4 days, 15 hours, 14 minutes 

Products to which Article Applies
Cisco Management Switch


Article Author: Tarun Boyella

INFINIBAND: How to create VLAN on IB Switch?

Below command can be executed to create VLAN on IB Switch.
createvlan <Connector Port> -VLAN <VLAN ID> -PKEY <Partition Key> 
For e.g. if you want to create VLAN 370 which on Connector Port 0A-ETH-1 and Partition Key 8007, your command will look as follows:
createvlan 0A-ETH-1 -VLAN 370 -PKEY 0x0007  
Products to which Article Applies
Infiniband Switches

Article Author: Tarun Boyella