ISST-LTE: KVM:UBUNTU1804: BostonLC: fdisk -l shows the conflicting partitions name for the mpath

Bug #1784347 reported by bugproxy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Fix Released
Medium
Canonical Foundations Team
util-linux (Ubuntu)
Fix Released
Medium
Mathieu Trudel-Lapierre
Bionic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
Any user of Ubuntu on multipath, where the default path separator has been changed to something else. This possibly affects other scenarios where the partition separator can be changed.

[Test case]
1) Install Ubuntu on multipath system
2) Change /etc/multipath.conf to set "path_separator" to "" or "p".
3) Reboot
4) Run 'sudo fdisk -l /dev/mapper/mpathX', to display a device's partitions where the path separator would be visible.

[Regression potential]
Minimal. This only affects display. Default separator on Ubuntu remains "-part". If the separator is not one of "", "p", or "-part", then "-part" would be used, as is already the case.

== Comment: #0 - Chanh H. Nguyen <email address hidden> - 2018-01-09 11:14:07 ==
We have the Ubuntu1804 installed on our BostonLC system. Create a SAN via the Emulex adapter to have the mpath disk.
Running the fdisk -l and ls -l showing the conflict name for the mpath.

:~# uname -a
Linux boslcp4 4.13.0-17-generic #20-Ubuntu SMP Mon Nov 6 10:03:08 UTC 2017 ppc64le ppc64le ppc64le GNU/Linux
root@boslcp4:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu Bionic Beaver (development branch)"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

:~# fdisk -l /dev/mapper/mpatha
Disk /dev/mapper/mpatha: 600 GiB, 644245094400 bytes, 1258291200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 32768 bytes / 32768 bytes
Disklabel type: dos
Disk identifier: 0xa5be904b

Device Boot Start End Sectors Size Id Type
/dev/mapper/mpatha-part1 2048 419432447 419430400 200G 83 Linux
/dev/mapper/mpatha-part2 419432448 838862847 419430400 200G 83 Linux
/dev/mapper/mpatha-part3 838862848 1258291199 419428352 200G 83 Linux

:~# ls -l /dev/mapper/mpatha*
lrwxrwxrwx 1 root root 7 Jan 9 04:04 /dev/mapper/mpatha -> ../dm-0
lrwxrwxrwx 1 root root 7 Jan 9 04:03 /dev/mapper/mpatha1 -> ../dm-1
lrwxrwxrwx 1 root root 7 Jan 9 04:03 /dev/mapper/mpatha2 -> ../dm-2
lrwxrwxrwx 1 root root 7 Jan 9 04:03 /dev/mapper/mpatha3 -> ../dm-3

== Comment: #2 - Chanh H. Nguyen <email address hidden> - 2018-01-09 11:35:04 ==
I just modify the partitions and it is still showing the conflicting name on partitions.

:~# ls -l /dev/mapper/mpatha*
lrwxrwxrwx 1 root root 7 Jan 9 04:33 /dev/mapper/mpatha -> ../dm-0
lrwxrwxrwx 1 root root 7 Jan 9 04:33 /dev/mapper/mpatha1 -> ../dm-1
lrwxrwxrwx 1 root root 7 Jan 9 04:33 /dev/mapper/mpatha2 -> ../dm-2
lrwxrwxrwx 1 root root 7 Jan 9 04:33 /dev/mapper/mpatha3 -> ../dm-3
lrwxrwxrwx 1 root root 7 Jan 9 04:33 /dev/mapper/mpatha4 -> ../dm-4
lrwxrwxrwx 1 root root 7 Jan 9 04:33 /dev/mapper/mpatha5 -> ../dm-5
lrwxrwxrwx 1 root root 7 Jan 9 04:33 /dev/mapper/mpatha6 -> ../dm-6
lrwxrwxrwx 1 root root 7 Jan 9 04:33 /dev/mapper/mpatha7 -> ../dm-7
lrwxrwxrwx 1 root root 7 Jan 9 04:33 /dev/mapper/mpatha8 -> ../dm-8

:~# fdisk -l /dev/mapper/mpatha
Disk /dev/mapper/mpatha: 600 GiB, 644245094400 bytes, 1258291200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 32768 bytes / 32768 bytes
Disklabel type: dos
Disk identifier: 0xa5be904b

Device Boot Start End Sectors Size Id Type
/dev/mapper/mpatha-part1 2048 419432447 419430400 200G 83 Linux
/dev/mapper/mpatha-part2 419432448 838862847 419430400 200G 83 Linux
/dev/mapper/mpatha-part3 838862848 964691967 125829120 60G 83 Linux
/dev/mapper/mpatha-part4 964691968 1258291199 293599232 140G 5 Extended
/dev/mapper/mpatha-part5 964694016 1006637055 41943040 20G 83 Linux
/dev/mapper/mpatha-part6 1006639104 1048582143 41943040 20G 83 Linux
/dev/mapper/mpatha-part7 1048584192 1090527231 41943040 20G 83 Linux
/dev/mapper/mpatha-part8 1090529280 1132472319 41943040 20G 83 Linux

== Comment: #5 - Kyle Mahlkuch <email address hidden> - 2018-06-26 13:50:12 ==
I have created and submitted a patch that should help with this bug. I will update when/if the patch is accepted.

== Comment: #9 - Kyle Mahlkuch <email address hidden> - 2018-07-27 09:10:44 ==
Here is the patch:
https://github.com/karelzak/util-linux/commit/73775189767195f1d9f5b6b6f6a54e51f61c4356

bugproxy (bugproxy)
tags: added: architecture-ppc64le bugnameltc-163340 severity-high targetmilestone-inin1804
Changed in ubuntu:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
affects: ubuntu → util-linux (Ubuntu)
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Frank Heimes (fheimes)
tags: added: triage-g
tags: added: id-5b5f9c7990f052a107d9963c
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2018-08-08 15:47 EDT-------
Moving to submitted state, waiting for Canonical to pull in the requested patch.

Manoj Iyer (manjo)
Changed in util-linux (Ubuntu):
assignee: Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) → Canonical Foundations Team (canonical-foundations)
Manoj Iyer (manjo)
Changed in util-linux (Ubuntu):
importance: Undecided → High
tags: added: triage-a
removed: triage-g
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-09-18 14:39 EDT-------
Are there any updates from Canonical on including this patch?

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

