Pages

Monday, June 5, 2017

How to create a PXE Boot server.

How to create a PXE ( Preboot eXecution Environment ) boot server

Pre-requisites

1) dhcp
2) tftp-server
3) syslinux
4) http/ftp (any one)

dhcp packages    : dhcp-3.0.7-7.5.20.x86_64.rpm & dhcp-server-3.0.7-7.5.20.x86_64.rpm
tftpboot package  : tftp-0.48-1.6.x86_64.rpm
pxeboot package : syslinux-3.11-20.14.26.x86_64.rpm

1) Prepare installation media on PXE server
2) Configure HTTP/FTP server 
3) Configure TFTP server
4) Change the owner and permission for /var/lib/tftpboot directory
5) Enable the tftp service in xinetd
6) Configure DHCP server

1) Prepare installation media on PXE server

Next we need to copy all the files from the installation media(CD/DVD,ISO) to our PXE server.

You can also mount the media file on the PXE server in case you don't want to copy all the files but using that way you will only be able to configure your PXE server for one OS. For configuring multiple OS you will have to copy the OS files into separate directory for different OS.

In below example we will be configuring a PXE server to install CentOS 6.2

Let us create separate directory to save all the installation files

# mkdir -p /var/lib/tftpboot/images/centos/6/i386/
# mkdir -p /var/lib/tftpboot/images/centos/6/x86_64/

To skip the lenghty process as of now we will just mount the dvd to relevant destination.

# mount /dev/sr0 /var/lib/tftpboot/images/centos/6/i386/

2) Configure HTTP/FTP server

You can use either HTTP/FTP servers for your purpose. But I will show you the configuration of all three so that you can choose any one as per your requirement.

With HTTP server

# vi /etc/httpd/conf/httpd.conf
At the end of the file add the following lines
<VirtualHost 192.168.1.6:80>
    ServerAdmin root@test.example.com
    DocumentRoot /var/lib/tftpboot/images
    ServerName test.example.com
    ErrorLog logs/test.example.com-error_log
    CustomLog logs/test.example.com-access_log common
</VirtualHost>

<Directory /var/lib/tftpboot/images>
AllowOverride None
Options Indexes FollowSymlinks
Order allow,deny
Allow from all
</Directory>

3) Configure TFTP server (Installing syslinux package)

Tftp configuration includes installation of syslinux package, pxelinux.0 file will be created under /usr/share/pxelinux/ directory. This is required to load,install kernel and initrd images on the client machine.

Once these packages are installed copy the below files from the specified directory to /var/lib/tftpboot

# cp /usr/share/syslinux/pxelinux.0     /var/lib/tftpboot/
# cp /usr/share/syslinux/chain.c32     /var/lib/tftpboot/
# cp /usr/share/syslinux/menu.c32     /var/lib/tftpboot/
# cp /usr/share/syslinux/memdisk     /var/lib/tftpboot/
# cp /usr/share/syslinux/mboot.c32     /var/lib/tftpboot/

Next we will create the configuration file required for tftp server
# mkdir /var/lib/tftpboot/pxelinux.cfg

Create a new file "default" under "/var/lib/tftpboot/pxelinux.cfg" folder and add the below entries.

For HTTP server

# vi /var/lib/tftpboot/pxelinux.cfg/default
DEFAULT menu.c32
PROMPT 0
TIMEOUT 100
ONTIMEOUT Local

MENU TITLE PXE Menu

MENU seperator
LABEL CentOS 6.2
KERNEL images/centos/6/i386/images/pxeboot/vmlinuz
APPEND initrd=images/centos/6/i386/images/pxeboot/initrd.img method=http://192.168.1.6/centos/6/i386 devfs=nomount

MENU seperator
LABEL Local
LOCALBOOT 0Here two things which you need to change

KERNEL - defines the location from where the PXELINUX bootloader will load
APPEND - defines the location for PXE initrd image file to load

For FTP server

There is not much change for ftp server just replace the below line in the above file
APPEND initrd=images/centos/6/i386/images/pxeboot/initrd.img method=ftp://192.168.1.6/centos/6/i386 devfs=nomount

4) Change the owner and permission for /tftpboot directory

Assign nobody:nobody to /var/lib/tftpboot directory.

