[arch-general] "os-prober" failed to work with "blkid" (util-linux 2.24-2)

Ken CC ken.ccao at gmail.com
Thu Jan 9 04:11:10 EST 2014


Hi,

It is because the new blkid can now recognize the extened partion,
but os-prober relies on the return value "2" (exit_not_found) of blkid
to skip processing the extended partition.


# fdisk -l
...
Device    Boot     Start       End    Blocks  Id System
/dev/sda1 *           63 252847034 126423486   7 HPFS/NTFS/exFAT
/dev/sda2      252847035 625137344 186145155   5 Extended
/dev/sda5      252847098 253425374    289138+ 83 Linux
/dev/sda6      385254828 482913899  48829536  83 Linux
...


blkid 2.24-2
---
# blkid /dev/sda2
/dev/sda2: PTTYPE="dos" PARTUUID="28b48ca1-02"
# echo $?
0

# blkid -o value -s TYPE /dev/sda2  # no output
# echo $?
0


blkid 2.20.0
---
# blkid /dev/sda2  # no output
# echo $?
2
# blkid -o value -s TYPE /dev/sda2  # no output
# echo $?
2


Affected os-prober code:
---
File: /usr/lib/os-probes/50mounted-tests
-
8   types="$(fs_type "$partition")" || types=NOT-DETECTED
9   if [ "$types" = NOT-DETECTED ]; then
10      debug "$1 type not recognised; skipping"
11      exit 0


With old blkid,
os-prober will just skip here when handling /dev/sda2,
but with the current version of blkid,
os-prober will go on and try to mount /dev/sda2 with
FS types found in the system, which causes lots of errors,
even kernel calltrace when trying xfs, on my machine.



I think there are three ways to sovlve this:

1. change the way that os-prober detects devices.
2. make blkid return an error code when 
# blkid -o value -s TYPE /dev/sdaX
returns no proper result.
3. use the old version of blkid (util-linux).

What do you guys think?


-ken


More information about the arch-general mailing list