Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux Multipath multipath configuration and usage Analysis

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about Linux Multipath multipath configuration and use analysis, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it.

Some storage products in the Linux platform use the multipath software that comes with the operating system, including the most common HP and IBM storage products. The multipathing software that comes with Linux is called multipath. This article takes the use of HP EVA series storage on the Linux platform as an example to configure and use multipathing in detail on the Linux platform.

So the question is, what exactly is multipath?

Ordinary computer mainframe is a hard disk attached to a bus, here is an one-to-one relationship. When it comes to the SAN environment composed of optical fiber, or the IPSAN environment composed of iSCSI, because the host and storage are connected through the optical fiber switch or multiple network cards and IP, then it constitutes a many-to-many relationship. That is, there can be multiple paths from the host to the storage. The IO from the host to the storage can be selected by multiple paths. Each host can go through several different paths to the corresponding storage. If it is used at the same time, how is the Icano traffic allocated? One of the paths is broken, how to deal with it? From the operating system's point of view, each path will be regarded as an actual physical disk, but in fact it is only a different path to the same physical disk, which brings confusion to the user when using it. Multipath software came into being to solve the above problems.

The main function of multipathing is to work with storage devices to achieve the following functions:

1. Fault switching and recovery

2. Load balancing of IO traffic

3. Disk virtualization

Because multipath software needs to be used in conjunction with storage, different vendors provide different versions based on different operating systems. And some manufacturers, software and hardware are not sold together, if you want to use multipath software, you may need to buy license from manufacturers. For example, EMC's multipath software based on linux needs to buy license separately. Fortunately, the kernel of RedHat and Suse 2.6 comes with a free multipath package that can be used for free, and it is also a general-purpose package that can support devices from most storage vendors, even if some are not well-known vendors, they can support and run well by making minor changes to the configuration file.

1. Introduction to multipath under Linux

In redhat, multipath has been installed by default when you install the operating system. Check the installation:

[root@seaing ~] # rpm-qa | grep device-mapper

Device-mapper-multipath-0.4.7-34.el5

Device-mapper-1.02.39-1.el5

Device-mapper-1.02.39-1.el5

Device-mapper-event-1.02.39-1.el5

1. Device-mapper-multipath: multipath-tools. Mainly provides tools such as multipathd and multipath and configuration files such as multipath.conf. These tools create and configure multipath devices (calling device-mapper 's user-space library) through the interface of device mapper's ioctr. The multipath device created will be in / dev / mapper).

2. Device-mapper: it mainly includes two parts: the kernel part and the user part. The kernel part is mainly composed of the device mapper core (dm.ko) and some target driver (md-multipath.ko). The core completes the mapping of the device, while target specifically deals with the iUnix from mappered device according to the mapping relationship and its own characteristics. At the same time, in the core part, an interface is provided, and users can communicate with the kernel part through ioctr to guide the behavior of kernel drivers, such as how to create mappered device, the properties of these divece, and so on. The user space section of linux device mapper mainly includes the package device-mapper. These include dmsetup tools and libraries to help create and configure mappered device. These libraries are mainly abstract and encapsulate the interface to communicate with ioctr to facilitate the creation and configuration of mappered device. These libraries need to be called in multipath-tool 's program.

3. Dm-multipath.ko and dm.ko:dm.ko are device mapper drivers. It is the basis for implementing multipath. Dm-multipath is actually a target driver for dm.

4. Scsi_id: included in the udev package, you can configure the program in multipath.conf to get the serial number of the scsi device. By the serial number, it can be judged that multiple paths correspond to the same device. This is the key to multipath implementation. Scsi_id uses the sg driver to send EVPD page80 or page83 inquery commands to the device to query the identity of the scsi device. However, some devices do not support EVPD's inquery command, so they cannot be used to generate multipath devices. However, scsi_id can be rewritten to virtualize an identifier for devices that cannot provide a scsi device identity, and output to standard output. When the multipath program creates a multipath device, it calls scsi_id to get the scsi id of the device from its standard output. When rewriting, you need to modify the return value of the scsi_id program to 0. Because in the multipath program, the straightforward is checked to determine whether the scsi id has been successfully obtained.

To learn more about Device Mapper Multipath (DM-Multipath), please refer to the blog post: http://blog.csdn.net/holandstone/article/details/7050234

2. Detailed configuration of multipath under Linux

First of all, the overall topology of our multipath under Linux is as follows:

Because the multipath package is already installed when the operating system is installed, it is no longer necessary to install it here, but manually if it is not installed.

1. Check whether the installation is normal.

[root@seaing ~] # lsmod | grep dm_multipath

Dm_multipath 56921 2 dm_round_robin

Scsi_dh 42177 1 dm_multipath

Dm_mod 101649 19 dm_multipath,dm_raid45,dm_snapshot,dm_zero,dm_mirror,dm_log

If the module does not load successfully, initialize the DM with the following command:

[root@seaing ~] # modprobe dm-multipath

[root@seaing ~] # modprobe dm-round-robin

[root@seaing ~] # service multipathd start

[root@seaing ~] # multipath-v2

2. Edit the configuration file

[root@seaing ~] # cat / etc/multipath.conf

Blacklist {

Devnode "^ sda"

}

Defaults {

User_friendly_names no

}