# chown nobody:nobody /var/lib//tftpboot
# chmod 777 /var/lib//tftpboot

5) Enable the tftp service in xinetd

# vi /etc/xinetd.d/tftp
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

Restart the relevant services
# /etc/init.d/xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

6) Configure DHCP server

# vi /etc/dhcp/dhcpd.conf
option domain-name "example.com";
option domain-name-servers test.example.com;
default-lease-time 600;
max-lease-time 7200;
authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.1.20 192.168.1.25;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;

  allow booting;
        allow bootp;

        next-server 192.168.1.6;
        filename "pxelinux.0";
}

IMPORTANT NOTE: In your dhcp server make sure you add these lines
        next-server 192.168.1.6;
        filename "pxelinux.0";

as these define the address of your tftp server and the file to look for after getting the IP Address from dhcp server

Restart the relevant services
# service dhcpd restart
Shutting down dhcpd:                                       [  OK  ]
Starting dhcpd:                                            [  OK  ]

Make sure the services start after reboot
# chkconfig httpd on
# chkconfig xinetd on
# chkconfig dhcpd on

TIPS: 

next-server : statement is  used  to  specify  the  host address  of  the  server  from which the initial boot file (specified in the filename statement)  is  to  be  loaded. Server-name  should  be  a  numeric IP address or a domain name.

filename : option should be the name of the file which will be retrieved via TFTP the client filename pxelinux.0 is a boot loader.

Iptables rules

For DHCP server
# iptables -I INPUT -m state --state NEW -p udp --dport 69 -j ACCEPT

For HTTP server
# iptables -I INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT

For FTP server
# iptables -I INPUT -m state --state NEW -p tcp --dport 21 -j ACCEPT

You are all set to test your PXE server. Boot a machine and select the option of Network Boot from Bios. You should see the below screen.

How PXE Boot Works and what is the use of TFTP and FTP/HTTP in PXE Boot


The PXE environment relies on a combination of UDP/IP, DHCP and TFTP. These are selected as they can be easily implemented in the client's NIC firmware, resulting in standardized small-footprint PXE ROMs. 

DHCP is used to provide the appropriate client network parameters and specifically the location (IP address) of the TFTP server hosting, ready for download, the initial bootstrap program (NBP) and complementary files. To initiate a PXE bootstrap session the DHCP component of the client's PXE firmware broadcasts a DHCPDISCOVER packet containing PXE-specific options to port 67/UDP (DHCP server port); it asks for the required network configuration and network booting parameters. The PXE-specific options identify the initiated DHCP transaction as a PXE transaction. Standard DHCP servers (non PXE enabled) will be able to answer with a regular DHCPOFFER carrying networking information (i.e. IP address) but not the PXE specific parameters. A PXE client will not be able to boot if it only receives an answer from a non PXE enabled DHCP server.


After parsing a PXE enabled DHCP server DHCPOFFER, the client will be able to set its own network IP address, IP Mask, etc., and to point to the network located booting resources, based on the received TFTP Server IP address and the name of the NBP. The client next transfers the NBP into its own random-access memory (RAM) using TFTP, possibly verifies it (i.e. UEFI Secure Boot), and finally boots from it. NBPs are just the first link in the boot chain process and they generally request via TFTP a small set of complementary files in order to get running a minimalistic OS executive (i.e. WindowsPE, or a basic Linux kernel+initrd). The small OS executive loads its own network drivers and TCP/IP stack. At this point, the remaining instructions required to boot or install a full OS are provided not over TFTP, but using a robust transfer protocol (such as HTTP, CIFS, or NFS).

What is VMLINUZ and Difference between VMLINUZ and INITRD

Difference between initrd and vmlinuz


vmlinuz:

vmlinuz is the name of the Linux kernel executable. vmlinuz is a compressed Linux kernel, and it loads the OS into memory so that the server becomes usable.

vmlinuz = Virtual Memory LINUx gZip = Compressed  Bootable Linux kernel Executable
vmlinux = Virtual Memory LINUX = Non-compressed Non-Bootable Linux Kernel Executable

At the head of the kernel image (vmlinuz) is a routine that does some minimal amount of hardware setup and then decompresses the kernel contained within the kernel image and places it into high memory. 

