8
Solaris – How to Scan FC LUNS and SCSI Disks ? August 30, 2013 Solaris 10 17,412 Views Application’s and Database’s storage requirement on the servers will be keep on increase day by day. According to that, Unix admin need to increase filesystem space on Unix servers periodically. Assigning big SAN space to filesystem also not possible since storage cost involved on that. So it’s a routine work for Unix admin and need to follow best practice for scanning the storage and adding in to the filesystem. In Solaris, we can able to scan the LUNS without rebooting the host. But in rare circumstances, we may need to end up with server reboot to see newly assigned LUNS. Here we will see how to scan the local disks and SAN LUNs in Solaris host. Scanning FC/SAN LUNS in Solaris Before scanning LUNS, we see some useful commands which are related to Fibre Channel(FC). 1.List the connected HBA’s. root@Unixarena-SOL11:~# luxadm -e port |grep CONNECTED /devices/pci@1d,700000/SUNW,qlc@1,1/fp@0,0:devctl CONNECTED /devices/pci@1d,700000/SUNW,qlc@3/fp@0,0:devctl CONNECTED 2.Verify FC channel ‘s are connected and configured. Unix@sol# cfgadm -al -o show_FCP_dev |grep fc-fabric c2 fc-fabric connected configured unknown c4 fc-fabric connected configured unknown Unix@sol# 3.To find the HBA’s World wide Node number (WWN),use fcinfo command, Unix@sol# fcinfo hba-port |grep Port HBA Port WWN: 10000000c884bb48

Solaris Linux Scan Lun

Embed Size (px)

Citation preview

Page 1: Solaris Linux Scan Lun

Solaris – How to Scan FC LUNS and SCSI Disks ?August 30, 2013 Solaris 10 17,412 Views

Application’s and Database’s storage requirement on the servers will be keep on increase day by day. According to that, Unix admin need to increase filesystem space on Unix servers periodically. Assigning big SAN space to filesystem also not possible since storage cost involved on that. So it’s a routine work for Unix admin and need to follow best practice for scanning the storage and adding in to the filesystem. In Solaris, we can able to scan the LUNS without rebooting the host. But in rare circumstances, we may need to end up with server reboot to see newly assigned  LUNS. Here we will see how to scan the local disks and SAN LUNs in Solaris host.

Scanning FC/SAN LUNS in Solaris

Before scanning LUNS, we see some useful commands which are related to Fibre Channel(FC).

1.List the connected HBA’s.

root@Unixarena-SOL11:~# luxadm -e port |grep CONNECTED/devices/pci@1d,700000/SUNW,qlc@1,1/fp@0,0:devctl CONNECTED/devices/pci@1d,700000/SUNW,qlc@3/fp@0,0:devctl CONNECTED

2.Verify FC channel ‘s are connected and configured.

Unix@sol# cfgadm -al -o show_FCP_dev |grep fc-fabricc2 fc-fabric connected configured unknownc4 fc-fabric connected configured unknownUnix@sol#

3.To find the HBA’s World wide Node number (WWN),use fcinfo command,

Unix@sol# fcinfo hba-port |grep PortHBA Port WWN: 10000000c884bb48HBA Port WWN: 10000000c884bb49HBA Port WWN: 10000000c884b85cHBA Port WWN: 10000000c884b85dUnix@sol#

4.You can also find the WWN form luxadm command, if  HBA is  already connected to FC switch.

Unix@sol# luxadm -e dump_map /dev/cfg/c4Pos Port_ID Hard_Addr Port WWN Node WWN Type0 29900 0 50080e8008cfb814 50080e8008cfb814 0x0 (Disk device)

Page 2: Solaris Linux Scan Lun

1 27400 0 10000000c884b85c 20000000c884b85c 0x1f (Unknown Type,Host Bus Adapter)Unix@sol#

From the above output, the last line shows the HBA information.In the same you can find the other controller information as well.

5.Zoning can be verified using the below command.