Multipaths {

Multipath {

Wwid 3600508b4000892b90002a00000050000 # WWID of disk

Alias after alias comsys-dm0 # mapping. Name it yourself.

Path_grouping_policy multibus # path Group Policy

Path_checker tur # method of determining path status

Path_selector "round-robin 0" # which path is selected for the next IO operation

}

Multipath {

Wwid 3600508b4000892b90002a00000090000

Alias comsys-dm1

Path_grouping_policy multibus

Path_checker tur

Path_selector "round-robin 0"

}

Multipath {

Wwid 3600508b4000892b90002a00000140000

Alias comsys-backup

Path_grouping_policy multibus

Path_checker tur

Path_selector "round-robin 0"

}

}

Devices {

Device {

Vendor "HP" # vendor name, which can be obtained through multipath-v3

Product "HSV300" # product model

Path_grouping_policy multibus # default path group policy

Getuid_callout "/ sbin/scsi_id-g-u-s / block/%n" # gets the default program for unique device numbers

Path_checker readsector0 # method of determining path status

Path_selector "round-robin 0" # method of selecting that path for the next IO operation

# failback immediate # failure recovery mode

# no_path_retry queue # the number of times the system attempted to use the failure path before disable queue

# rr_min_io 100 # the number of IO requests in the current user group before switching to another path

}

}

Note:

Parameters such as wwid,vendor,product and getuid_callout can be obtained by: multipath-v3 command. If each wwid alias is set in / etc/multipath.conf, the alias overrides this setting.

Here are two ways to get WWID

(1) by default, each multipath device name is set using the configuration in / var/lib/multipath/bindings. If each wwid alias is set in / etc/multipath.conf, the alias will override this setting.

[root@seaing ~] # cat / var/lib/multipath/bindings

# Multipath bindings, Version: 1.0

# NOTE: this file is automatically maintained by the multipath program.

# You should not need to edit this file in normal circumstances.

#

# Format:

# alias wwid

#

Mpath0 SATA_WDC_WD5003ABYX-_WD-WMAYP4135415

Mpath2 3600508b4000892b90002a00000050000

Mpath3 3600508b4000892b90002a00000090000

(2) obtain it through the multipath-v3 command

[root@seaing ~] # multipath-v3

Dm-0: blacklisted

Dm-1: blacklisted

Dm-2: blacklisted

Dm-3: blacklisted

Dm-4: blacklisted

Loop0: blacklisted

Loop1: blacklisted

Loop2: blacklisted

Loop3: blacklisted

Loop4: blacklisted

Loop5: blacklisted

Loop6: blacklisted

Loop7: blacklisted

Md0: blacklisted

Ram0: blacklisted

Ram10: blacklisted

Ram11: blacklisted

Ram12: blacklisted

Ram13: blacklisted

Ram14: blacklisted

Ram15: blacklisted

Ram1: blacklisted

Ram2: blacklisted

Ram3: blacklisted

Ram4: blacklisted

Ram5: blacklisted

Ram6: blacklisted

Ram7: blacklisted

Ram8: blacklisted

Ram9: blacklisted

Sda: blacklisted

Sdb: not found in pathvec

Sdb: mask = 0x1f

Sdb: bus = 1

Sdb: dev_t = 8:16

Sdb: size = 209715200

Sdb: vendor = HP

Sdb: product = HSV300

Sdb: rev = 0952

Sdb: h:b:t:l = 4 _ 0 _ 0 _ 0 _ 1

Sdb: tgt_node_name = 0x50014380013be3f0

Sdb: serial = P5512G29SVP02Q

Sdb: path checker = readsector0 (controller setting)

Sdb: checker timeout = 60000 ms (sysfs setting)

Sdb: state = 2

Sdb: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdb: uid = 3600508b4000892b90002a00000050000 (callout)

Sdb: getprio = NULL (internal default)

Sdb: prio = 1

Sdc: not found in pathvec

Sdc: mask = 0x1f

Sdc: bus = 1

Sdc: dev_t = 8:32

Sdc: size = 419430400

Sdc: vendor = HP

Sdc: product = HSV300

Sdc: rev = 0952

Sdc: h:b:t:l = 4VOV 0RU 0RU 2

Sdc: tgt_node_name = 0x50014380013be3f0

Sdc: serial = P5512G29SVP02Q

Sdc: path checker = readsector0 (controller setting)

Sdc: checker timeout = 60000 ms (sysfs setting)

Sdc: state = 2

Sdc: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdc: uid = 3600508b4000892b90002a00000090000 (callout)

Sdc: getprio = NULL (internal default)

Sdc: prio = 1

Sdd: not found in pathvec

Sdd: mask = 0x1f

Sdd: bus = 1

Sdd: dev_t = 8:48

Sdd: size = 209715200

Sdd: vendor = HP

Sdd: product = HSV300

Sdd: rev = 0952

Sdd: h:b:t:l = 4 _ 0 _ 0 _ 0 _ 3

Sdd: tgt_node_name = 0x50014380013be3f0

Sdd: serial = P5512G29SVP02Q

Sdd: path checker = readsector0 (controller setting)

Sdd: checker timeout = 60000 ms (sysfs setting)

Sdd: state = 2

Sdd: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdd: uid = 3600508b4000892b90002a00000140000 (callout)

Sdd: getprio = NULL (internal default)

Sdd: prio = 1

Sde: not found in pathvec

Sde: mask = 0x1f

Sde: bus = 1

Sde: dev_t = 8:64

Sde: size = 209715200

Sde: vendor = HP

Sde: product = HSV300

Sde: rev = 0952

Sde: h:b:t:l = 4 _ 0 _ 1 _ 1

Sde: tgt_node_name = 0x50014380013be3f0

Sde: serial = P5512G29SVP01O

Sde: path checker = readsector0 (controller setting)

Sde: checker timeout = 60000 ms (sysfs setting)

Sde: state = 2

Sde: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sde: uid = 3600508b4000892b90002a00000050000 (callout)