If an initial RAM disk image (initrd) is present, this routine moves it into memory (or we can say extract the compressed ramdisk image in to the real memory) and notes it for later use. The routine then calls the kernel and the kernel boot begins.



vmlinuz is located in the /boot directory, which is the directory that contains the files needed to begin booting the system. The file named vmlinuz might be the actual kernel executable itself, or it could be a link to the kernel executable, which might bear a name such as /boot/vmlinuz-2.4.18-19.8.0 (i.e., the name of the specific version of the kernel). This can be easily determined by using the ls command (whose purpose is to list the contents of a specified directory) with its -l option (which tells ls to provide detailed information about each object in the specified directory) as follows:

ls -l /boot

If vmlinuz is an ordinary file (including an executable), the information about it in the first column will begin with a hyphen. If it is a link, it will begin with the letter l.

The Linux kernel is compiled by issuing the following command:

make bzImage

This results in the creation of a file named bzImage in a directory such as /usr/src/linux/arch/i386/linux/boot/.

Compilation is the conversion the kernel's source code (i.e., the original form in which the kernel is written by a human) into object code (which is understandable directly by a computer's processor). It is performed by a specialized program called a compiler, usually one in the GCC (GNU Compiler Collection).

bzImage is then copied using the cp (i.e., copy) command to the /boot directory and simultaneously renamed vmlinuz with a command such as

cp /usr/src/linux/arch/i386/linux/boot/bzImage /boot/vmlinuz

vmlinuz is the name of the Linux kernel executable.

A kernel is a program that constitutes the central core of a computer operating system. It is the first thing that is loaded into memory (which physically consists of RAM chips) when a computer is booted up (i.e., started), and it remains in memory for the entire time that the computer is in operation. An executable, also called an executable file, is a file that can be run as a program.

vmlinux is generally just an intermediate step to producing vmlinuz.

initrd:

The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real rootfile system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. The kernel then mounts this initrd as part of the two-stage boot process to load the modules to make the real file systems available and get at the real root file system.

The initrd contains a minimal set of directories and executables to achieve this, such as the insmod tool to install kernel modules into the kernel.

Anatomy of the initrd:

The initrd image contains the necessary executables and system files to support the second-stageboot of a Linux system. Let see what inside the initrd image file:

Copy initrd image file into test directory & rename it as zip file & unzip that file.

Extract the uncompress initrd image file using cpio command:

Now you will have all the directory structure in the test directory looks like a root (/) file system.

Anatomy of the vmlinuz:

The vmlinuz itself is an executable binary file. Here we use readelf & objdump command to display information about BFD library, Object Header info etc. 
The vmlinuz file contains other things besides the gzipped content, so you need to find out where the gzipped content starts. To do that, use:
image
We are looking for 1f 8b 08 00, which can be found from character 12 onwards, or, at 0013920 + 12 (start counting from 0) = 13932.

Now that we know where the gzipped content starts (at position 13932)  you can use dd to extract that gzipped content and ungzip it.

Sunday, June 4, 2017

Difference between FTP and TFTP

Difference between FTP and TFTP

FTP 

FTP stands for File Transfer Protocol. It is used to send/receive file from the remote computer. It is defined in RFC959. FTP establishes two connections between client system and server system, one for control information and the other for data to be transfered. Control information carry commands/response. Authentication need to be done initially by way of validating username and password. Once it is done files can be transferred between two systems. FTP handles both binary and text format files.

When a FTP client requests to connect to the FTP server, a TCP connection is being established to the FTP server's port 21 reserved for FTP. After authentication is done, another TCP connection is being established for the actual data transfer on port number 20.

TFTP

TFTP stands for Trivial File Transfer Protocol. It is defined in RFC783. It is simpler than FTP, does file transfer between client and server process but does not provide user authentication and other useful features supported by FTP. TFTP uses UDP while FTP uses TCP.

As TFTP is unreliable protocol due to UDP, it uses application layer recovery supported by UDP. This is done by embedding a small header between the UDP header and the data. This header incorporates codes for example read,write and acknowledgement along with numbering scheme which numbers 512 bytes of data. These block numbers provided are used to acknowledge the receipt and re-send the data in case of checksum failures. TFTP sends one block and waits on acknowledgement before sending another block.

