Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 6. Managing multipathed volumes
You can manage multipath volumes by using the multipath, dmsetup, and multipathd commands, which are provided by Device Mapper (DM) Multipath to resize devices, move file systems, and administer the multipathd daemon.
6.1. Resizing an online multipath device Link kopierenLink in die Zwischenablage kopiert!
Resize an online multipath device and its filesystem by using the multipathd and resize2fs commands. This allows you to expand storage capacity without downtime, ensuring applications remain available while scaling to meet growing data needs.
Procedure
- Resize your physical device.
Find the paths to the logical unit number (LUN):
# multipath -lResize your paths. For Small Computer System Interface (SCSI) devices, writing a 1 to the
rescanfile for the device causes the SCSI driver to rescan, as in the following command:# echo 1 > /sys/block/path_device/device/rescanEnsure that you run this command for each of the path devices. For example, if your path devices are
sda,sdb,sde, andsdf, run the following commands:# echo 1 > /sys/block/sda/device/rescan# echo 1 > /sys/block/sdb/device/rescan# echo 1 > /sys/block/sde/device/rescan# echo 1 > /sys/block/sdf/device/rescanResize your multipath device:
# multipathd resize map multipath_deviceResize the file system, assuming no LVM or DOS partitions are used:
# resize2fs /dev/mapper/mpatha
6.2. Moving a root file system from a single path device to a multipath device Link kopierenLink in die Zwischenablage kopiert!
Move the root filesystem from a single-path device to a multipath setup to ensure path redundancy for critical system data. This enhances reliability by allowing the system to boot and operate even if one storage path fails, improving overall availability.
Prerequisites
-
You have installed the
device-mapper-multipathpackage.
Procedure
Create the
/etc/multipath.confconfiguration file:# mpathconf --enableEnable the
multipathdservice:# systemctl enable multipathd.service-
If
find_multipathsis not set toon, edit theblacklistandblacklist_exceptionssections of/etc/multipath.conf, as described in Preventing devices from multipathing. Add the WWID of the device to the
/etc/multipath/wwidsfile:# multipath -a /dev/sdbwwid '3600d02300069c9ce09d41c4ac9c53200' addedReplace /dev/sdb with the root device name.
Confirm that your configuration file is set up correctly:
# multipath -d 3600d02300069c9ce09d41c4ac9c53200: mpatha (3600d02300069c9ce09d41c4ac9c53200) undef 3PARdata,VV size=446M features='1 queue_if_no_path' hwhandler='1 alua' wp=undef `-+- policy='service-time 0' prio=50 status=undef `- 5:0:0:0 sdb 8:16 undef ready runningReplace 3600d02300069c9ce09d41c4ac9c53200 with the WWID of your swap device.
Rebuild the
initramfsfile system withmultipath:# dracut --force --add multipath- Shut the machine down.
- Boot the machine.
- Make the other paths visible to the machine.
Verification
Check if the multipath device is created by running the following command:
# multipath -l | grep 3600d02300069c9ce09d41c4ac9c53200mpatha (3600d02300069c9ce09d41c4ac9c53200) dm-0 3PARdata,VV
6.3. Moving a swap file system from a single path device to a multipath device Link kopierenLink in die Zwischenablage kopiert!
Move swap file system from single-path to multipath storage to ensure redundancy and prevent performance issues. If swap uses Logical Volume Manager (LVM), no special steps are needed. However, non-LVM swap devices might require editing /etc/fstab to use the correct multipath device name.
Procedure
Create the
/etc/multipath.confconfiguration file:# mpathconf --enableEnable the
multipathdservice:# systemctl enable multipathd.service-
If the
find_multipathsconfiguration parameter is not set toon, edit theblacklistandblacklist_exceptionssections of the/etc/multipath.conffile, as described in Preventing devices from multipathing. Add the WWID of the device to the
/etc/multipath/wwidsfile:# multipath -a /dev/sdbwwid '3600d02300069c9ce09d41c4ac9c53200' addedReplace /dev/sdb with the swap device name.
Confirm that your configuration file is set up correctly:
# multipath -d 3600d02300069c9ce09d41c4ac9c53200: mpatha (3600d02300069c9ce09d41c4ac9c53200) undef 3PARdata,VV size=446M features='1 queue_if_no_path' hwhandler='1 alua' wp=undef `-+- policy='service-time 0' prio=50 status=undef `- 5:0:0:0 sdb 8:16 undef ready runningReplace 3600d02300069c9ce09d41c4ac9c53200 with the WWID of your swap device.
Set up an alias for the swap device in the
/etc/multipath.conffile:multipaths { multipath { wwid WWID_of_swap_device alias swapdev } }Edit the
/etc/fstabfile and replace the old device path to the root device with the multipath device.For example, if you had the following entry in the
/etc/fstabfile:/dev/sdb2 swap swap defaults 0 0Change the entry to the following:
/dev/mapper/swapdev swap swap defaults 0 0Rebuild the initramfs file system with multipath:
# dracut --force --add multipath- Shut the machine down.
- Boot the machine.
- Make the other paths visible to the machine.
Verification
Verify if the swap device is on the multipath device:
# swapon -sFilename Type Size Used Priority /dev/dm-3 partition 4169724 0 -2The file name should match the multipath swap device.
# readlink -f /dev/mapper/swapdev/dev/dm-3
6.4. Determining device mapper entries for multipath devices Link kopierenLink in die Zwischenablage kopiert!
Identify device mapper entries for configured multipath devices by using the multipathd command. This helps link multipath device names to their underlying device mapper entries, aiding in monitoring, troubleshooting, and system administration tasks for accurate device identification.
Procedure
Display all device mapper devices:
# multipathd show maps format "%n %d"name sysfs mpathd dm-4 mpathb dm-3 mpatha dm-2 mpathh dm-9
6.5. Administering the multipathd daemon Link kopierenLink in die Zwischenablage kopiert!
Manage and interact with the multipathd daemon by using its commands. Administering multipathd is essential for monitoring path status, viewing device info, and controlling multipath behavior in real-time without needing service restarts or system reboots.
Procedure
View the default format for the output of the
multipathd show mapscommand:# multipathd show mapsname sysfs uuid mpathc dm-0 360a98000324669436c2b45666c567942Some
multipathdcommands include aformatoption followed by a wildcard. Display a list of available wildcards with the following command:# multipathd show wildcardsmultipath format wildcards: %n name %w uuid %d sysfs ...Display the multipath devices that
multipathdis monitoring. Use wildcards to specify the shown fields:# multipathd show maps format "%n %w %d %s"name uuid sysfs vend/prod/rev mpathc 360a98000324669436c2b45666c567942 dm-0 NETAPP,LUNDisplay the paths that
multipathdis monitoring. Use wildcards to specify the shown fields:# multipathd show paths format "%n %w %d %s"target WWNN uuid dev vend/prod/rev 0x50001fe1500d2250 3600508b4001080520001e00011700000 sdb HP,HSV210Display data in a raw format:
# multipathd show maps raw format "%n %w %d %s"mpathc 360a98000324669436c2b45666c567942 dm-0 NETAPP,LUNIn raw format, no headers are printed and the fields are not padded to align the columns with the headers. This output can be more easily used for scripting.