Sde: getprio = NULL (internal default)

Sde: prio = 1

Sdf: not found in pathvec

Sdf: mask = 0x1f

Sdf: bus = 1

Sdf: dev_t = 8:80

Sdf: size = 419430400

Sdf: vendor = HP

Sdf: product = HSV300

Sdf: rev = 0952

Sdf: h:b:t:l = 4 _ 0 _ 0 _ 1 _ 2

Sdf: tgt_node_name = 0x50014380013be3f0

Sdf: serial = P5512G29SVP01O

Sdf: path checker = readsector0 (controller setting)

Sdf: checker timeout = 60000 ms (sysfs setting)

Sdf: state = 2

Sdf: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdf: uid = 3600508b4000892b90002a00000090000 (callout)

Sdf: getprio = NULL (internal default)

Sdf: prio = 1

Sdg: not found in pathvec

Sdg: mask = 0x1f

Sdg: bus = 1

Sdg: dev_t = 8:96

Sdg: size = 209715200

Sdg: vendor = HP

Sdg: product = HSV300

Sdg: rev = 0952

Sdg: h:b:t:l = 4VOV 0RU 1RU 3

Sdg: tgt_node_name = 0x50014380013be3f0

Sdg: serial = P5512G29SVP01O

Sdg: path checker = readsector0 (controller setting)

Sdg: checker timeout = 60000 ms (sysfs setting)

Sdg: state = 2

Sdg: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdg: uid = 3600508b4000892b90002a00000140000 (callout)

Sdg: getprio = NULL (internal default)

Sdg: prio = 1

Sdh: not found in pathvec

Sdh: mask = 0x1f

Sdh: bus = 1

Sdh: dev_t = 8RU 112

Sdh: size = 209715200

Sdh: vendor = HP

Sdh: product = HSV300

Sdh: rev = 0952

Sdh: h:b:t:l = 5VOV 0RU 0RU 1

Sdh: tgt_node_name = 0x50014380013be3f0

Sdh: serial = P5512G29SVP02Q

Sdh: path checker = readsector0 (controller setting)

Sdh: checker timeout = 60000 ms (sysfs setting)

Sdh: state = 2

Sdh: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdh: uid = 3600508b4000892b90002a00000050000 (callout)

Sdh: getprio = NULL (internal default)

Sdh: prio = 1

Sdi: not found in pathvec

Sdi: mask = 0x1f

Sdi: bus = 1

Sdi: dev_t = 8RU 128

Sdi: size = 419430400

Sdi: vendor = HP

Sdi: product = HSV300

Sdi: rev = 0952

Sdi: h:b:t:l = 5VOV 0RU 0RU 2

Sdi: tgt_node_name = 0x50014380013be3f0

Sdi: serial = P5512G29SVP02Q

Sdi: path checker = readsector0 (controller setting)

Sdi: checker timeout = 60000 ms (sysfs setting)

Sdi: state = 2

Sdi: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdi: uid = 3600508b4000892b90002a00000090000 (callout)

Sdi: getprio = NULL (internal default)

Sdi: prio = 1

Sdj: not found in pathvec

Sdj: mask = 0x1f

Sdj: bus = 1

Sdj: dev_t = 8RU 144

Sdj: size = 209715200

Sdj: vendor = HP

Sdj: product = HSV300

Sdj: rev = 0952

Sdj: h:b:t:l = 5VOV 0RU 0RU 3

Sdj: tgt_node_name = 0x50014380013be3f0

Sdj: serial = P5512G29SVP02Q

Sdj: path checker = readsector0 (controller setting)

Sdj: checker timeout = 60000 ms (sysfs setting)

Sdj: state = 2

Sdj: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdj: uid = 3600508b4000892b90002a00000140000 (callout)

Sdj: getprio = NULL (internal default)

Sdj: prio = 1

Sdk: not found in pathvec

Sdk: mask = 0x1f

Sdk: bus = 1

Sdk: dev_t = 8RU 160

Sdk: size = 209715200

Sdk: vendor = HP

Sdk: product = HSV300

Sdk: rev = 0952

Sdk: h:b:t:l = 5VOV 0RU 1R 1

Sdk: tgt_node_name = 0x50014380013be3f0

Sdk: serial = P5512G29SVP01O

Sdk: path checker = readsector0 (controller setting)

Sdk: checker timeout = 60000 ms (sysfs setting)

Sdk: state = 2

Sdk: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdk: uid = 3600508b4000892b90002a00000050000 (callout)

Sdk: getprio = NULL (internal default)

Sdk: prio = 1

Sdl: not found in pathvec

Sdl: mask = 0x1f

Sdl: bus = 1

Sdl: dev_t = 8RU 176

Sdl: size = 419430400

Sdl: vendor = HP

Sdl: product = HSV300

Sdl: rev = 0952

Sdl: h:b:t:l = 5VOV 0RU 1RU 2

Sdl: tgt_node_name = 0x50014380013be3f0

Sdl: serial = P5512G29SVP01O

Sdl: path checker = readsector0 (controller setting)

Sdl: checker timeout = 60000 ms (sysfs setting)

Sdl: state = 2

Sdl: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdl: uid = 3600508b4000892b90002a00000090000 (callout)

Sdl: getprio = NULL (internal default)

Sdl: prio = 1

Sdm: not found in pathvec

Sdm: mask = 0x1f

Sdm: bus = 1

Sdm: dev_t = 8VR 192

Sdm: size = 209715200

Sdm: vendor = HP

Sdm: product = HSV300

Sdm: rev = 0952