The default configuration file for tftpd-hpa is /etc/default/tftpd-hpa.

The default root directory where files will be stored is /var/lib/tftpboot.                            

FTP (File Transfer Protocol)
TFTP(Trivial File Transfer Protocol)
It uses TCP port numbers 20 & 21.          
It uses UDP port number 69.
It uses TCP as transport layer protocol
It uses UDP as transport layer protocol.
FTP uses robust control commands.
TFTP uses simple control commands.
Sends data over a separate TCP  
It uses no connections because UDP is connectionless protocol.
It requires less memory and programming effort.
It requires less memory and programming effort.
It is specified in RFC959 document.
It is specified in RFC959 document.

Wednesday, May 24, 2017

Migrate OS from one HDD to another

Migrate standard RHEL installation from one hard disk to another

Posted on 
You have one standard installation of RHEL, you need migrate the installation from one hard disk to another, this is required due to technology improvement.
The server is productive and has running critical services, so is important minimize the migration window, this procedure requires only one reboot, if you want to apply all changes immediately but you can program the restart after.
For x86_64
Scenario:
vda -> Old Disk
vdb -> New Disk
centos -> root volume group
Partitioning:
# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   18G  983M   17G   6% /
devtmpfs                 487M     0  487M   0% /dev
tmpfs                    497M     0  497M   0% /dev/shm
tmpfs                    497M  6.7M  490M   2% /run
tmpfs                    497M     0  497M   0% /sys/fs/cgroup
/dev/vda1                497M  164M  333M  33% /boot
tmpfs                    100M     0  100M   0% /run/user/0
tmpfs                    100M     0  100M   0% /run/user/1000
# fdisk -l
   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048     1026047      512000   83  Linux
/dev/vda2         1026048    41943039    20458496   8e  Linux LVM
Steps:
Clean yum cache:
# yum clean all
Clone partitioning scheme:
# sfdisk -d /dev/vda | sfdisk --force /dev/vdb
Move Logical Volume to new disk:
# pvcreate /dev/vdb2
# vgextend centos /dev/vdb2
# pvmove /dev/vda2
# vgreduce centos /dev/vda2
# pvremove /dev/vda2
Clone /boot:
# umount /boot/
# dd if=/dev/vda1 of=/dev/vdb1 bs=512 conv=noerror,sync
# mount /boot
Copy boot sector:
# dd if=/dev/vda of=/dev/vdb bs=1 count=512
Install GRUB in new disk:
# grub2-install /dev/vdb
Sync changes:
# sync
Reboot your physical or virtual machine, please make sure that your new disk is the default boot device or remove old disk but don't delete data, can be useful in a rollback situation.
For POWER
Scenario:
sda -> Old Disk
sdb -> New Disk
ca -> root volume group
Partitioning:
# df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/ca-root   28G  1.1G   27G   4% /
devtmpfs             449M     0  449M   0% /dev
tmpfs                495M     0  495M   0% /dev/shm
tmpfs                495M   12M  484M   3% /run
tmpfs                495M     0  495M   0% /sys/fs/cgroup
/dev/sda2            497M  143M  354M  29% /boot
tmpfs                 99M     0   99M   0% /run/user/0
# fdisk -l
  Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048       10239        4096   41  PPC PReP Boot
/dev/sda2           10240     1034239      512000   83  Linux
/dev/sda3         1034240    62914559    30940160   8e  Linux LVM
Steps:
Clean yum cache:
# yum clean all
Clone partitioning scheme:
# sfdisk -d /dev/sda | sfdisk --force /dev/sdb
Move Logical Volume to new disk:
# pvcreate /dev/sdb3
# vgextend centos /dev/sdb3
# pvmove /dev/sda3
# vgreduce centos /dev/sda3
# pvremove /dev/sda3
Clone PPC PReP Boot partition:
dd if=/dev/sda1 of=/dev/sdb1 bs=512 conv=noerror,sync
Clone /boot:
# umount /boot/
# dd if=/dev/sda2 of=/dev/sdb2 bs=512 conv=noerror,sync
# mount /boot
Copy boot sector:
# dd if=/dev/sda of=/dev/sdb bs=1 count=512
Install GRUB in new disk:
# grub2-install /dev/sdb
If you receive this message: grub2-install: error: the chosen partition is not a PReP partition. maybe you can try with:
# grub2-install /dev/sdb1
Sync changes:
# sync
Reboot your physical or virtual machine, please make sure that your new disk is the default boot device or remove old disk but don't delete data, can be useful in a rollback situation.

