RedHat Add new San SCSI disk with multipath without rebooting
id : 8eza7to2am
category : computer
blog : unixlinux
created : 05/10/10 - 16:31:52

Check your multipath configuration
  • In /etc/multipath.conf blacklist your local devices, for example :
devnode_blacklist {
       devnode "cciss*"
}

  • Add/Load kernel modules :
# modprobe dm-multipath
# modprobe dm-round-robin

  • Active multipathd service at boot and run multipathd service :
# service multipathd start
# chkconfig multipathd on


Scan all your SCSI hosts
  • Run this command to discover new devices :
# for i in `ls /sys/class/scsi_host/`; do echo "- - -" > /sys/class/scsi_host/$i/scan"; done

  • Have a look on multipath to see if your devices were discovered :
# multipath -l

  • You can also see your new devices file descriptors in /dev/mapper/ folder :
# ls /dev/mapper/mpath*


Run fdisk on all your new devices
  • If you are using LVM :
# fdisk /dev/mapper/<new_mpath_device>
n> add a new partition
p> primary partition (1-4)
1> Partition number (1-4)
Take all space disk
t>
8e Linux LVM

  • Little tricks with fdisk :
# cat fdisk.txt
n
p
1
1
4177
t
8e
w
# fdisk /dev/mapper/mpath3 < /root/fdisk.txt


Run kpartx on your new devices
  • OPTIONNALY run a partprobe :
# partprobe /dev/mapper/<new_mpath_device>

  • Run kpartx to create device maps from partition tables :
# kpartx -a /dev/mapper/<new_mpath_device>
# ls /dev/mapper/<new_mpath_device>p*


Add it to lvm if needed
  • You can use this new device to add it into LVM
# pvcreate /dev/mapper/<new_mpath_device>p1

  • Run
    • vgcreate or
    • vgextend to use your new PV