Sdm: h:b:t:l = 5VOV 0RU 1RU 3

Sdm: tgt_node_name = 0x50014380013be3f0

Sdm: serial = P5512G29SVP01O

Sdm: path checker = readsector0 (controller setting)

Sdm: checker timeout = 60000 ms (sysfs setting)

Sdm: state = 2

Sdm: getuid = / sbin/scsi_id-g-u-s / block/%n (controller setting)

Sdm: uid = 3600508b4000892b90002a00000140000 (callout)

Sdm: getprio = NULL (internal default)

Sdm: prio = 1

Sr0: blacklisted

= paths list =

Uuid hcil dev dev_t pri dm_st chk_st vend/pr

3600508b4000892b90002a00000050000 4:0:0:1 sdb 8:16 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000090000 4:0:0:2 sdc 8:32 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000140000 4:0:0:3 sdd 8:48 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000050000 4:0:1:1 sde 8:64 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000090000 4:0:1:2 sdf 8:80 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000140000 4:0:1:3 sdg 8:96 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000050000 5:0:0:1 sdh 8:112 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000090000 5:0:0:2 sdi 8:128 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000140000 5:0:0:3 sdj 8:144 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000050000 5:0:1:1 sdk 8:160 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000090000 5:0:1:2 sdl 8:176 1 [undef] [ready] HP,HSV3

3600508b4000892b90002a00000140000 5:0:1:3 sdm 8:192 1 [undef] [ready] HP,HSV3

Params = 00 1 1 round-robin 0 4 1 8:32 1000 8:80 1000 8 128 1000 8 purl 176 1000

Status = 2 000 1 1 A 0 40 8:32 A 0 8:80 A 0 8 purl 128 A 0 8 176 A 0

Params = 00 11 round-robin 0 4 1 8:16 1000 8:64 1000 8 112 1000 8 purl 160 1000

Status = 2 000 11 A 0 40 8:16 A 0 8:64 A 0 8 purl 112 A 0 8 purl 160 A 0

Params = 00 1 1 round-robin 0 4 1 8:48 1000 8:96 1000 8 144 1000 8 purl 192 1000

Status = 2 000 1 1 A 0 40 8:48 A 0 8:96 A 0 8 purl 144 A 0 8 purl 192 A 0

Sdb: ownership set to comsys-dm0

Sdb: not found in pathvec

Sdb: mask = 0xc

Sdb: state = 2

Sdb: prio = 1

Sde: ownership set to comsys-dm0

Sde: not found in pathvec

Sde: mask = 0xc

Sde: state = 2

Sde: prio = 1

Sdh: ownership set to comsys-dm0

Sdh: not found in pathvec

Sdh: mask = 0xc

Sdh: state = 2

Sdh: prio = 1

Sdk: ownership set to comsys-dm0

Sdk: not found in pathvec

Sdk: mask = 0xc

Sdk: state = 2

Sdk: prio = 1

Comsys-dm0: pgfailover =-1 (internal default)

Comsys-dm0: pgpolicy = multibus (LUN setting)

Comsys-dm0: selector = round-robin 0 (LUN setting)

Comsys-dm0: features = 0 (internal default)

Comsys-dm0: hwhandler = 0 (internal default)

Comsys-dm0: rr_weight = 1 (internal default)

Comsys-dm0: minio = 1000 (config file default)

Comsys-dm0: no_path_retry = NONE (internal default)

Pg_timeout = NONE (internal default)

Comsys-dm0: set ACT_NOTHING (map unchanged)

Sdc: ownership set to comsys-dm1

Sdc: not found in pathvec

Sdc: mask = 0xc

Sdc: state = 2

Sdc: prio = 1

Sdf: ownership set to comsys-dm1

Sdf: not found in pathvec

Sdf: mask = 0xc

Sdf: state = 2

Sdf: prio = 1

Sdi: ownership set to comsys-dm1

Sdi: not found in pathvec

Sdi: mask = 0xc

Sdi: state = 2

Sdi: prio = 1

Sdl: ownership set to comsys-dm1

Sdl: not found in pathvec

Sdl: mask = 0xc

Sdl: state = 2

Sdl: prio = 1

Comsys-dm1: pgfailover =-1 (internal default)

Comsys-dm1: pgpolicy = multibus (LUN setting)

Comsys-dm1: selector = round-robin 0 (LUN setting)

Comsys-dm1: features = 0 (internal default)

Comsys-dm1: hwhandler = 0 (internal default)

Comsys-dm1: rr_weight = 1 (internal default)

Comsys-dm1: minio = 1000 (config file default)

Comsys-dm1: no_path_retry = NONE (internal default)

Pg_timeout = NONE (internal default)

Comsys-dm1: set ACT_NOTHING (map unchanged)

Sdd: ownership set to comsys-backup

Sdd: not found in pathvec

Sdd: mask = 0xc

Sdd: state = 2

Sdd: prio = 1

Sdg: ownership set to comsys-backup

Sdg: not found in pathvec

Sdg: mask = 0xc

Sdg: state = 2

Sdg: prio = 1

Sdj: ownership set to comsys-backup

Sdj: not found in pathvec

Sdj: mask = 0xc

Sdj: state = 2

Sdj: prio = 1

Sdm: ownership set to comsys-backup

Sdm: not found in pathvec

Sdm: mask = 0xc

Sdm: state = 2

Sdm: prio = 1

Comsys-backup: pgfailover =-1 (internal default)

Comsys-backup: pgpolicy = multibus (LUN setting)

Comsys-backup: selector = round-robin 0 (LUN setting)

Comsys-backup: features = 0 (internal default)

