Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, May 20, 2013

Redhat- How to find the Hardware Model on linux ?


Dmidecode reports information about your system's hardware as described in your system BIOS according to the SMBIOS/DMI standard

#dmidecode

This information typically includes system manufacturer, model name, serial number, BIOS version, asset tag as well as a lot of other details of varying level of interest and reliability depending on the manufacturer. This will often include usage status for the CPU sockets, expansion slots (e.g. AGP, PCI, ISA) and memory module slots, and the list of I/O ports (e.g. serial, parallel, USB).

Sunday, May 19, 2013

Redhat Linux 5,6 - How to Scan and configure new Luns from Storage?


SCAN AND CONFIGURE NEW LUNS on RHEL 5 and RHEL 6

If you have 4 fc ports on which you have assigned the storage luns.
Then you need to run the below for loop to scan the LUNS on all the 4 ports.

for i in host1 host2 host3 host0
> do
> echo "1" > /sys/class/fc_host/$i/issue_lip
> echo "- - -" > /sys/class/scsi_host/$i/scan
> done

After this you can run fdisk -l or multipath -ll to see the new luns. Once the new luns are visible , you can use the luns using LVM or raw paritioning.

IF you want to rescan the disk lun then you can run the below command.


echo 1 > /sys/block/sda/device/rescan
echo 1 > /sys/block/sdb/device/rescan
echo 1 > /sys/block/sdc/device/rescan
echo 1 > /sys/block/sdd/device/rescan

Tuesday, April 19, 2011

RHEL -How to check the WWN and WWPN Numbers on Linux

#systool -c fc_host -v -----> Give Server FC WWN & WWPN numbers
#systool -c fc_transport -v --------> Give Server & Storage FC WWN & WWPN numbers

Thursday, April 14, 2011

Redhat Cluster Commands -Linux

Checking status of the cluster
# clustat
Moving a service/package over to another node
# clusvcadm -r -m
Starting a service/package
# clusvcadm -e -m
Stopping/disabling a service/package
# clusvcadm -d

Resource Group Locking (for cluster Shutdown / Debugging):

clusvcadm -l --This prevents resource groups from starting on the local node.
clusvcadm -S --Show lock state
clusvcadm -u --Unlock local resource group manager.This allows resource groups to start on the local node.
clusvcadm -Z -Freeze group in place
clusvcadm -U -Unfreeze/thaw group

[root@host1 ~]# clustat -l
Cluster Status for host1cl @ Thu Apr 14 02:25:29 2011
Member Status: Quorate

Member Name ID Status
------ ---- ---- ------
host1.com 1 Online, Local, rgmanager
host2.com 2 Online, rgmanager

Service Information
------- -----------

Service Name : service:fibrbase
Current State : failed (114)
Flags : none (0)
Owner : none
Last Owner : host1.com
Last Transition : Thu Apr 14 01:39:21 2011

Service Name : service:fsgprod
Current State : failed (114)
Flags : none (0)
Owner : none
Last Owner : host1.com
Last Transition : Thu Apr 14 01:39:27 2011

Service Name : service:wcmnrocp
Current State : failed (114)
Flags : none (0)
Owner : none
Last Owner : host1.com
Last Transition : Thu Apr 14 01:30:20 2011

[root@host1~]#


Gracefully halting the cluster
# clusvcadm -d
**Do the following on each node:**
# umount
# service rgmanager stop
# service gfs stop
# service clvmd stop
# service fenced stop
# cman_tool status
# cman_tool leave
# service ccsd stop

Gracefully starting the cluster (Done on each node)
# service ccsd start
# service cman start
# service fenced start
# service clvmd start
# service gfs start
# service rgmanager start
# cman_tool nodes (shows status of nodes)

Thursday, April 7, 2011

Setup ISCSI on Linux from Netapp

A quick guide to setup IP SAN using Linux-Netapp-iscsi.

On Linux server :
1. Install iSCSI initiator (iscsi-initiator-utils rpm) on your linux machine. This will create the necessary binaries and will create /etc/iscsi.conf and /etc/initiatorname.iscsi
2. Add iscsi-iname to /etc/initiatorname.iscsi .

[root@unixfoo ~]# iscsi-iname
iqn.1987-05.com.cisco:01.44c65d9587d9
[root@unixfoo ~]#

Add the output to /etc/initiatorname.iscsi
3. Add the below lines to /etc/iscsi.conf

Continuous=no
HeaderDigest=never
DataDigest=never
ImmediateData=yes
DiscoveryAddress=192.185.12.12

DiscoveryAddress should be the IP address of the storage.
On Netapp filer :
1. Make sure you have iscsi license enabled.
2. Create volume for holding the iscsi luns.

filer1> vol create iscsivol aggr01 100g
3. Create lun on the volume

filer1> lun create -s 50g -t linux /vol/iscsivol/lun1
4. Create an igroup and add the Linux iscsi-iname to it.

filer1> igroup create -i -t linux iscsigrp
filer1> igroup add iscsigrp iqn.1987-05.com.cisco:01.44c65d9587d9
filer1> igroup show
iscsigrp (iSCSI) (ostype: linux):
iqn.1987-05.com.cisco:01.44c65d9587d9 (logged in on: iswta)
filer1>
5. Map the lun to the iscsi-group.

filer1> lun map /vol/iscsivol/lun1 iscsigrp 0
6. Enable only one interface for iscsi use and disable others

filer1> iswt interface disable e7
filer1> iswt interface show
Interface e0 disabled
Interface e4 enabled
Interface e5 disabled
Interface e7 disabled
filer1>
7. Done on the Netapp side.

On Linux again :
1. Start iscsi initiator

[root@unixfoo ~]# /etc/init.d/iscsi start
Checking iscsi config: [ OK ]
Loading iscsi driver: [ OK ]
Starting iscsid: [ OK ]
[root@unixfoo ~]#
2. Set iscsi initiator to start automatically after reboot.

[root@unixfoo ~]# chkconfig iscsi on
3. Check whether the iscsi lun shows up on the linux machine.

[root@unixfoo ~]# iscsi-ls
*******************************************************************************
SFNet iSCSI Driver Version ...4:0.1.11-3(02-May-2006)
*******************************************************************************
TARGET NAME : iqn.1992-08.com.netapp:sn.50380528
TARGET ALIAS :
HOST ID : 2
BUS ID : 0
TARGET ID : 0
TARGET ADDRESS : 192.185.12.12:3260,2
SESSION STATUS : ESTABLISHED AT Sat Dec 29 21:55:37 PST 2007
SESSION ID : ISID 00023d000001 TSIH 501

DEVICE DETAILS:
---------------
LUN ID : 0
Vendor: NETAPP Model: LUN Rev: 0.2
Type: Direct-Access ANSI SCSI revision: 04
page83 type3: 60a980004f6444662653053584516d34
page80: 4f6444516d344305358066265a
Device: /dev/sdb

*******************************************************************************
[root@unixfoo ~]#
4. Now you have a new device in your linux box (/dev/sdb) - that is your iscsi device. You can create filesystem on it and use it.
5. Done!