kpartx: Linux Create Device Maps From Partition Tables ( mpath devices for partitions )

in Categories , , , , , , , last updated June 5, 2008

Q. How can I create mpath devices for partitions under CentOS Linux 5?

A. You need to use tool called kpartx. This is derived from util-linux partx package, which reads partition tables on specified device and create device maps over partitions segments detected. It is called from hotplug upon device maps creation and deletion. This is useful for setting multipath which is used to detect multiple paths to devices for fail-over or performance reasons and coalesces them.

To Setup your multipath type the following command at a shell prompt (login as the root user):
# for d in $(ls /dev/mapper/mpath*); do kpartx -a -v $d ; done

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Share this on (or read 0 comments/add one below):