Comsys-backup: hwhandler = 0 (internal default)

Comsys-backup: rr_weight = 1 (internal default)

Comsys-backup: minio = 1000 (config file default)

Comsys-backup: no_path_retry = NONE (internal default)

Pg_timeout = NONE (internal default)

Comsys-backup: set ACT_NOTHING (map unchanged)

The following is an introduction to the standard documentation for the relevant parameters:

Attribute

Description

Wwid

Specifies the WWID of themultipath device to which themultipath attributes apply. This parameter is mandatory for this section of themultipath.conf file.

Alias

Specifies the symbolic name for themultipath device to which themultipath attributes apply. If you are usinguser_friendly_names, do not set this value tompathn; this may conflict with an automatically assigned user friendly name and give you incorrect device node names.

Path_grouping_policy

Specifies the default path grouping policy to apply to unspecified multipaths. Possible values include: failover = 1 path per priority group multibus = all valid paths in 1 priority group group_by_serial = 1 priority group per detected serial number group_by_prio = 1 priority group per path priority value group_by_node_name = 1 priority group per target node name

Path_selector

Specifies the default algorithm to use in determining what path to use for the next I/O operation. Possible values include: round-robin 0: Loop through every path in the path group, sending the same amount of I/O to each. Queue-length 0: Send the next bunch of I/O down the path with the least number of outstanding I/O requests. Service-time 0: Send the next bunch of I/O down the path with the shortest estimated service time, which is determined by dividing the total size of the outstanding I/O to each path by its relative throughput.

Failback

Manages path group failback. A value of immediate specifies immediate failback to the highest priority path group that contains active paths. A value of manual specifies that there should not be immediate failback but that failback can happen only with operator intervention. A value of followover specifies that automatic failback should be performed when the first path of a path group becomes active. This keeps a node from automatically failing back when another node requested the failover. A numeric value greater than zero specifies deferred failback, expressed in seconds.

Prio

Specifies the default function to call to obtain a path priority value. For example, the ALUA bits in SPC-3 provide an exploitableprio value. Possible values include: const: Set a priority of 1 to all paths. Emc: Generate the path priority for EMC arrays. Alua: Generate the path priority based on the SCSI-3 ALUA settings. Tpg_pref: Generate the path priority based on the SCSI-3 ALUA settings, using the preferred port bit. Ontap: Generate the path priority for NetApp arrays. Rdac: Generate the path priority for LSI/Engenio RDAC controller. Hp_sw: Generate the path priority for Compaq/HP controller in active/standby mode. Hds: Generate the path priority for Hitachi HDS Modular storage arrays.

No_path_retry

A numeric value for this attribute specifies the number of times the system should attempt to use a failed path before disabling queueing. A value of fail indicates immediate failure, without queueing. A value of queue indicates that queueing should not stop until the path is fixed.

Rr_min_io

Specifies the number of I/O requests to route to a path before switching to the next path in the current path group. This setting is only for systems running kernels older that 2.6.31. Newer systems should userr_min_io_rq. The default value is 1000.

Rr_min_io_rq

Specifies the number of I/O requests to route to a path before switching to the next path in the current path group, using request-based device-mapper-multipath. This setting should be used on systems running current kernels. On systems running kernels older than 2.6.31, use rr_min_io. The default value is 1.

Rr_weight

If set to priorities, then instead of sending rr_min_iorequests to a path before calling path_selector to choose the next path, the number of requests to send is determined byrr_min_io times the path's priority, as determined by theprio function. If set to uniform, all path weights are equal.

Flush_on_last_del

If set to yes, then multipath will disable queueing when the last path to a device has been deleted.

3. Start the multipathd service and set it to start automatically

[root@seaing ~] # service multipathd restart

[root@seaing] # chkconfig-- level 345 multipathd on

[root@seaing ~] # chkconfig-- list | grep multipathd

4. Check the device name after multipath aggregation and the corresponding link of the device.

[root@seaing ~] # multipath-ll

Comsys-dm1 (3600508b4000892b90002a00000090000) dm-3 HP,HSV300

[size=200G] [features=0] [hwhandler=0] [rw]

\ _ round-robin 0 [prio=4] [active]

\ _ 4 sdc 8:32 [active] [ready]

\ _ 4 sdf 0 ready 1 sdf 8:80 [active] [ready]

\ _ 5 ready 0 sdi 8 12 [active] [ready]

\ _ 5 active 0 1 sdl 8 sdl 176 [active] [ready]

Comsys-dm0 (3600508b4000892b90002a00000050000) dm-2 HP,HSV300

[size=100G] [features=0] [hwhandler=0] [rw]

\ _ round-robin 0 [prio=4] [active]

\ _ 4 sdb 8:16 [active] [ready]

Sde 8:64 [active] [ready]

\ _ 5VOV 0VOV 0RU 1 sdh 8RU 11212 [active] [ready]

\ _ 5 active 0 1 ready 1 sdk 8 14 0 [ready]

Comsys-backup (3600508b4000892b90002a00000140000) dm-4 HP,HSV300

[size=100G] [features=0] [hwhandler=0] [rw]

\ _ round-robin 0 [prio=4] [active]

\ _ 4 sdd 8:48 [active] [ready]

3 sdg 8:96 [active] [ready]

\ _ 5VOVOVUL0VOUR 3 sdj 8VOUR 144[ active] [ready]

\ _ 5 active 0 1 ready 3 sdm 8 lo 192 [active] [ready]

5. Check whether the configuration is successful

If the configuration is correct, there will be more devices such as mpath0, mpath2 (automatically assigned name), etc., in the / dev/mapper/ directory, but because the author has aliases during configuration, aliases will be used instead of automatically assigned names.

