From cbc48620de86219cca738b3104de0cec65fa66b6 Mon Sep 17 00:00:00 2001 From: Johan Date: Tue, 7 Mar 2023 15:46:33 +0100 Subject: [PATCH] Update vm-tweaks.sh - Add common devices to multipath blacklist --- BashScripts/vm-tweaks.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/BashScripts/vm-tweaks.sh b/BashScripts/vm-tweaks.sh index 464a242..b84a409 100644 --- a/BashScripts/vm-tweaks.sh +++ b/BashScripts/vm-tweaks.sh @@ -6,12 +6,26 @@ if [[ $EUID -ne 0 ]]; then fi REALUSER=$(logname) +# Add floppy to modprobe blacklist +# https://askubuntu.com/questions/719058/blk-update-request-i-o-error-dev-fd0-sector-0 rmmod floppy > /dev/null 2>&1 && ( echo "Adding floppy to modprobe blacklist" echo "blacklist floppy" | tee /etc/modprobe.d/blacklist-floppy.conf dpkg-reconfigure initramfs-tools ) +# Add common devices to multipath blacklist +# https://askubuntu.com/questions/1242731/ubuntu-20-04-multipath-configuration +if [[ -f "/etc/multipath.conf" ]] && ! grep -q "blacklist" "/etc/multipath.conf"; then + echo Updating /etc/multipath.conf + cat <> "/etc/multipath.conf" +blacklist { + devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st|sda)[0-9]*" +} +EOT + /etc/init.d/multipath-tools restart +fi + # Disable Cloud-init if [ ! -f "/etc/cloud/cloud-init.disabled" ]; then echo "Disabling cloud-init"