Sei sulla pagina 1di 8

1) scan new lun in linux use the below simple script for RHEL5 to detect new LUNS for

HOST in `ls /sys/class/scsi_host/` do echo - - > /sys/class/scsi_host/$HOST/scan done or #cat /proc/scsi/scsi #fdisk -l 2>/dev/null egrep -i Host: egrep ^Disk wc -l egrep -v dm- wc -l

use power path or multipath Step 2 . Check current multipath setup using multipath or powermt command # multipath -l mpath2 (36006016015501c0018c07c18e0d8dc11) [size=68 GB][features="1 queue_if_no_path"][hwhandler="1 emc"] \_ round-robin 0 [active] \_ 0:0:0:2 sdc 8:32 [active] \_ round-robin 0 [enabled] \_ 1:0:0:2 sdi 8:128 [active] OR # powermt display dev=all more Pseudo name=emcpowerb CLARiiON ID=APM00080503154 [cl10083] Logical device ID=6006016023041F003AB6ED708885DD11 [LUN 3] state=alive; policy=CLAROpt; priority=0; queued-IOs=0 Owner: default=SP A, current=SP A Array failover mode: 1 ============================================================================== - Host - Stor - I/O Path - Stats ### HW Path I/O Paths Interf. Mode State Q-IOs Errors ============================================================================== 3 qla2xxx sde SP A2 active alive 0 1 3 qla2xxx sdh SP B3 active alive 0 0 6 qla2xxx sdk SP A3 active alive 0 1 6 qla2xxx sdn SP B2 active alive 0 0 Step 3 : Scan for LUNS Note this is for 2.6 kernel # ls /sys/class/fc_host host0 host1 #echo #echo #echo #echo 1 > /sys/class/fc_host/host0/issue_lip - - > /sys/class/scsi_host/host0/scan 1 > /sys/class/fc_host/host1/issue_lip - - > /sys/class/scsi_host/host1/scan

Step 4 : Adding to multpath and powermt (EMC)

multipath will automatically add new native devices to multipathed For powermt we need to configure like below #powermt config ====================================================== If we know the channel , target ID , Lun address we can scan using that Have 4 HBA emulex cards 0 1 2 3 server1:/proc/scsi/lpfc# ls 0 1 2 3 Through card 0 and 2 server1:/proc/scsi/lpfc# cat 0 lpfc0t00 DID d200ef WWPN 50:06:01:68:39:a0:43:65 lpfc0t01 DID d201ef WWPN 50:06:01:61:39:a0:43:65 server1:#/proc/scsi/lpfc# cat 1 server1:/proc/scsi/lpfc# cat 2 lpfc2t01 DID ed0cef WWPN 50:06:01:69:39:a0:43:65 lpfc2t00 DID ed0def WWPN 50:06:01:60:39:a0:43:65 server1:/proc/scsi/lpfc# cat 3 server1:/proc/scsi/lpfc# WWNN 50:06:01:60:b9:a0:43:65 WWNN 50:06:01:60:b9:a0:43:65 WWNN 50:06:01:60:b9:a0:43:65 WWNN 50:06:01:60:b9:a0:43:65

It have same WWNN(World Wide Node Name) for all the 4 WWPN (World Wide Port Name ) server1:/proc/scsi/lpfc# cat /sys/class/fc_transport/*/node_name 0x50060160b9a04365 0x50060160b9a04365 0x50060160b9a04365 0x50060160b9a04365 server1:/proc/scsi/lpfc# grep 50060160b9a04365 /sys/class/fc_transport/*/node_na me /sys/class/fc_transport/target0:0:0/node_name:0x50060160b9a04365 /sys/class/fc_transport/target0:0:1/node_name:0x50060160b9a04365 /sys/class/fc_transport/target2:0:0/node_name:0x50060160b9a04365 /sys/class/fc_transport/target2:0:1/node_name:0x50060160b9a04365 server1:/proc/scsi/lpfc# This Line Line Line Line indicates there 1 : Thru host 0 2 : Thru host 0 3 : Thru host 2 4 : thru host 2 are four Fibre Channel routes to this target. channel 0 target 0 channel 0 target 1 channel 0 target 0 channel 0 targer 1

So now can scan for LUNS as follows and Addresss 8 is given by storage Team echo echo echo echo 0 0 0 0 0 1 0 1 8 8 8 8 > > > > /sys/class/scsi_host/host0/scan /sys/class/scsi_host/host0/scan /sys/class/scsi_host/host2/scan /sys/class/scsi_host/host2/scan Rev: 0326 ANSI SCSI revision: 04

Host: scsi0 Channel: 00 Id: 00 Lun: 08 Vendor: DGC Model: RAID 5 Type: Direct-Access

Host: scsi0 Channel: 00 Vendor: DGC Model: Type: Direct-Access Host: scsi2 Channel: 00 Vendor: DGC Model: Type: Direct-Access Host: scsi2 Channel: 00 Vendor: DGC Model: Type: Direct-Access

Id: 01 Lun: 08 RAID 5 Id: 00 Lun: 08 RAID 5 Id: 01 Lun: 08 RAID 5

Rev: 0326 ANSI SCSI revision: 04 Rev: 0326 ANSI SCSI revision: 04 Rev: 0326 ANSI SCSI revision: 04

2) Scan new lun in solaris cfgadm -al or VIEW HBAs: Once the OS is updated and a reboot -- -r has been done check if SUN/Solaris is seeing the HBA s. Run the luxadm command: luxadm -e port Example: luxadm -e port /devices/pci@1d,700000/SUNW,qlc@2,1/fp@0,0:devctl CONNECTED /devices/pci@1d,700000/SUNW,qlc@2/fp@0,0:devctl CONNECTED Above is showing two HBA s 2 and 2,1 OK, good to go. Before assigning LUNs Collect Current HBA information fcinfo hba-port -l grep HBA HBA Port WWN: 210000e08b1c829a HBA Port WWN: 210000e08b1c2395 Collect LUNs Solaris already knows about fcinfo remote-port -sl -p 210000e08b0c5518 > 210000e08b0c5518.out fcinfo remote-port -sl -p 210100e08b2c5518 > 210100e08b2c5518.out cfgadm -al -o show_SCSI_LUN > currentLUNs.out (Note added LUNS when available will be seen here as "unconfigured" Scan deeply LUNs attached to each HBA This shows HBAs luxadm -e port /devices/pci@1c,600000/pci@1/SUNW,qlc@4/fp@0,0:devctl CONNECTED /devices/pci@1c,600000/pci@1/SUNW,qlc@5/fp@0,0:devctl CONNECTED Run following command on each Controller luxadm -e dump_map /devices/pci@1c,600000/pci@1/SUNW,qlc@4/fp@0,0:devctl luxadm -e dump_map /devices/pci@1c,600000/pci@1/SUNW,qlc@5/fp@0,0:devctl Assigning LUNs Now is the time to assign LUNs Assign LUNs. Configure New LUNs on Solaris LUNS should Just Show Up on Solaris 10. Cgfadm al Example output c1::2200000c50401277 disk connected unconfigured unknown New LUNs show as unconfigured until cfgadm is used. When LUNs appear configure them cfgadm -c c1::2200000c50401277 Also command can be done globally for each controller: cfgadm -c configure c1

cfgadm -c configure c2 It does not effect previously configured LUNs. If they do not, a few things to try if LUNs dont show up Check for legacy txt in sd.conf. Solaris 10 does not need this, and it just slow s up booting. Text in this file my theory is can mess finding new LUNs in Solaris 10. Update sd.conf vi /kernel/drv/sd.conf Add new LUN IDs created on Hitachi After Solaris 9, this should not be needed. 10 does not need this. Instruct Solaris to re-read sd.conf update_drv -f sd 9 and 10 can do this. 8 will failed. Scan scsi bus so Solaris can see the new luns devfsadm Find new LUNs cfgadm -al -o show_SCSI_LUN (Note added LUNS when available will be seen here as "unconfigured" If LUNs do not appear, server reboot will be needed. reboot -r Create Label for LUN This is all only valid if you Are Not running Veritas Now run a format command # Note: the disk only needs to be labeled on once. The following servers only ne ed mount it Run format command format A disk looking like the following should show up. c6t600A0B800021E8B90000536B456B26B3d0 /scsi_vhci/ssd@g600a0b800021e8b90000536b456b26b3 Select the disk number. It will need a volume name if it does not already have o ne. Since this is the Export directory for Solaris "export" is a good volume name. S olaris does not like disks without a volume name (label). Some commands in format to look at are: format> current Current Disk = c6t600A0B800021E8B90000536B456B26B3d0 /scsi_vhci/ssd@g600a0b800021e8b90000536b456b26b3 (SUN and Solaris see this as a known disktype) format> type select type 19 format> volname Enter 8-character volume name (remember quotes)[""]:"export" Ready to label disk, continue? y format> save Saving new disk and partition definitions Enter file name["./format.dat"]: format> quit This only needs to be done from one machine Get LUN Info for Mounting run the luxadm command to get LUN info luxadm probe Example: root@j2-apps01 # luxadm probe No Network Array enclosures found in /dev/es Found Fibre Channel device(s): Node WWN:200400a0b821eab1 Device Type:Disk device Logical Path:/dev/rdsk/c6t600A0B800021E8B90000536B456B26B3d0s2 Each server will have a different Path, to the same LUN

Create New Filesystem on LUN/Volume Now create a new filesystem (format) Run newfs command on LUN found in luxadm probe command: newfs /dev/rdsk/c6t600A0B800021E8B90000536B456B26B3d0s2 Example: root@j2-apps01 # newfs /dev/rdsk/c6t600A0B800021E8B90000536B456B26B3d0s2 newfs: construct a new filesystem /dev/rdsk/c6t600A0B800021E8B90000536B456B26B3d 0s2: (y/n)? y /dev/rdsk/c6t600A0B800021E8B90000536B456B26B3d0s2: 1073676288 sectors in 32766 c ylinders of 512 tracks, 64 sectors 524256.0MB in 10922 cyl groups (3 c/g, 48.00MB/g, 5824 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 98400, 196768, 295136, 393504, 491872, 590240, 688608, 786976, 885344, Initializing cylinder groups: ............................................................................... ............................................................................... ............................................................ super-block backups for last 10 cylinder groups at: 1072703520, 1072801888, 1072900256, 1072998624, 1073096992, 1073195360, 1073293728, 1073392096, 1073490464, 1073588832, Now the disk is mountable and solaris can understand it This only needs to be done from one machine A LUN is a physical disk to Solaris at this point Edit /etc/vfstab to mount the new LUN Now edit /etc/vfstab to mount the new LUN The new LUN/disk in this example (from luxadm) is c6t600A0B800021E8B90000536B456 B26B3d0s2 The device path is: /dev/rdsk/c6t600A0B800021E8B90000536B456B26B3d0s2 Add the folling line to /etc/vfstab: /dev/dsk/c6t600A0B800021E8B90000536B456B26B3d0s2 /dev/rdsk/c6t600A0B800021E8B900 00536B456B26B3d0s2 /export/home ufs 1 yes logging Edit this to match LUN ID of your system This will mount at boot Run mount command to test if LUN mounts: mount /export/home There is no output if it works Run the mount command again to see new LUN and mount point mount Example: root# mount grep export /export/home on /dev/dsk/c6t600A0B800021E8B90000536B456B26B3d0s2 read/write/setu id/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1d80022 on Tue Nov 28 15:33:06 2006 Veritas Volume Setup If you use Veritas follow these steps # instruct veritas to scan for new luns vxdctl enable # check for new luns on veritas level vxdisk -o alldgs list c7t2d11s2 auto:none - - online invalid c7t1d12s2 auto:none - - online invalid # initialize new disks /etc/vx/bin/vxdisksetup -i c7t2d11 # initialize new disk group with disk c3t3d30 vxdg init oraclelogs c7t2d11=c7t2d11 # if group already exists vxdg -g oraclelogs adddisk c7t1d12=c7t1d12 # check the status of the new disks vxdisk -o alldgs list

# Check freespace of the diskgroup # vxdg free # Size can be gotten from vxdg free # make a volume of max size (41853696) vxassist -g oraclelogs make oralogvol01 41853696 # If not all space is used, or task is to grow volume ## After making 19g check free space of new Volume # vxassist -g oraclelogs maxgrow oralogvol01 Volume oralogvol01 can be extended by 2007040 to: 41852928 (20436Mb) # growto space available vxassist -g oraclelog s growto oralogvol01 41852928 # check the new volume vxprint -htr # create a filesystem on the new volume mkfs -F vxfs /dev/vx/rdsk/oraclelogs/oralogvol01 mkfs -F vxfs /dev/vx/rdsk/oraclelogs/oralogvol02 # make a mount point mkdir /oralog01 # mount the new filesystem at the new mount point mount -F vxfs /dev/vx/dsk/oraclelogs/oralogvol01 /oralog01 # verify the new mounted filesystem cd /oralog01 ls # verify the size on solaris level df -h # make permenent vi /etc/vfstab /dev/vx/dsk/oraclelogs/oralogvol01 /dev/vx/rdsk/oraclelogs/oralogvol01 /oralog01 vxfs 2 yes suid # test vfstab entry # umount /oralog01 # mount /oralog01 3) Scan new lun in Aix 1) Add the physical disk. 2) Rescan your hardware so that the OS is aware of your new disk. AIX# cfgmgr 3) Check to see your disk. For the purpose of this example, lets say the new disk is hdisk2. AIX# lsdev -Cc disk AIX# lspv 4) Associate your new disk to a volume group. In this case, lets create a new gro up called ryanvg and put hdisk2 in there. AIX# mkvg -y ryanvg hdisk2 5) Now you can look at the size of hdisk2. (This command wont work if its not asso ciated with a volume group). AIX# lspv hdisk2 6) Create a log logical volume for jfs2. This needs to be part of ryanvg. Note: in the example below, the type is jfs2log and were giving it 1 physical partition (PP).

AIX# mklv -t jfs2log ryanvg 1 7) Look for your new logical volume (lv). Chances are that AIX named it loglv00. AIX# lsvg AIX# lsvg -l ryanvg 8) Create your production logical volume. Lets make it, hmm how about 30GB? At the risk of sounding narcissistic, Ill name it ryanlv. AIX# lsvg ryanvg AIX# mklv -t jfs2 -y ryanlv ryanvg 30G 9) Lay down your file system on ryanlv. AIX# mkfs -o log=/dev/loglv00 -V jfs2 /dev/ryanlv 10) Mount your filesystem. AIX# mkdir /mountpoint AIX# mount -o log=/dev/loglv00 /dev/ryanlv /mountpoint 11) Consider adding to /etc/filesystem, if everything comes up fine

4) Scan new lun in HP-UX --Physical Disk , tape ,lan # Check disk mapping for HP-UX 11.31 ioscan -m dsf Persistent DSF Legacy DSF(s) ======================================== /dev/rchgr/autoch1 /dev/rac/c6t0d1 /dev/rdisk/disk3 /dev/rdsk/c0t0d0 /dev/rdisk/disk3_p1 /dev/rdsk/c0t0d0s1 /dev/rdisk/disk3_p2 /dev/rdsk/c0t0d0s2 /dev/rdisk/disk3_p3 /dev/rdsk/c0t0d0s3 # Check disk mapping for HP-UX 11.31 ioscan -m lun Class I Lun H/W Path Driver S/W State H/W Type Health Description ======================================================================= ctl 4 64000/0xfa00/0x0 esctl CLAIMED DEVICE online HP HSV300 0/3/0/0/0/0.0x50014380025d511c.0x0 tape 1 64000/0xfa00/0x1 estape CLAIMED DEVICE online HP Ultrium 4-SCSI 0/3/0/0/0/0.0x500110a00094e38a.0x0 /dev/rtape/tape1_BEST /dev/rtape/tape1_BESTn /dev/rtape/tape1_BESTb /dev/rtape/tape1_BESTnb autoch 1 64000/0xfa00/0x2 eschgr CLAIMED DEVICE online HP MSL G3 Series 0/3/0/0/0/0.0x500110a00094e38a.0x1000000000000 /dev/rchgr/autoch1 disk 3 64000/0xfa00/0x3 esdisk CLAIMED DEVICE online HP IR Volume 0/2/1/0.0xa9fe9dda9bf7d63.0x0 /dev/disk/disk3 /dev/rdisk/disk3 /dev/disk/disk3_p1 /dev/rdisk/disk3_p1

--Scan hard disk Use the ioscan command to check the S/W state of the disk. Only disks in state C LAIMED are currently accessible by the system. Disks in other states such as NO_ HW or disks that are completely missing from the ioscan output are suspicious. I f the disk is marked as CLAIMED, then its controller is responding. For example: # ioscan fnCdisk Class I H/W Path Driver S/W State H/W Type Description ====== disk 0 8/4.5.0 sdisk CLAIMED DEVICE SEAGATE ST34572WC disk 1 8/4.8.0 sdisk UNCLAIMED UNKNOWN SEAGATE ST34572WC disk 2 8/16/5.2.0 sdisk CLAIMED DEVICE TOSHIBA CD-ROM XM-5401TA In this example the disk at hardware path 8/4.8.0 is not accessible. If the disk has multiple hardware paths, be sure to check all the paths. --Check Disk bad sector more /var/adm/syslog/syslog.log And most important: make sure the online diagnostics are loaded and running. The y will monitor disk error messages and can be configured to notify you when ther e are error messages. The file: /var/adm/syslog/syslog.log will also have disk e rrors logged. --Check scan tape ioscan - fnC tape Class I H/W Path Driver S/W State H/W Type Description ================================================================== tape 2 0/3/0/0/0/0.1.15.255.0.0.0 stape CLAIMED DEVICE HP Ultrium 4-SCSI /dev/rmt/2m /dev/rmt/c6t0d0BEST /dev/rmt/2mb /dev/rmt/c6t0d0BESTb /dev/rmt/2mn /dev/rmt/c6t0d0BESTn /dev/rmt/2mnb /dev/rmt/c6t0d0BESTnb

Potrebbero piacerti anche