[root@seaing ~] # ll / dev/mapper/

Total 0

Brw-rw---- 1 root disk 253, 4 Oct 26 14:30 comsys-backup

Brw-rw---- 1 root disk 253, 2 Oct 26 14:30 comsys-dm0

Brw-rw---- 1 root disk 253, 3 Oct 26 14:30 comsys-dm1

Crw- 1 root root 10, 63 Oct 26 14:30 control

Brw-rw---- 1 root disk 253, 0 Oct 26 14:30 VolGroup00-LogVol00

Brw-rw---- 1 root disk 253, 1 Oct 26 14:30 VolGroup00-LogVol01

With the fdisk-l command, you can see the disks created by multipath software, such as / dev/dm- [0-3] in the following figure.

[root@seaing ~] # fdisk-l

Disk / dev/sda: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/ dev/sda1 * 1 13 104391 83 Linux

/ dev/sda2 14 60801 488279610 8e Linux LVM

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: 214.7 GB, 214748364800 bytes

255 heads, 63 sectors/track, 26108 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sdd: 107.3 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sde: 107.3 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sdf: 214.7 GB, 214748364800 bytes

255 heads, 63 sectors/track, 26108 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: 107.3 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sdi: 214.7 GB, 214748364800 bytes

255 heads, 63 sectors/track, 26108 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sdj: 107.3 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdj doesn't contain a valid partition table

Disk / dev/sdk: 107.3 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdk doesn't contain a valid partition table

Disk / dev/sdl: 214.7 GB, 214748364800 bytes

255 heads, 63 sectors/track, 26108 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdl doesn't contain a valid partition table

Disk / dev/sdm: 107.3 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdm doesn't contain a valid partition table

Disk / dev/dm-2: 107.3 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/dm-2 doesn't contain a valid partition table

Disk / dev/dm-3: 214.7 GB, 214748364800 bytes

255 heads, 63 sectors/track, 26108 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/dm-3 doesn't contain a valid partition table

Disk / dev/dm-4: 107.3 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/dm-4 doesn't contain a valid partition table

[root@seaing ~] # ll / dev/mpath/

Total 0

Lrwxrwxrwx 1 root root 7 Oct 26 14:30 comsys-backup->.. / dm-4

Lrwxrwxrwx 1 root root 7 Oct 26 14:30 comsys-dm0->.. / dm-2

Lrwxrwxrwx 1 root root 7 Oct 26 14:30 comsys-dm1->.. / dm-3

Multipath basic operation command

[root@seaing ~] # / etc/init.d/multipathd start # enable mulitipath service

[root@seaing ~] # multipath-F # Delete an existing path

[root@seaing ~] # multipath-v2 # format path

[root@seaing ~] # multipath-ll # View multipath

III. Use cases of multipath

To manipulate the disks generated by multipath software, you can directly manipulate the disks in the / dev/mapper/ directory. It is a good idea to run the pvcreate command before partitioning disks generated by multipathing software:

[root@seaing ~] # pvcreate / dev/mapper/comsys-dm0 Physical volume "/ dev/mapper/comsys-dm0" successfully created [root@seaing ~] # [root@seaing ~] # pvs PV VG Fmt Attr PSize PFree / dev/dm-2 lvm2-100.00G 100.00G / dev/sda2 VolGroup00 lvm2 a-465.66G 0 [root@seaing] # fdisk / dev/mapper/comsys-dm0Device contains neither a valid DOS partition table, nor Sun SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent won't be recoverable.

The number of cylinders for this disk is set to 13054.There is nothing wrong with that, but this is larger than 1024 and could in certain setups cause problems with:1) software that runs at boot time (e.g.old versions of LILO) 2) booting and partitioning software from other OSs (e.g.DOS FDISK, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w (rite)

Command (m for help): nCommand action e extended p primary partition 1-4) pPartition number (1-4): 1First cylinder (1-13054, default 1): Using default value 1Last cylinder or + size or + sizeM or + sizeK (1-13054, default 13054): + 10G

Command (m for help): P

Disk / dev/mapper/comsys-dm0: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/mapper/comsys-dm0p1 1 1217 9775521 83 Linux

Command (m for help): nCommand action e extended p primary partition (1-4) pPartition number (1-4): 2First cylinder (1218-13054, default 1218): Using default value 1218Last cylinder or + size or + sizeM or + sizeK (1218-13054, default 13054): + 20G

Command (m for help): P

Disk / dev/mapper/comsys-dm0: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/mapper/comsys-dm0p1 1 1217 9775521 83 Linux/dev/mapper/comsys-dm0p2 1218 3650 19543072 + 83 Linux

Command (m for help): wThe partition table has been altered!

Calling ioctl () to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.The kernel still uses the old table.The new table will be used at the next reboot.Syncing disks.

When using fdisk to partition and save the disk generated by multipath software, there will be an error, which should be ignored.

[root@seaing ~] # fdisk-l

Disk / dev/sda: 500.1 GB, 500107862016 bytes255 heads, 63 sectors/track, 60801 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 60801 488279610 8e Linux LVM

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

Device Boot Start End Blocks Id System

Disk / dev/sdc: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sdd: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sde: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Disk / dev/sdf: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

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

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

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

Disk / dev/sdh: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Disk / dev/sdi: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sdj: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdj doesn't contain a valid partition table

Disk / dev/sdk: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Disk / dev/sdl: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdl doesn't contain a valid partition table

Disk / dev/sdm: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdm doesn't contain a valid partition table

Disk / dev/dm-2: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/dm-2p1 1 1217 9775521 83 Linux/dev/dm-2p2 1218 3650 19543072 + 83 Linux

Disk / dev/dm-3: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/dm-3 doesn't contain a valid partition table

Disk / dev/dm-4: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/dm-4 doesn't contain a valid partition table

After fdisk partitions the disk generated by multipath software, the generated partition is not immediately added to the / dev/ directory. In this case, we need to restart the drive of IPSAN or FCSAN. If you use iscsi-initiator to connect to the restart ISCSI service of IPSAN, you can find the generated partition; if it is FCSAN, you need to restart the operating system to identify it.

[root@seaing] # ll / dev/dm*brw-rw---- 1 root root 253, 2 Oct 26 14:20 / dev/dm-2brw-rw---- 1 root root 253, 3 Oct 26 14:15 / dev/dm-3brw-rw---- 1 root root 253, 4 Oct 26 14:15 / dev/dm-4 [root@seaing] # [root@seaing] # ll / dev/mapper/total 0brwkhokan-1 root disk 253 4 Oct 26 14:15 comsys-backupbrw-rw---- 1 root disk 253,2 Oct 26 14:22 comsys-dm0brw-rw---- 1 root disk 253,3 Oct 26 14:15 comsys-dm1crw- 1 root root 10, 63 Oct 26 14:15 controlbrw-rw---- 1 root disk 253,0 Oct 26 14:15 VolGroup00-LogVol00brw-rw---- 1 root disk 253,1 Oct 26 14:15 VolGroup00-LogVol01 after restarting the operating system

The following comsys-dm0p1 and comsys-dm0p2 are our partitions for the multipath disk [root@seaing ~] # ll / dev/mapper/total 0brwMurray RW comsys-dm0brw-rw-----1 root disk 253, 4 Oct 26 14:30 comsys-backupbrw-rw---- 1 root disk 253, 2 Oct 26 14:30 comsys-dm0brw-rw---- 1 root disk 253, 5 Oct 26 14:35 comsys-dm0p1brw-rw---- 1 root disk 253 6 Oct 26 14:30 comsys-dm0p2brw-rw---- 1 root disk 253, 3 Oct 26 14:30 comsys-dm1crw- 1 root root 10, 63 Oct 26 14:30 control

[root@seaing] # ll / dev/dm*brw-rw---- 1 root root 253,2 Oct 26 14:30 / dev/dm-2brw-rw---- 1 root root 253,3 Oct 26 14:30 / dev/dm-3brw-rw---- 1 root root 253,4 Oct 26 14:30 / dev/dm-4brw-rw---- 1 root root 253,5 Oct 26 14:30 / dev/dm-5brw-rw---- 1 root root 253,6 Oct 26 14:30 / dev/dm-6

[root@seaing] # ll / dev/mpath/total 0lrwxrwxrwx 1 root root 7 Oct 26 14:30 comsys-backup->.. / dm-4lrwxrwxrwx 1 root root 7 Oct 26 14:30 comsys-dm0->.. / dm-2lrwxrwxrwx 1 root root 7 Oct 26 14:30 comsys-dm0p1->.. / dm-5lrwxrwxrwx 1 root root 7 Oct 26 14:30 comsys-dm0p2->.. / dm-6lrwxrwxrwx 1 root root 7 Oct 26 14:30 comsys-dm1->.. / dm-3

[root@seaing ~] # fdisk-l

Disk / dev/sda: 500.1 GB, 500107862016 bytes255 heads, 63 sectors/track, 60801 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 60801 488279610 8e Linux LVM

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

Device Boot Start End Blocks Id System/dev/sdb1 1 1217 9775521 83 Linux/dev/sdb2 1218 3650 19543072 + 83 Linux

Disk / dev/sdc: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sdd: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sde: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/sde1 1 1217 9775521 83 Linux/dev/sde2 1218 3650 19543072 + 83 Linux

Disk / dev/sdf: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

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

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

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

Disk / dev/sdh: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/sdh2 1 1217 9775521 83 Linux/dev/sdh3 1218 3650 19543072 + 83 Linux

Disk / dev/sdi: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

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

Disk / dev/sdj: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdj doesn't contain a valid partition table

Disk / dev/sdk: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/sdk1 1 1217 9775521 83 Linux/dev/sdk2 1218 3650 19543072 + 83 Linux

Disk / dev/sdl: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdl doesn't contain a valid partition table

Disk / dev/sdm: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/sdm doesn't contain a valid partition table

Disk / dev/dm-2: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/dm-2p1 1 1217 9775521 83 Linux/dev/dm-2p2 1218 3650 19543072 + 83 Linux

Disk / dev/dm-3: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/dm-3 doesn't contain a valid partition table

Disk / dev/dm-4: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/dm-4 doesn't contain a valid partition table

Disk / dev/dm-5: 10.0 GB, 10010133504 bytes255 heads, 63 sectors/track, 1216 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/dm-5 doesn't contain a valid partition table

Disk / dev/dm-6: 20.0 GB, 20012106240 bytes255 heads, 63 sectors/track, 2433 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Disk / dev/dm-6 doesn't contain a valid partition table

Format comsys-dm0p1 partitions into ext3 file system

[root@seaing] # mkfs.ext3 / dev/mapper/comsys-dm0p1mke2fs 1.39 (29-May-2006) Filesystem label=OS type: LinuxBlock size=4096 (log=2) Fragment size=4096 (log=2) 1224000 inodes, 2443880 blocks122194 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=250399948875 block groups32768 blocks per group, 32768 fragments per group16320 inodes per groupSuperblock backups stored on blocks: 32768,98304,163840,229376,294912,819200884736,1605632