Unix@sol# cfgadm -al -o show_FCP_dev c2 c4

6.If you see any controller port “WWN” showing as “unconfigured” ,then  you can initiate FC session using below mentioned command.

Unix@sol# cfgadm -c configure c2::50080e8008cfb814Unix@sol# cfgadm -c configure c4::50080e8008cfb814

Let’s see how we can re-scan the SAN/FC luns on solaris 10/11 hosts.

To scan new FC luns, Just execute the below commands.

Scanning FC/SAN LUNS

1 cfgadm -al To scan FC luns

2 devfsadm -c disk  To make sure all the device files are created

3 tail /var/adm/messages To see the new LUN’s information4 echo |format To get the new LUN’s information

5 ls -lrt /dev/rdsk |grep s2|tail To get the new LUN’s information

“luxadm probe” also used to scan FC luns but i am happy to use cfgadm.

If you still not able to see the new LUNS/DISK ,then you can try to reset the HBA as last option if you have multipath enabled.  (Do not try in critical servers unless you have confident on multipathing)

1.List the connected HBA.

root@Unixarena-SOL11:~# luxadm -e port |grep CONNECTED/devices/pci@1d,700000/SUNW,qlc@1,1/fp@0,0:devctl CONNECTED/devices/pci@1d,700000/SUNW,qlc@3/fp@0,0:devctl CONNECTED

2.Reset the HBA using forcelip option.

root@Unixarena-SOL11:~# luxadm -e forcelip /devices/pci@1d,700000/SUNW,qlc@1,1/fp@0,0:devctl

Forcelip can be issued to the controller names as well.

Page 3: Solaris Linux Scan Lun

Unix@sol# cfgadm -al -o show_FCP_dev |grep fc-fabricc2 fc-fabric connected configured unknownc4 fc-fabric connected configured unknownUnix@sol#Unix@sol# luxadm -e forcelip /dev/cfg/c2

3. Verify the controller status using “cfgadm -al”.Make sure disks didn;t loose any SAN paths after the HBA reset. If everything seems to be okay ,then isssue the forcelip to the another controller.

If still you are not able to see the new FC/SAN LUNS ,then reboot the server and try. Once you see the new lun, make sure that  multiple FC paths are enabled to that. Minimum two FC paths required for SAN disks.

” luxadm display /dev/rdsk/c1txxxxxxd0s2″  – To verify the FC lun details and multipathing.

 

Scanning Local SCSI disks in Solaris

1.List the currently available harddisks.root@Unixarena-SOL11:~# echo |formatSearching for disks...doneAVAILABLE DISK SELECTIONS: 0. c8t0d0 /pci@0,0/pci15ad,1976@10/sd@0,0 1. c8t1d0 /pci@0,0/pci15ad,1976@10/sd@1,0 2. c8t2d0 /pci@0,0/pci15ad,1976@10/sd@2,0 3. c8t3d0 /pci@0,0/pci15ad,1976@10/sd@3,0 4. c8t4d0 /pci@0,0/pci15ad,1976@10/sd@4,0 5. c8t5d0 /pci@0,0/pci15ad,1976@10/sd@5,0 6. c8t6d0 /pci@0,0/pci15ad,1976@10/sd@6,0Specify disk (enter its number): Specify disk (enter its number):root@Unixarena-SOL11:~#

2.Assume new SCSI harddisks are added to the server.

3.Scan the SCSI disks.root@Unixarena-SOL11:~# devfsadm -c diskroot@Unixarena-SOL11:~# echo |formatSearching for disks...done

Page 4: Solaris Linux Scan Lun