About LUN's and Multipath

What is a LUN


In computer storage, a Logical Unit Number, or LUN, is a number used to identify a logical unit, which is a device addressed by SAN. LUN vs. SCSI Device ID: The LUN is not the only way to identify a logical unit. There is also the SCSI Device ID, which identifies a logical unit uniquely in the world

How to scan LUN in the server

For FC Host

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

Above command performs a Loop Initialization Protocol (LIP) and then scans the interconnect and causes the SCSI layer to be updated to reflect the devices currently on the bus. A LIP is, essentially, a bus reset,  and will cause device addition and removal. This procedure is necessary to configure a new SCSI target on a Fibre Channel interconnect. Bear in mind that issue_lip is an asynchronous operation.

The command may complete before the entire scan has completed. You must monitor /var/log/messages to determine when it is done. The lpfc and qla2xxx drivers support issue_lip

For SCSI Host

# echo "- - -" > /sys/class/scsi_host/host0/scan

It means that you are echoing a wildcard value of "channel target and lun" (CTL), and the operating system will rescan the device path.


The Universally Unique Identifier can be used to identify a device independent form its mount point or device name. This is more and more important as many devices today support hot-plugging or are external anyway. Therefore it makes sometimes sense to access a device (for example in fstab) not by device name but by the UUID.

There are several ways to get the UUID. The first one uses the /dev/ directory. While you are on is you might want to check other by-* directories, I never knew of them.


The reason for using links is because kernel device names (e.g. /dev/sda, /dev/sdb) may change depending on where or when the disk is plugged in, whereas the links in /dev/disk/by-* will always point to the same drive no matter what, and therefore are safer to use.

How to find the Number of HBA's in the server

# lspci | grep -i HBA

04:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)


05:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)

Find out how many host bus adapter configured in the Linux box. You can use “systool -fc_host -v” to verify available FC in the system.


3.If the system virtual memory is too low ,then do not proceed further.If you have enough free virtual memory,then you can proceed with below command to scan new LUNS.

pwd

/sys/class/fc_host/host1

-r--r--r-- 1 root root 4096 Apr  7 03:06 fabric_name
--w------- 1 root root 4096 Apr  7 03:06 issue_lip
-r--r--r-- 1 root root 4096 Apr  7 03:06 node_name
-r--r--r-- 1 root root 4096 Apr  7 03:06 port_id
-r--r--r-- 1 root root 4096 Apr  5 08:40 port_name
-r--r--r-- 1 root root 4096 Apr  5 08:40 port_state
-r--r--r-- 1 root root 4096 Apr  7 03:06 port_type
-r--r--r-- 1 root root 4096 Apr  7 03:06 speed
drwxr-xr-x 2 root root    0 Apr  4 18:22 statistics
lrwxrwxrwx 1 root root    0 Apr  4 18:24 subsystem -> ../../../class/fc_host
-r--r--r-- 1 root root 4096 Apr  7 03:06 supported_classes
-r--r--r-- 1 root root 4096 Apr  7 03:06 supported_speeds
-r--r--r-- 1 root root 4096 Apr  7 03:06 symbolic_name
-rw-r--r-- 1 root root 4096 Apr  7 03:06 system_hostname
-rw-r--r-- 1 root root 4096 Apr  7 03:06 tgtid_bind_type
--w------- 1 root root 4096 Apr  4 18:23 uevent

2.Find out how many SCSI controller configured.

[root@mylinz1 ~]# ls /sys/class/scsi_host/host
host0 host1 host2
In this case,you need to scan host0,host1 & host2.

How to check the HBA driver version


Method 1

[test@linux:NODB /proc/scsi] # lspci | grep -i HBA

04:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)

