Archive

Archive for October, 2010

Linux RHEL 5 configuring multipathing with DM-Multipath

October 13, 2010 5 comments

In my example, I am connected to an IBM DS5020 from 2 IBM blade servers.  The blade chasis is equipped with 2 Brocade 4GB SAN switch modules.  Each blade server has two access paths, provided the server is installed with 2 Qlogic HBA modules.

Currently, I have configured 2 Logical Drives to be presented to each blade server.  Both have access to ASM (LUN0), and independently blade A has access to ORA1, blade B access to ORA2.  By default, multipathd isn’t started. 

The procedure below will walk through the configuration of multipathing.

Here’s the output of fdisk to show what the disks are seen by the system — notice the 4 paths to 50/100GB devices:
# fdisk -l

Disk /dev/sda: 145.9 GB, 145999527936 bytes
255 heads, 63 sectors/track, 17750 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         122      979933+  83  Linux
/dev/sda2             123        1166     8385930   83  Linux
/dev/sda3            1167        1688     4192965   82  Linux swap / Solaris
/dev/sda4            1689       17750   129018015    5  Extended
/dev/sda5            1689        6910    41945683+  83  Linux
/dev/sda6            6911       10043    25165791   83  Linux
/dev/sda7           10044       11610    12586896   83  Linux
/dev/sda8           11611       13177    12586896   83  Linux
/dev/sda9           13178       14221     8385898+  83  Linux
/dev/sda10          14222       15265     8385898+  83  Linux
/dev/sda11          15266       16309     8385898+  83  Linux
/dev/sda12          16310       17353     8385898+  83  Linux

Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn’t contain a valid partition table

Disk /dev/sdc: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn’t contain a valid partition table

Disk /dev/sdd: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdd doesn’t contain a valid partition table

Disk /dev/sde: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sde doesn’t contain a valid partition table

Disk /dev/sdf: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdf doesn’t contain a valid partition table

Disk /dev/sdg: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdg doesn’t contain a valid partition table

Disk /dev/sdh: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdh doesn’t contain a valid partition table

Disk /dev/sdi: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdi doesn’t contain a valid partition table

Setting up DM-Multipath
Edit /etc/multipath.conf and comment out the ‘blacklist’ section
#blacklist {
#        devnode “*”
#}
Save the file and execute the following commands:
modprobe dm-multipath
service multipathd start
multipath -v3  # will print out all multipathed paths
chkconfig multipathd on

Since the value of “user_friendly_name” is set to “yes” in multipath.conf, the multipath devices will be created as /dev/mapper/mpathn.
# ls -l /dev/mapper/
control  mpath1   mpath2

From above, we see that /dev/sda is the internal disk and should be ignored from the configuration.   Edit /etc/multipath.conf again and add the following stanza:
blacklist {
        wwid 3600508e000000000b9cfe9bbf3879804
}