I'm not convinced that this patch is necessarily what's the right thing to do -- in your examples, you have mpatha1, for instance -- using no sparator at all. In this case, fdisk would still display the device incorrectly.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-10-04 13:56 EDT-------
>156 asprintf(&res, "%.*s%zu", w, dev, partno);
>157 if (access(res, F_OK) == 0){
>158 p = "";

Given the example originally used to open the bug, dev=mpatha, partno=1 and so p is set to "" and that will display "mpatha1". Please correct me if I'm wrong.

Manoj Iyer (manjo)
Changed in ubuntu-power-systems:
importance: High → Medium
Changed in util-linux (Ubuntu):
importance: High → Medium
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Correct, I hadn't noticed that part.

The issue I have with this patch still stands, nothing guarantees that the separator is "", "p", or "-part", but at least we're covering the most likely cases.

I'm sponsoring the patch now, we'll land this as SRU to 18.10 and 18.04.

Changed in util-linux (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → Mathieu Trudel-Lapierre (cyphermox)
status: New → Triaged
Changed in ubuntu-power-systems:
assignee: Canonical Foundations Team (canonical-foundations) → nobody
description: updated
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello bugproxy, or anyone else affected,

Accepted util-linux into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/util-linux/2.31.1-0.4ubuntu3.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in util-linux (Ubuntu Bionic):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package util-linux - 2.32-0.1ubuntu2

---------------
util-linux (2.32-0.1ubuntu2) cosmic; urgency=medium

  * debian/patches/support_alternate_partition_sep.patch: support alternate
    partition separators. Common cases of no separator, using "p" only, and
    "-part" (the only previously supported), are covered now, which should
    let fdisk show partitions in a way closer to reality on most systems.
    Patch from Kyle Mahlkuch, with changes by Karel Zak. (LP: #1784347)

 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 15 Oct 2018 16:25:03 -0400

Changed in util-linux (Ubuntu):
status: Triaged → Fix Released
Changed in ubuntu-power-systems:
status: Triaged → Fix Committed
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2018-10-17 10:12 EDT-------
Thank you for for sponsoring the patch.
I agree that this is not the best fix as there may exist other partition separators but it's the best I could come up with. These were the most common three separators I found so it's at least "better" than the previous code.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Hi Kyle,

Can you help with verifying the that patch works as expected on 18.04?

Thanks!

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-11-13 15:21 EDT-------
This works as expected in 18.04.

Revision history for this message
Sebastien Bacher (seb128) wrote :

the previous comment suggests it should be verification-done-bionic right?

tags: added: verification-done-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Kyle: which version of the package did you use during verification? We want to make sure that the correct -proposed package version has been tested. Could you provide us with apt-cache policy output?

Changed in util-linux (Ubuntu Bionic):
status: Fix Committed → Incomplete
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Please help to validate this SRU.

Changed in ubuntu-power-systems:
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Revision history for this message
Andrew Cloke (andrew-cloke) wrote :

Update: IBM is working on the bionic verification.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-12-11 15:04 EDT-------
I've attached my apt-cache policy output. I enabled bionic-proposed but it looks like the patch has not been applied to the util-linux package.

When I said that the patch worked in Ubuntu 18.04 I had applied the patch to util-linux myself, I didn't use the bionic-proposed package package. Sorry for the confusion.

Revision history for this message
bugproxy (bugproxy) wrote : apt_cache_policy.txt

------- Comment (attachment only) From <email address hidden> 2018-12-11 15:02 EDT-------

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2018-12-11 15:24 EDT-------
It looks like I did the update wrong. I have updated to the correct version and it looks like the patch was applied. Here is some console output showing two different partition separators:

root@ltc-briggs2:~# ls /dev/mapper/mpath*
/dev/mapper/mpatha /dev/mapper/mpatha-part1 /dev/mapper/mpatha-part2 /dev/mapper/mpathb /dev/mapper/mpathbp1

root@ltc-briggs2:~# fdisk -l | grep mpath
Disk /dev/mapper/mpatha: 30 GiB, 32212254720 bytes, 62914560 sectors
/dev/mapper/mpatha-part1 2048 16383 14336 7M PowerPC PReP boot
/dev/mapper/mpatha-part2 16384 62912511 62896128 30G Linux filesystem
Disk /dev/mapper/mpathb: 30 GiB, 32212254720 bytes, 62914560 sectors
/dev/mapper/mpathbp1 2048 62914559 62912512 30G 83 Linux

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-12-11 15:30 EDT-------
Output showing fdisk at v2.31.1-0.4ubuntu3.3:

root@ltc-briggs2:~/kmahlkuch# apt-get upgrade fdisk
Reading package lists... Done
Building dependency tree
Reading state information... Done
fdisk is already the newest version (2.31.1-0.4ubuntu3.3).

Steve Langasek (vorlon)
Changed in util-linux (Ubuntu Bionic):
status: Incomplete → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package util-linux - 2.31.1-0.4ubuntu3.3

---------------
util-linux (2.31.1-0.4ubuntu3.3) bionic; urgency=medium

  * debian/patches/support_alternate_partition_sep.patch: support alternate
    partition separators. Common cases of no separator, using "p" only, and
    "-part" (the only previously supported), are covered now, which should
    let fdisk show partitions in a way closer to reality on most systems.
    Patch from Kyle Mahlkuch, with changes by Karel Zak. (LP: #1784347)

 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 15 Oct 2018 16:29:48 -0400

Changed in util-linux (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for util-linux has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Changed in ubuntu-power-systems:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.