AVAILABLE DISK SELECTIONS: 0. c8t0d0 /pci@0,0/pci15ad,1976@10/sd@0,0 1. c8t1d0 /pci@0,0/pci15ad,1976@10/sd@1,0 2. c8t2d0 /pci@0,0/pci15ad,1976@10/sd@2,0 3. c8t3d0 /pci@0,0/pci15ad,1976@10/sd@3,0 4. c8t4d0 /pci@0,0/pci15ad,1976@10/sd@4,0 5. c8t5d0 /pci@0,0/pci15ad,1976@10/sd@5,0 6. c8t6d0 /pci@0,0/pci15ad,1976@10/sd@6,0 7. c8t8d0 /pci@0,0/pci15ad,1976@10/sd@8,0Specify disk (enter its number): Specify disk (enter its number):root@Unixarena-SOL11:~#

4.Still if you are not able to see the new disks,use cfgadm command and then devfsadm.root@Unixarena-SOL11:~# cfgadm -alAp_Id Type Receptacle Occupant Conditionc8 scsi-bus connected configured unknownc8::dsk/c8t0d0 disk connected configured unknownc8::dsk/c8t1d0 disk connected configured unknownc8::dsk/c8t2d0 disk connected configured unknownc8::dsk/c8t3d0 disk connected configured unknownc8::dsk/c8t4d0 disk connected configured unknownc8::dsk/c8t5d0 disk connected configured unknownc8::dsk/c8t6d0 disk connected configured unknownc8::dsk/c8t8d0 disk connected configured unknowncfgadm: Configuration administration not supported: Error: hotplug service is pr ble the service. See cfgadm_shp(1M) for more details.root@Unixarena-SOL11:~# root@Unixarena-SOL11:~# devfsadm -c diskroot@Unixarena-SOL11:~#

If you are using veritas volume manager, then you can verify the mutipathing using vxdmp commands.

Page 5: Solaris Linux Scan Lun

How to scan new FC LUNS and SCSI disks in Linux ?June 20, 2013 HOW TO ARTICLES- LINUX 33,494 Views

How to scan new FC LUNS and  SCSI disks in Redhat Linux without rebooting the server? Most of the Linux beginners have wondering how to do this and this article will be for them.It may look like very simple as we perform this in daily operation to scan luns but system has many work to do in background when you execute storage scanning commands. Redhat says this type of scan can be distributive,since it can cause delays while I/O operation timeout and remove devices unexpectedly from OS.So perform this scan when really you want to scan the disks and LUNS.

Scanning FC-LUN’s in Redhat Linux

1.First find out how many disks are visible in “fdisk -l” .# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l

2.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.# ls /sys/class/fc_hosthost0 host1

In this case,you need to scan host0 & host1 HBA.

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.# echo "1" > /sys/class/fc_host/host0/issue_lip# echo "1" > /sys/class/fc_host/host1/issue_lip

Note: You need to monitor the “issue_lip” in /var/log/messages to determine when the scan will complete.This operation is an asynchronous operation.

Page 6: Solaris Linux Scan Lun

4.Verify if the new LUN is visible or not by counting the available disks.# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l

If any new LUNS added ,then you can see more count is more then before scanning the LUNS.

Scanning SCSI DISKS in Redhat Linux

1.Finding the existing disk from fdisk.[root@mylinz1 ~]# fdisk -l |egrep '^Disk' |egrep -v 'dm-'Disk /dev/sda: 21.5 GB, 21474836480 bytes

2.Find out how many SCSI controller configured.[root@mylinz1 ~]# ls /sys/class/scsi_host/hosthost0 host1 host2

In this case,you need to scan host0,host1 & host2.

3.Scan the SCSI disks using below command.[root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan[root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host1/scan[root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan

4.Verify if the new disks are visible or not.[root@mylinz1 ~]# fdisk -l |egrep '^Disk' |egrep -v 'dm-'Disk /dev/sda: 21.5 GB, 21474836480 bytesDisk /dev/sdb: 1073 MB, 1073741824 bytesDisk /dev/sdc: 1073 MB, 1073741824 bytes

From Redhat Linux 5.4 onwards, redhat introduced “/usr/bin/rescan-scsi-bus.sh” script to scan all the SCSI bus and update the SCSI layer to reflect new devices.

But most of the time,script will not be able to scan new disks and you need go with echo command.