Categories
SysOps

How to fix multipath daemon error about missing path when using VirtualBox

Fix multipath daemon error about missing path when using VirtualBox.

Identify the issue by reading the syslog log file.

$ sudo tail -f /var/log/syslog
Jan  2 23:36:42 ubuntu-focal multipathd[524]: sdc: failed to get sysfs uid: No data available
Jan  2 23:36:42 ubuntu-focal multipathd[524]: sdc: failed to get sgio uid: No data available
Jan  2 23:36:44 ubuntu-focal multipathd[524]: sda: add missing path
Jan  2 23:36:44 ubuntu-focal multipathd[524]: sda: failed to get udev uid: Invalid argument
Jan  2 23:36:44 ubuntu-focal multipathd[524]: sda: failed to get sysfs uid: No data available
Jan  2 23:36:44 ubuntu-focal multipathd[524]: sda: failed to get sgio uid: No data available
Jan  2 23:36:45 ubuntu-focal multipathd[524]: sdd: add missing path
Jan  2 23:36:45 ubuntu-focal multipathd[524]: sdd: failed to get udev uid: Invalid argument
Jan  2 23:36:45 ubuntu-focal multipathd[524]: sdd: failed to get sysfs uid: No data available
Jan  2 23:36:45 ubuntu-focal multipathd[524]: sdd: failed to get sgio uid: No data available

It looks like multipath daemon cannot determine a unique path identifier (WWID).

List disk class of hardware.

$ sudo lshw -class disk
  *-disk:0                  
       description: SCSI Disk
       product: HARDDISK
       vendor: VBOX
       physical id: 0.0.0
       bus info: scsi@2:0.0.0
       logical name: /dev/sda
       version: 1.0
       size: 40GiB (42GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=ce8ff640
  *-disk:1
       description: SCSI Disk
       product: HARDDISK
       vendor: VBOX
       physical id: 0.1.0
       bus info: scsi@2:0.1.0
       logical name: /dev/sdb
       version: 1.0
       size: 10MiB (10MB)
       configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512
  *-disk:2
       description: SCSI Disk
       product: HARDDISK
       vendor: VBOX
       physical id: 0.3.0
       bus info: scsi@2:0.3.0
       logical name: /dev/sdc
       version: 1.0
       size: 8GiB (8589MB)
       configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512
  *-disk:3
       description: SCSI Disk
       product: HARDDISK
       vendor: VBOX
       physical id: 0.4.0
       bus info: scsi@2:0.4.0
       logical name: /dev/sdd
       version: 1.0
       size: 8GiB (8589MB)
       configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512

Blacklist these devices in multipath daemon configuration file.

$ cat <<EOF | sudo tee -a /etc/multipath.conf
blacklist {
  device {
    vendor "VBOX"
    product "HARDDISK"
  }
}
EOF

Inspect multipath daemon configuration file.

$ cat /etc/multipath.conf 
defaults {
    user_friendly_names yes
}
blacklist {
  device {
    vendor "VBOX"
    product "HARDDISK"
  }
}

Restart multipath daemon.

$ sudo systemctl restart multipathd.service

Inspect blacklist.

$ sudo multipathd show blacklist
device node rules:
- blacklist:
        (default rule)     ^(ram|zram|raw|loop|fd|md|dm-|sr|scd|st|dcssblk)[0-9]
        (default rule)     ^(td|hd|vd)[a-z]
        (default rule)     ^cciss!c[0-9]d[0-9]*
- exceptions:
        <empty>
udev property rules:
- blacklist:
        <empty>
- exceptions:
        (default rule)     (SCSI_IDENT_|ID_WWN)
protocol rules:
- blacklist:
        <empty>
- exceptions:
        <empty>
wwid rules:
- blacklist:
        <empty>
- exceptions:
        <empty>
device rules:
- blacklist:
        (config file rule) VBOX:HARDDISK
        (default rule)     SGI:Universal Xport
        (default rule)     ^DGC:LUNZ
        (default rule)     EMC:LUNZ
        (default rule)     DELL:Universal Xport
        (default rule)     IBM:Universal Xport
        (default rule)     IBM:S/390
        (default rule)     LENOVO:Universal Xport
        (default rule)     (NETAPP|LSI|ENGENIO):Universal Xport
        (default rule)     STK:Universal Xport
        (default rule)     SUN:Universal Xport
        (default rule)     (Intel|INTEL):VTrak V-LUN
        (default rule)     Promise:VTrak V-LUN
        (default rule)     Promise:Vess V-LUN
- exceptions:
        <empty>

Inspect the syslog log file.

$ sudo tail -f /var/log/syslog 
Jan  3 00:00:50 ubuntu-focal multipathd[524]: sdc: add missing path
Jan  3 00:00:50 ubuntu-focal multipathd[524]: sdc: failed to get udev uid: Invalid argument
Jan  3 00:00:50 ubuntu-focal multipathd[524]: sdc: failed to get sysfs uid: No data available
Jan  3 00:00:50 ubuntu-focal multipathd[524]: sdc: failed to get sgio uid: No data available
Jan  3 00:00:52 ubuntu-focal multipathd[524]: sda: add missing path
Jan  3 00:00:52 ubuntu-focal multipathd[524]: sda: failed to get udev uid: Invalid argument
Jan  3 00:00:52 ubuntu-focal multipathd[524]: sda: failed to get sysfs uid: No data available
Jan  3 00:00:52 ubuntu-focal multipathd[524]: sda: failed to get sgio uid: No data available
Jan  3 00:00:53 ubuntu-focal multipathd[524]: sdd: add missing path
Jan  3 00:00:53 ubuntu-focal multipathd[524]: sdd: failed to get udev uid: Invalid argument
Jan  3 00:00:53 ubuntu-focal multipathd[524]: sdd: failed to get sysfs uid: No data available
Jan  3 00:00:53 ubuntu-focal multipathd[524]: sdd: failed to get sgio uid: No data available
Jan  3 00:00:54 ubuntu-focal multipathd[524]: sdb: add missing path
Jan  3 00:00:54 ubuntu-focal multipathd[524]: sdb: failed to get udev uid: Invalid argument
Jan  3 00:00:54 ubuntu-focal multipathd[524]: sdb: failed to get sysfs uid: No data available
Jan  3 00:00:54 ubuntu-focal multipathd[524]: sdb: failed to get sgio uid: No data available
Jan  3 00:00:54 ubuntu-focal multipathd[524]: exit (signal)
Jan  3 00:00:54 ubuntu-focal multipathd[524]: --------shut down-------
Jan  3 00:00:54 ubuntu-focal systemd[1]: Stopping Device-Mapper Multipath Device Controller...
Jan  3 00:00:54 ubuntu-focal systemd[1]: multipathd.service: Succeeded.
Jan  3 00:00:54 ubuntu-focal systemd[1]: Stopped Device-Mapper Multipath Device Controller.
Jan  3 00:00:54 ubuntu-focal systemd[1]: Starting Device-Mapper Multipath Device Controller...
Jan  3 00:00:54 ubuntu-focal multipathd[9369]: --------start up--------
Jan  3 00:00:54 ubuntu-focal multipathd[9369]: read /etc/multipath.conf
Jan  3 00:00:54 ubuntu-focal multipathd[9369]: path checkers start up
Jan  3 00:00:54 ubuntu-focal systemd[1]: Started Device-Mapper Multipath Device Controller.

Alternatively, you can blacklist every sd device.

blacklist {
  devnode "^sd[a-z]"
}

In case you do not plan to use multipath, then simply remove it.

$ sudo apt remove multipath-tools