Comment 3 for bug 316607

Revision history for this message
Shiv V (svenkata) wrote :

It seems this is due to a change in vol_id (udev package). vol_id (udev: 124-12) used to say "/dev/mapper/swap: unknown volume type" when it failed to find a known filesystem on /dev/mapper/swap. After my latest update, vol_id (udev: 136-4) says "unknown or non-unique volume type (--probe-all lists possibly conflicting types)" without mentioning the device. /lib/cryptsetup/checks/{vol_id,un_vol_id} have not been updated to check for the new vol_id output with the result that code in /lib/cryptsetup/cryptdisks.functions assumes that vol_id has found some valid filesystem when it hasn't.

Instead of hard-coding the vol_id output when no valid filesystem is found, we could determine it at run time by running vol_id on some device or file that is guaranteed to not have any filesystem. Would /dev/null work? I've attached a patch to update vol_id and un_vol_id to use the following:

# vol_id output if $dev has an unknown filesystem
pattern=`echo $dev | sed 's/\//\\\\\//g'`
unknown=`/lib/udev/vol_id -t /dev/null 2>&1 | sed "s/\/dev\/null/$pattern/g"`

if [ "$vol_id" != "$unknown" ] && [ "$vol_id" != "minix" ] && [ -z "$fs" ]; then
...