Notice, the WWID is used and not /dev/sda since the devnode type can change during bootup and this would be dangerous.  To get the WWID associated with the device names, run:
multipath -l
Here’s a sample output:
VOTE1 (360060160e49e1600d488b94e3e39e011) dm-12 DGC,RAID 10
size=1.0G features=’1 queue_if_no_path’ hwhandler=’1 emc’ wp=rw
|-+- policy=’round-robin 0′ prio=-1 status=active
| `- 3:0:1:6 sdz  65:144 active undef running
|-+- policy=’round-robin 0′ prio=-1 status=enabled
| `- 5:0:1:6 sdal 66:80  active undef running
|-+- policy=’round-robin 0′ prio=-1 status=enabled
| `- 5:0:0:6 sdo  8:224  active undef running
`-+- policy=’round-robin 0′ prio=-1 status=enabled
  `- 3:0:0:6 sdn  8:208  active undef running

Now run:
service multipathd reload
multipath -F
multipath -v3  # Look for “3600508e000000000b9cfe9bbf3879804: blacklisted” in output

Note, if your device does not show up, it may be because the default supported devices does not include your storage array.  Additional ones can be added by following viewing /usr/share/doc/device-mapper-multipathd-0.4.7/multipath.conf.annotated.

Some common DM-Multipath situations

# You need to resize an online multipath device
First, resize your physical device.
Then find the paths to your LUN:
# multipath -l
mpath2 (360080e500018299c000003444cb493b5) dm-1 IBM,1814      FAStT
[size=50G][features=1 queue_if_no_path][hwhandler=1 rdac][rw]
\_ round-robin 0 [prio=0][active]
 \_ 1:0:0:1 sdd 8:48  [active][undef]
 \_ 2:0:0:1 sde 8:64  [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 1:0:1:1 sdh 8:112 [active][undef]
 \_ 2:0:1:1 sdi 8:128 [active][undef]
mpath1 (360080e50001820ec000003244caca742) dm-0 IBM,1814      FAStT
[size=100G][features=1 queue_if_no_path][hwhandler=1 rdac][rw]
\_ round-robin 0 [prio=0][active]
 \_ 1:0:0:0 sdb 8:16  [active][undef]
 \_ 2:0:0:0 sdc 8:32  [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 1:0:1:0 sdf 8:80  [active][undef]bdf
 \_ 2:0:1:0 sdg 8:96  [active][undef]

Next, resize you paths by causing your SCSI driver to rescan:
# echo 1 > /sys/block/device_name/device/rescan

Now, resize your multipath device:
# multipathd -k’resize map mpath0′

Finally, resize the filesystem (assuming no LVM or DOS partitions are used):
# resize2fs /dev/mapper/mpath0

Advertisements
Categories: Linux, Redhat

How to change BST timezone to GMT in HP-UX

October 8, 2010 Leave a comment

The file /etc/TIMEZONE is the default “profile” for timezone on your system when you login.

To change this to GMT, edit the file and change TZ:
From:
TZ=GMT0BST
To:
TZ=GMT0

You can also double check your kernel parameter for DST is set to 0.

Categories: HP-UX

How to transfer a kernel template HP-UX

October 7, 2010 Leave a comment

# On source host

cd /stand/build
/usr/lbin/sysadm/system_prep -s system
vi system # modify the params, if necessary
# copy “system” to target hosts.

# On target host:
cd /stand/build
/usr/sbin/mk_kernel -s system

Categories: HP-UX

Mirroring HP-UX root disk on Itanium

October 6, 2010 2 comments

The following procedure shows how to mirror the root disk. Let c3t2d0 be the existing primary disk and c2t1d0 the new mirror boot disk:

  1. Setup the disk partitions
    1. Create a partition description file:
    2. # vi /tmp/partitionfile
      2
      EFI 100MB
      HPUX 100%

    3. Use the idisk(1M) command to partition the disk according to this file:
    4. # idisk -wf /tmp/partitionfile /dev/rdsk/c2t1d0
      idisk version: 1.2
      ********************** WARNING ***********************
      If you continue you may destroy all data on this disk.
      Do you wish to continue(yes/no)? yes
      ...

  2. Create the new device files for the new partitions (c2t1d0s1 and c2t1d0s2)
  3. # insf -e -C disk

  4. Use mkboot(1M) to format the EFI partition (s1), populate it with the EFI files under /usr/lib/efi/, format the LIF volume (part of s2), and populate it with the LIF files (ISL, AUTO, HPUX, LABEL) under /usr/lib/uxbootlf:
  5.      # mkboot -e -l /dev/rdsk/c2t1d0
         # efi_ls -d /dev/rdsk/c2t1d0s1                 (to check EFI)
         FileName                      Last Modified         Size
         EFI/                            5/19/2003              0
         STARTUP.NSH                     5/19/2003            336
    
         total space 103215616 bytes, free space 100076032 bytes
    
         # lifls -l /dev/rdsk/c2t1d0s2                (to check LIF)
  6. Write the contents of the AUTO file to the EFI partition:
  7. # mkboot -a "boot vmunix" /dev/dsk/c2t1d0
    # efi_cp -d /dev/rdsk/c2t1d0s1 -u /EFI/HPUX/AUTO /tmp/x; cat /tmp/x

    (to check it)
    NOTE: Specify -a “boot vmunix -lq” if you want the system to boot up without interruption in case of a disk failure.

  8. Initialize the LVM partition (s2) and add it to vg00:
    1. Mirror the LVs to the s2 partition:
    2. # for i in lvol1 lvol ... lvol8
      > do lvextend -m 1 /dev/vg00/$i /dev/dsk/c2t1d0s2
      > done

    3. Write the contents of the LABEL file, i.e. set root, boot, swap and dump device:
          # lvlnboot -r /dev/vg00/lvol3
           # lvlnboot -b /dev/vg00/lvol1
           # lvlnboot -s /dev/vg00/lvol2
           # lvlnboot -d /dev/vg00/lvol2
      
           # lvlnboot -v                               (to check it)
           Boot Definitions for Volume Group /dev/vg00:
           Physical Volumes belonging in Root Volume Group:
                   /dev/dsk/c3t2d0s2 (0/1/1/1.2.0) -- Boot Disk
                   /dev/dsk/c2t1d0s2 (0/1/1/0.1.0) -- Boot Disk
           Boot: lvol1     on:     /dev/dsk/c3t2d0s2
                                   /dev/dsk/c2t1d0s2
           Root: lvol3     on:     /dev/dsk/c3t2d0s2
                                   /dev/dsk/c2t1d0s2
           Swap: lvol2     on:     /dev/dsk/c3t2d0s2
                                   /dev/dsk/c2t1d0s2
           Dump: lvol2     on:     /dev/dsk/c3t2d0s2, 0
  9. # pvcreate [-f] -B /dev/rdsk/c2t1d0s2 (take care to use s2)
    # vgextend vg00 /dev/dsk/c2t1d0s2

  10. Specify the mirrored disk as an alternate bootpath
  11. # setboot -a <HW path of mirror>
    # setboot (to check it)

  12. Create an EFI boot option. This boot option will be stored in NVRAM:
  13.      Boot to EFI and enter the Boot option maintenance menu:
    
         --------------------------------------------------------------
         | EFI Boot Maintenance Manager ver 1.10 [14.61]
         | 
         | Main Menu. Select an Operation
         | 
         | 
         |         Boot from a File
         |    >>>  Add a Boot Option
         |         Delete Boot Option(s)
         |         Change Boot Order
         |  
         |         Manage BootNext setting
         |         Set Auto Boot TimeOut
         | 
         |         Select Active Console Output Devices
         |         Select Active Console Input Devices
         |         Select Active Standard Error Devices
         | 
         |         Cold Reset
         |         Exit
         --------------------------------------------------------------
    
         Select the mirror disk. (Pun1,Lun0) represents SCSI target 1, Lun 0
         (c2t1d0) in our case. (Pun2,Lun0) is the original boot disk (c3t2d0):
    
         ---------------------------------------------------------------------
         | EFI Boot Maintenance Manager ver 1.10 [14.61]
         |
         | Add a Boot Option.  Select a Volume
         | 
         | >>> IA64_EFI [Acpi(HWP0002,100)/Pci(1|0)/
         |                             Scsi(Pun1,Lun0)/HD(Part1,SigB45A0000)
         |     IA64_EFI [Acpi(HWP0002,100)/Pci(1|1)/
         |                             Scsi(Pun2,Lun0)/HD(Part1,Sig958B0000)
         |     EFI DISK [Acpi(HWP0002,600)/Pci(1|0)/Pci(0|0)/Pci(0|0)/
         |               Pci(0|0)/Scsi(Pun0,Lun0)/
         |               HD(Part1,Sig   119E1A60-0B4C-01C3-507B-9E5F8078F531)
         |     Removable Media Boot [Acpi(HWP0002,0)/Pci(2|0)/
         |               Ata(Primary,Master)]
         |     Load File [EFI Shell [Built-in]]
         |     Load File [Acpi(HWP0002,0)/Pci(3|0)/Mac(00306E3809C6)]
         |     Load File [Acpi(HWP0002,100)/Pci(2|0)/Mac(00306E3889E3)]
         |     Exit
         ---------------------------------------------------------------------
    
         Now navigate to the HP-UX bootloader, HPUX.EFI, on the disk:
    
         ---------------------------------------------------------------------
         | EFI Boot Maintenance Manager ver 1.10 [14.61]
         | 
         | Select file or change to new directory:
         | 
         |   >>>  05/28/03  09:38a <DIR>         512 EFI
         |        [Treat like Removable Media Boot]
         |     Exit
    
         | Select file or change to new directory:
         | 
         |        05/28/03  09:38a <DIR>         512 .
         |        05/28/03  09:38a <DIR>           0 ..
         |   >>>  05/28/03  09:38a <DIR>         512 HPUX
         |        05/28/03  09:38a <DIR>         512 Intel_Firmware
         |        05/28/03  09:38a <DIR>         512 DIAG
         |        05/28/03  09:38a <DIR>         512 HP
         |        05/28/03  09:38a <DIR>         512 TOOLS
         |     Exit
    
         | Select file or change to new directory:
         | 
         |        05/28/03  09:38a <DIR>         512 .
         |        05/28/03  09:38a <DIR>         512 ..
          |   >>>  05/28/03  11:52a           419,545 HPUX.EFI
         |        05/28/03  11:52a            24,576 NBP.EFI
         |     Exit
         | 
         | 
         |     Filename: \EFI\HPUX\HPUX.EFI
         |    
         | DevicePath:[Acpi(HWP0002,100)/Pci(1|0)/Scsi(Pun1,Lun0)/
         |                HD(Part1,SigB45A0000)/\EFI\HPUX\HPUX.EFI]
         |     IA-64 EFI Application 05/28/03  11:52a     419,545 bytes
         | 
         |     BootFFFF: Acpi(HWP0002,100)/Pci(1|0)/Scsi(Pun1,Lun0)/
         |                HD(Part1,SigB45A0000)/\EFI\HPUX\HPUX.EFI
         ---------------------------------------------------------------------
    
         Now enter a description for this boot option, e.g. "HP-UX mirror boot
         disk":
    
         ---------------------------------------------------------------------
         |     Enter Description:  HP-UX mirror boot disk
         | 
         |     Current BootOption-->Main Menu. Select an Operation
         |     New BootOption Data. ASCII/Unicode strings only, with max of
         |                240 characters
         |     Enter BootOption Data Type [A-Ascii U-Unicode
         |                N-No BootOption] : N
         ---------------------------------------------------------------------
    
         Finally save the setting to NVRAM:
    
         |     Save changes to NVRAM [Y-Yes N-No]:  Y
  14. Try to boot from the mirror disk by choosing the appropriate boot option.
Categories: HP-UX