Writing inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 27 mounts or180 days, whichever comes first. Use tune2fs-c or-i to override. [root@seaing ~] # [root@seaing ~] # [root@seaing ~] # df-hFilesystem Size Used Avail Use% Mounted on/dev/mapper/VolGroup00-LogVol00 434G 8.4G 404G 3% / / dev/sda1 99M 18M 77M 19% / boottmpfs 7.9G 07.9G 0% / dev/shm/ Software/rhel5.5-x86_64.iso 3.5G 3.5G 0100% / mnt/dvd

Mount / dev/mapper/comsys-dm0p1 to / comsys directory [root@seaing ~] # mount / dev/mapper/comsys-dm0p1 / comsys/ [root@seaing ~] # [root@seaing ~] # df-hFilesystem Size Used Avail Use% Mounted on/dev/mapper/VolGroup00-LogVol00 434G 8.4G 404G 3% / / dev/sda1 99M 18M 77M 19% / boottmpfs 7.9G 0 7.9G 0% / dev/shm/software/rhel5.5-x86_64.iso 3.5G 3.5G 0100% / mnt/dvd/dev/mapper/comsys-dm0p1 9.2G 150m 8.6G 2% / comsys

Of course, you can also create a disk into a physical volume, then create a volume group based on the physical volume, then create a logical volume, and finally mount it into a file system. The following case is realized in this way (note: the following case is not related to the above case, readers, please pay attention! )

[root@seaing] # ll / dev/mapper/total 0brw Oct comsys-dm0p1brw-rw---- RW comsys-dm0p1brw-rw-----1 root disk 253, 4 Oct 25 11:14 comsys-backupbrw-rw---- 1 root disk 253, 2 Oct 25 11:14 comsys-dm0brw-rw---- 1 root disk 253, 5 Oct 25 11:14 comsys-dm0p1brw-rw---- 1 root disk 253, 6 Oct 25 11:14 comsys-dm0p2brw-rw---- 1 root disk 253, 7 Oct 25 11:14 comsys-dm0p3brw-rw---- 1 root disk 253 3 Oct 25 11:14 comsys-dm1crw- 1 root root 10, 63 Oct 25 11:14 controlbrw-rw---- 1 root disk 253, 0 Oct 25 11:14 VolGroup00-LogVol00brw-rw---- 1 root disk 253 1 Oct 25 11:14 VolGroup00-LogVol01 [root@seaing ~] # [root@seaing ~] # [root@seaing ~] # mkdir / backup [root@seaing ~] # [root@seaing ~] # mount / dev/mapper/comsys-backup / backupmount: you must specify the filesystem type [root@seaing ~] # pvs PV VG Fmt Attr PSize PFree / dev/sda2 VolGroup00 lvm2 a-465.66G 0 [root@seaing] # [root@seaing ~] # vgs VG # PV # LV # SN Attr VSize VFree VolGroup00 120 wz--n- 465.66G 0 [root@seaing] # [root@seaing] # lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert LogVol00 VolGroup00-wi-ao 448.03G LogVol01 VolGroup00-wi-ao 17.62G [root@seaing] # [root@seaing] # pvcreate / dev/mapper/comsys-backup Physical volume "/ dev/mapper/comsys -backup "successfully created [root@seaing] # [root@seaing] # pvs PV VG Fmt Attr PSize PFree / dev/dm-4 lvm2-100.00G 100.00G / dev/sda2 VolGroup00 lvm2 a-465.66G 0 [root@seaing] # [root@seaing] # vgcreate vg_backup / dev/mapper/comsys-backup Volume group" vg_backup "successfully created [root@seaing] # [root@seaing ~] # [root@seaing ~] # vgs VG # PV # LV # SN Attr VSize VFree VolGroup00 120 wz--n- 465.66G 0 vg_backup 100 wz--n- 100.00G 100.00G [root@seaing] # [root@seaing] # pvs PV VG Fmt Attr PSize PFree / dev/dm-4 vg_backup lvm2 a-100.00G / dev/sda2 VolGroup00 lvm2 a-465.66G 0 [root@seaing ~] # [root@seaing ~] # [root@seaing ~] # lvcreate-L 20G-n lv_backup vg_backup Logical volume "lv_backup" created [root@seaing ~] # [root@seaing ~] # lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert LogVol00 VolGroup00-wi-ao 448.03G LogVol01 VolGroup00-wi-ao 17.62G lv_backup vg_backup-wi-a- 20.00G [root@seaing ~] # [root@seaing ~] # [root@seaing ~] # mkfs.ext3 / dev/vg_backup/lv_backupmke2fs 1.39 (29-May-2006) Filesystem label=OS type: LinuxBlock size=4096 (log=2) Fragment size=4096 (log=2) 2621440 inodes 5242880 blocks262144 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=4294967296160 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks: 32768,98304,163840,229376,294912,819200,884736,1605632,2654208,4096000

Writing inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or180 days, whichever comes first. Use tune2fs-c or-i to override. [root@seaing ~] # [root@seaing ~] # [root@seaing ~] # mount / dev/vg_backup/lv_backup / backup

[root@seaing ~] # df-hFilesystem Size Used Avail Use% Mounted on/dev/mapper/VolGroup00-LogVol00 434G 4.9G 407G 2% / / dev/sda1 99M 18M 77M 19% / boottmpfs 7.9G 07.9G 0% / dev/shm/dev/mapper/vg_backup-lv_backup 20G 173m Above 19G 1% / backup is the Linux Multipath multipath configuration and usage analysis. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report