Wednesday, 1 February 2012

CENTOS: Connect EVA 6300 SAN disks

On the storage:
1. Create necessary vdisks in storage works command view.
2. Present vdisks to host.


On the server:


NOTE: Installation of the server performed AFTER VDISKS presented to host by StorageWorks Command View EVA.

3.Check /var/log/dmesg
#dmesg|more
See drives sdb,sdc,sdd,sde,sdg,sdh,sdi (in my case there are 2 LUNs connected by 4 paths)

4.Start multipathd daemon (only in case of multiple fiber optic routes to LUNs)
#service multipathd start

5.Set multipathd to autostart
#chkconfig multipathd on

6.Connect disk drives
#run multipathd -ll

mpathc (3600143801259a0410000400000330000) dm-4 HP,HSV340
size=50G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 1:0:0:2 sdc 8:32 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 1:0:1:2 sde 8:64 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 1:0:2:2 sdg 8:96 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 1:0:3:2 sdi 8:128 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 2:0:0:2 sdk 8:160 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 2:0:1:2 sdm 8:192 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 2:0:2:2 sdo 8:224 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
`- 2:0:3:2 sdq 65:0 active ready running
mpathb (3600143801259a04100004000002d0000) dm-2 HP,HSV340
size=100G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 1:0:0:1 sdb 8:16 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 1:0:1:1 sdd 8:48 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 1:0:2:1 sdf 8:80 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 1:0:3:1 sdh 8:112 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 2:0:0:1 sdj 8:144 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 2:0:1:1 sdl 8:176 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 2:0:2:1 sdn 8:208 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
`- 2:0:3:1 sdp 8:240 active ready running

Write down long number WWN ID for future reference and check the size parameter.

7.Check multipath configuration file
#cat /etc/multipath.conf

# multipath.conf written by anaconda

defaults {
user_friendly_names yes
}
blacklist {
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
devnode "^dcssblk[0-9]*"
device {
vendor "DGC"
product "LUNZ"
}
device {
vendor "IBM"
product "S/390.*"
}
# don't count normal SATA devices as multipaths
device {
vendor "ATA"
}
# don't count 3ware devices as multipaths
device {
vendor "3ware"
}
device {
vendor "AMCC"
}
# nor highpoint devices
device {
vendor "HPT"
}
wwid "3600508b1001c78ea8eb1c8b8e3063748"
device {
vendor HP
product Virtual_DVD-ROM
}
wwid "*"
}
blacklist_exceptions {
wwid "3600143801259a04100004000002d0000"
wwid "3600143801259a0410000400000330000"
}
multipaths {
multipath {
uid 0
gid 0
wwid "3600143801259a04100004000002d0000"
mode 0600
}
multipath {
uid 0
gid 0
wwid "3600143801259a0410000400000330000"
mode 0600
}
}


# ls -la /dev/mapper/
total 0
drwxr-xr-x. 2 root root 260 Jul 16 03:36 .
drwxr-xr-x. 21 root root 5200 Jul 16 03:36 ..
crw-rw----. 1 root root 10, 58 Jul 16 03:36 control
lrwxrwxrwx. 1 root root 7 Jul 16 03:36 mpathb -> ../dm-2
lrwxrwxrwx. 1 root root 7 Jul 16 03:36 mpathbp1 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jul 16 03:36 mpathc -> ../dm-4
lrwxrwxrwx. 1 root root 7 Jul 16 03:36 mpathcp1 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Jul 16 03:36 mpathcp2 -> ../dm-6
lrwxrwxrwx. 1 root root 7 Jul 16 03:36 vg_lynx-lv_home -> ../dm-9
lrwxrwxrwx. 1 root root 7 Jul 16 03:36 vg_lynx-lv_root -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jul 16 03:36 vg_lynx-lv_swap -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jul 16 03:36 VolGroup-lv_root -> ../dm-8
lrwxrwxrwx. 1 root root 7 Jul 16 03:36 VolGroup-lv_swap -> ../dm-7

In my case:
mpathb - first SAN disk
mpathbp1 - first SAN disk partition 1
mpathc - second SAN disk
mpathcp1 - second SAN disk partition 1
mpathcp2 - second SAN disk partition 2

8. Create mountpoints
#mkdir -p /mnt/disk1-p1 /mnt/disk2-p1 /mnt/disk2-p2

Mount disks
#mount -t ext4 /dev/mapper/mpathbp1 /mnt/disk1-p1
#mount -t ext4 /dev/mapper/mpathcp1 /mnt/disk2-p1
#mount -t ext4 /dev/mapper/mpathcp2 /mnt/disk2-p2
Oops! On last command I had an error:
mount: /dev/mapper/mpathcp2 already mounted or /mnt/disk2-p2 busy

9. Check what is wrong with the partition.

# fdisk /dev/mapper/mpathc

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): p

Disk /dev/mapper/mpathc: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001e1a9

Device Boot Start End Blocks Id System
/dev/mapper/mpathcp1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/mapper/mpathcp2 64 6528 51915776 8e Linux LVM

I have partition already used as part of LVM.

10. Make disks connected after restart
#vi /etc/fstab
Add to the end of file lines:

/dev/mapper/mpathbp1 /mnt/disk1-p1 ext4 defaults 1 2
/dev/mapper/mpathcp1 /mnt/disk2-p1 ext4 defaults 1 2

Warning: always add empty line to the end of fstab!

Note: last two digits means:
first (1) - include in dump backup
second (2) - check by fsck after root partition (with parameter set to 1)

11 Test that mount through fstab working as expected (Tests always VERY IMPORTANT step!)
Umnount partitions:

#mount
/dev/mapper/vg_lynx-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_lynx-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/mapper/mpathbp1 on /mnt/disk1-p1 type ext4 (rw)
/dev/mapper/mpathcp1 on /mnt/disk2-p1 type ext4 (rw)

#umount /mnt/disk1-p1
#umount /mnt/disk2-p1

Check if mounted:
#mount

/dev/mapper/vg_lynx-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_lynx-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

Mount all file systems in fstab file
#mount -a

/dev/mapper/vg_lynx-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_lynx-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/mapper/mpathbp1 on /mnt/disk1-p1 type ext4 (rw)
/dev/mapper/mpathcp1 on /mnt/disk2-p1 type ext4 (rw)

OK! I've got it working!




No comments: