-
Notifications
You must be signed in to change notification settings - Fork 928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistencies on /dev/disk/by-id/*
when using similar long device names and multipath
#13701
Comments
Please correct me if I am wrong @simondeziel. This seems to be happening because when using a long block device name, the |
@hamistao I dont think there is much we can do about this I'm afraid. |
@tomponline I agree, I don't think we can't fix this without changing |
If this is a limitation of udev there isn't much we can do. |
@hamistao as you described, I think that due the |
/dev/*
when using similar long device names and multipath/dev/disk/by-id/*
when using similar long device names and multipath
I took a look at this, and agree with the findings. The udev rules are shortening the WWID so you see the following:
FWIW, in this scenario, you know what to expect for the prefix. Therefore you can blacklist the WWID with multipath-tools, and avoid removing multipath-tools. Add the following to
And restart multipath-tools
And then you will see your block devices are not multipathd. This will persist across reboots.
|
@hamistao @simondeziel is there anything to do on this issue or can it be closed? |
Let's close this bug as LXD has no real way to workaround this. The operator has to know to use different device prefixes if multipathd is to be used inside the instance. |
Required information
Issue description
When using two block devices with names that share a prefix of 16 characters (after escaping) and also using multipath, the
/dev/disk/by-id/*
symlinks to those devices are identical resulting in a single symlink being created. The second device would now be accessed through/dev/dm-0
and not/dev/sdc
. Although the latter exists, making a filesystem on it fails and returns/dev/sdc is apparently in use by the system; will not make a filesystem here!
. That problem only occurs when multipath-tools is installed and removing it and restarting the VM fixes this.Note that the second device is still usable, but through
/dev/dm-0
. So this may not be critical but it should be worth some discussion to better understand what is happening.Steps to reproduce
lxc launch ubuntu:n vm --vm # Ubuntu images come with multipath-tools installed
longName="long-device-name"
lxc storage volume create default vol1 --type=block
lxc storage volume create default vol2 --type=block
sleep 30
lxc exec vm -- systemctl is-system-running --wait
lxc config device add vm "${longName}1" disk pool=default source=vol1
lxc config device add vm "${longName}2" disk pool=default source=vol2
lxc exec vm -- mkfs.ext4 /dev/sdc # Fails
lxc exec vm -- apt autopurge multipath-tools
lxc restart vm
lxc exec vm -- mkfs.ext4 /dev/sdc # Succeeds
The text was updated successfully, but these errors were encountered: