]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: Fix multipath partition seperators for user-friendly names
authorKyleMahlkuch <Kyle.Mahlkuch@ibm.com>
Mon, 25 Jun 2018 19:52:01 +0000 (14:52 -0500)
committerKarel Zak <kzak@redhat.com>
Wed, 4 Jul 2018 13:08:00 +0000 (15:08 +0200)
commit73775189767195f1d9f5b6b6f6a54e51f61c4356
treeae7f3a87578190fe3a2c414ef73085b0df51a781
parent810b313688d2727447414098112a9aa73d2f93be
libfdisk: Fix multipath partition seperators for user-friendly names

The current code assumes "-part" is the only partition sepereator
but this is not true for some distros.

For example in Ubuntu 18.04 fdisk does not print the correct names for
mpatha:

~# ls -l /dev/mapper/mpatha*
lrwxrwxrwx 1 root root 7 Feb  1 04:39 /dev/mapper/mpatha -> ../dm-0
lrwxrwxrwx 1 root root 7 Feb  1 04:38 /dev/mapper/mpatha1 -> ../dm-4
lrwxrwxrwx 1 root root 7 Feb  1 04:38 /dev/mapper/mpatha2 -> ../dm-5
lrwxrwxrwx 1 root root 7 Feb  1 04:38 /dev/mapper/mpatha3 -> ../dm-6

~# fdisk -l /dev/mapper/mpatha
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

Instead of assuming a partition seperator of "-part" this patch uses
access to check the file system for a partition seperator of "p" or
the absense of a partition seperator. If neither of these work the patch
defaults to "-part" like we had before this patch.
libfdisk/src/utils.c