November 18

Linux: NFSv4 Setup

yum install nfs-utils nfs-utils-lib nfs4-acl-tools

echo ‘RPCNFSDARGS=”-N 2 -N 3 -U”‘ >> /etc/sysconfig/nfs

chkconfig nfs on

service nfs start

/etc/exports
/ 192.168.1.0/24(ro,fsid=0)
/mnt/backup 192.168.1.0/24(rw,async,nohide,no_root_squash)

exportfs -rv
exportfs -e

test nfs connection
mount -t nfs4 targetserver:/directory /localdirectory

Category: Linux | Comments Off on Linux: NFSv4 Setup
November 18

Linux: Removing attach storage from a server manually

If multipathing is used find your paths and drive with:
multipath -l (to collect and note the paths to the disk. You will need this information)
Be sure to copy this information to a text editor for future review

Delete paths:
multipath -f path(letter) ( to remove the device from mutipath, where is the mpathX name or alias assigned to the multipath device)

Flush drives:
blockdev –flushbufs /dev/(devicename) ( for each path you collected with multipath -l. This part is especially important when deleting )

Delete drives:
echo 1 > /sys/block/devicename/device/delete

If the above does not work you can do the following:
dmsetup remove -f serialnumberfromthemultipathcommand

Category: Linux | Comments Off on Linux: Removing attach storage from a server manually
November 18

Linux: HBA port information

Verify the status of a server's HBA ports:
grep -v "zZzZ" -H /sys/class/fc_host/host*/port_state
systool -c fc_host -v - This requires the package, sysfsutils to be installed.

modinfo qla2xxx | grep version
version:        9.00.00.00.40.0-k1
srcversion:     67989F13670BACC60C8CA47
vermagic:       4.1.12-124.17.1.el6uek.x86_64 SMP mod_unload modversions 

-------------------------

more /sys/class/fc_host/host?/port_name
::::::::::::::
/sys/class/fc_host/host1/port_name
::::::::::::::
0x2001000e1e096d4a
::::::::::::::
/sys/class/fc_host/host2/port_name
::::::::::::::
0x2001000e1e096d24


Get the hardware information for the HBA to determine if the HBA runs fine, including the PCI registers mapping,  capabilities description, and the driver in use:

$ lspci -vv | grep "Fibre Channel"

Get the HBA WWPN:
$ cat /sys/class/fc_host/host*/port_name

Get the HBA WWNN:
$ cat /sys/class/fc_host/host*/node_name

Get the HBA Speed: 
$ cat /sys/class/fc_host/host*/speed

Get the HBA port state:
$ cat /sys/class/fc_host/host*/port_state

Get the HBA port TYPE:
$ cat /sys/class/fc_host/host*/port_type

Get the HBA statistics:
$ cat /sys/class/fc_host/host*/statistics 

----------------------------------------------------------------------------
Successful Commands with Oracle Linux after new luns are mapped to the server from the SAN:

See the device mapping:
dmsetup info -c -o name,blkdevname,devnos_used,blkdevs_used,UUID

Rescan for devices - there should not be much IO going on when doing the following command
 echo "1" > /sys/class/fc_host/host1/issue_lip 

Verify the status of the rescan:
cat /var/log/messages

See the device mapping after rescan:
dmsetup info -c -o name,blkdevname,devnos_used,blkdevs_used,UUID

----------------------------------------------------------------------------


Use these commands carefully as I/O needs to be stopped to keep from running into issues.
The following commands can be used to scan storage interconnects:

echo "1" > /sys/class/fc_host/host/issue_lip

    This operation performs a Loop Initialization Protocol (LIP), scans the interconnect, and causes the SCSI layer to be updated to reflect the devices currently on the bus. Essentially, an LIP is a bus reset, and causes device addition and removal. This procedure is necessary to configure a new SCSI target on a Fibre Channel interconnect.
    Note that issue_lip is an asynchronous operation. The command can complete before the entire scan has completed. You must monitor /var/log/messages to determine when issue_lip finishes.
    The lpfc, qla2xxx, and bnx2fc drivers support issue_lip. For more information about the API capabilities supported by each driver in Red Hat Enterprise Linux, see Table 26.1, “Fibre-Channel API Capabilities”. 

/usr/bin/rescan-scsi-bus.sh

    The /usr/bin/rescan-scsi-bus.sh script was introduced in Red Hat Enterprise Linux 5.4. By default, this script scans all the SCSI buses on the system, and updates the SCSI layer to reflect new devices on the bus. The script provides additional options to allow device removal, and the issuing of LIPs. For more information about this script, including known issues, see Chapter 38, Adding/Removing a Logical Unit Through rescan-scsi-bus.sh. 

echo "- - -" > /sys/class/scsi_host/hosth/scan

    This is the same command as described in Chapter 31, Adding a Storage Device or Path to add a storage device or path. In this case, however, the channel number, SCSI target ID, and LUN values are replaced by wildcards. Any combination of identifiers and wildcards is allowed, so you can make the command as specific or broad as needed. This procedure adds LUNs, but does not remove them. 
modprobe --remove driver-name, modprobe driver-name
    Running the modprobe --remove driver-name command followed by the modprobe driver-name command completely re-initializes the state of all interconnects controlled by the driver. Despite being rather extreme, using the described commands can be appropriate in certain situations. The commands can be used, for example, to restart the driver with a different module parameter value. 

Category: Linux | Comments Off on Linux: HBA port information
November 18

Linux: Pull transever information from fiber/fibre sfp

ethtool -m p2p2


Identifier : 0x03 (SFP)
Extended identifier : 0x04 (GBIC/SFP defined by 2-wire interface ID)
Connector : 0x07 (LC)
Transceiver codes : 0x10 0x00 0x000x01 0x00 0x00 0x00 0x00
: => 10G Ethernet: 10G Base-SR
: => Ethernet: 1000BASE-SX
Encoding : 0x06 (64B/66B)
BR, Nominal : 10300MBd
Rate identifier : 0x02 (8/4/2G Rx Rate_Select only)
Length (SMF,km) : 0km
Length (SMF) : 0m
Length (50um) : 80m
Length (62.5um) : 30m
Length (Copper) : 0m
Length (OM3) : 300m
Laser wavelength : 850nm
Vendor name : Intel Corp
Vendor OUI : 00:1b:21
Vendor PN : FTLX8571D3BCVIT1
Vendor rev : A

Category: Linux | Comments Off on Linux: Pull transever information from fiber/fibre sfp