5.3. Moving root File Systems from a Single Path Device to a Multipath Device
If you have installed your system on a single-path device and later add another path to the root file system, you will need to move your root file system to a multipathed device. This section documents the procedure for moving from a single-path to a multipathed device.
After ensuring that you have installed the
device-mapper-multipath package, perform the following procedure:
- Execute the following command to create the
/etc/multipath.confconfiguration file, load the multipath module, and setchkconfigfor themultipathdtoon:mpathconf --enable
# mpathconf --enableCopy to Clipboard Copied! Toggle word wrap Toggle overflow For further information on using thempathconfcommand to set up multipathing, see Section 3.1, “Setting Up DM-Multipath”. - Edit the
blacklistandblacklist_exceptionssections of the/etc/multipath.conffile, as described in Section 4.2, “Configuration File Blacklist”. - To confirm that your configuration file is set up correctly, you can run the
/sbin/multipathcommand with the-v3option to check whether the multipath daemon tried to create a multipath device over your root device. The command will fail since the root the device is in use, but the output from the command should show the root device in the paths list.You should look in the command output for a line of the following format:WWID H:B:T:L devname MAJOR:MINOR
WWID H:B:T:L devname MAJOR:MINORCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example, if your root file system is set up onsdaor one of its partitions, you would see a line in the output such as the following:===== paths list ===== ... 1ATA WDC WD800JD-75MSA3 WD-WMAM9F 1:0:0:0 sda 8:0 ...
===== paths list ===== ... 1ATA WDC WD800JD-75MSA3 WD-WMAM9F 1:0:0:0 sda 8:0 ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow Later in the output, you should see the root device assigned to a multipath device:time | devname: ownership set to mpathdev
time | devname: ownership set to mpathdevCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example, the output may appear as follows:Jun 14 06:48:21 | sda: ownership set to mpatha
Jun 14 06:48:21 | sda: ownership set to mpathaCopy to Clipboard Copied! Toggle word wrap Toggle overflow You will also see an indication that the command failed to create the multipath device with a line of the following format:time | mpathdev: domap (0) failure for create/reload map
time | mpathdev: domap (0) failure for create/reload mapCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the example noted above, you would see the following line in the command output:Jun 14 06:48:21 | mpatha: domap (0) failure for create/reload map
Jun 14 06:48:21 | mpatha: domap (0) failure for create/reload mapCopy to Clipboard Copied! Toggle word wrap Toggle overflow - To rebuild the
initramfsfile system withmultipath, execute thedracutcommand with the following options:dracut --force --add multipath --include /etc/multipath /etc/multipath
# dracut --force --add multipath --include /etc/multipath /etc/multipathCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If your root device is not an LVM volume and it is mounted by device name, you may need to edit the
fstabfile to switch to the appropriate multipath device name. If your root device is an LVM device or is mounted by UUID or something else, this step is not necessary.- Use the procedure described in Step 3 of running the
/sbin/multipathcommand with the-v3to determine the WWID of the root device. - Set up an alias for the root device in the
/etc/multipath.conffile:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
/etc/fstaband 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/sda1 / ext4 defaults 1 1
/dev/sda1 / ext4 defaults 1 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow You would change the entry to the following:/dev/mapper/rootdev / ext4 defaults 1 1
/dev/mapper/rootdev / ext4 defaults 1 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If you need to edit the/etc/fstabfile, you will also need to edit the/etc/grub.conffile and change the root parameter fromroot=/dev/sda1toroot=/dev/mapper/rootdev.The following example shows what thisgrub.conffile entry would look like before you edit it.Copy to Clipboard Copied! Toggle word wrap Toggle overflow The following example shows what thegrub.conffile entry would look like after you edit it.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Shut the machine down.
- Configure the FC switch so that other paths are visible to the machine.
- Boot the machine.
- Check whether the root file system ('/') is on the multipathed device.