[test@linux:NODB /proc/scsi] # lspci -v -s 04:00.0
04:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
        Subsystem: QLogic Corp. Device 015c
        Flags: bus master, fast devsel, latency 0, IRQ 98
        I/O ports at ec00 [size=256]
        Memory at df2fc000 (64-bit, non-prefetchable) [size=16K]
        Expansion ROM at df200000 [disabled] [size=256K]
        Capabilities: [44] Power Management version 3
        Capabilities: [4c] Express Endpoint, MSI 00
        Capabilities: [88] MSI: Enable- Count=1/32 Maskable- 64bit+
        Capabilities: [98] Vital Product Data
        Capabilities: [a0] MSI-X: Enable+ Count=2 Masked-
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [138] Power Budgeting <?>
        Kernel driver in use: qla2xxx

        Kernel modules: qla2xxx


# modinfo qla2xxx | grep version
version:        8.03.07.15.05.09-k

Method 2

[test@linux:NODB /proc/scsi] # 
systool -c scsi_host -v | grep 'driver_version'

Method 3   : 

#dmesg | grep -i hba

How to check the HBA driver version


Method 1: 


# systool -c scsi_host -v | grep -w fw_version

Method 2:

# dmesg | grep -i fw

How to check the wwn number 


# cat /sys/class/scsi_host/host1/device/fc_host:host1/port_name
# cat /sys/class/scsi_host/host*/device/fc_host/host*/node_name

[XXXX@XXXX ~]# modinfo qla2xxx | grep version
version:        8.03.01.04.05.05-k
srcversion:     6CD3A3C1F687EACB007F2CD

l2105 ~]# cat /sys/class/fc_host/host*/node_name
0x5001438028cbd4c5
0x5001438028cbd4c7
0x5001438028cbd2c5
0x5001438028cbd2c7

[root@l2105 ~]# lspci | grep -i hba

04:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
04:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
27:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
27:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)

@test ~]# modinfo qla2xxx | grep version
version:        8.07.00.26.06.8-k
srcversion:     50E0219D762F696CEE5A2D3
vermagic:       2.6.32-642.13.1.el6.x86_64 SMP mod_unload modversions

[root@l2105 ~]# lsmod
Module                  Size  Used by
iptable_filter          2793  0
ip_tables              17895  1 iptable_filter
sunrpc                267620  1
bonding               132885  0
ipv6                  336282  0
power_meter             9009  0
acpi_ipmi               3745  1 power_meter
ipmi_si                46440  2 acpi_ipmi
ipmi_msghandler        40044  2 acpi_ipmi,ipmi_si
iTCO_wdt                7278  0
iTCO_vendor_support     3056  1 iTCO_wdt
joydev                 10480  0
hpilo                   7821  8
hpwdt                   7062  0
sg                     29318  0
tg3                   163674  0
bnx2x                 727465  0
ptp                     9614  2 tg3,bnx2x
pps_core               10690  1 ptp
libcrc32c               1246  1 bnx2x
mdio                    4769  1 bnx2x
serio_raw               4626  0
lpc_ich                13571  0
mfd_core                1927  1 lpc_ich
shpchp                 29130  0
ext4                  379559  10
jbd2                   93252  1 ext4
mbcache                 8193  1 ext4
dm_round_robin          2525  4
sd_mod                 37158  8
crc_t10dif              1209  1 sd_mod

qla2xxx               502213  16

How to check LUN ID's in a server

Method 1:

# multipath -ll - Will give the LUN ID's

Method 2: Native Command

# scsi_id -g -s /block/sd<>

-g  - Treat the device as white listed. The -g option must be specified on the command line or in the scsi_id configuration file for scsi_id to generate any output
-s - Generate an id for the sysfs-device.  The sysfs mount point must not be included. For 
example, use /block/sd, not /sys/block/sd.

For each and every LUN there will be a drive letter managed by sd as the drives are managed by sd driver. which can found in /dev/disk/by-id/ - Folder will also have the scsi_id. Else we can get the drive letters by executing fdisk -l and grep for sd then give the sd device name in scsi id command to find the LUN ID. For Eg: if we get output as /dev/sdqp1 then with scsi_id execute scsi_id -g -s /block/sdqp

In the above folder we can four files with same id, that may be because of multipath. Even under /sys/block/sd four devices can have same id may be because of multipathing.