Bug 656419 - blkid sometimes fails to retrieve UUIDs for device mapper devices
Summary: blkid sometimes fails to retrieve UUIDs for device mapper devices
Keywords:
Status: CLOSED DUPLICATE of bug 656453
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: util-linux-ng
Version: 6.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-23 17:18 UTC by Lucas Meneghel Rodrigues
Modified: 2015-10-18 22:41 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-24 14:54:19 UTC
Target Upstream Version:


Attachments (Terms of Use)
blkid log (17.52 KB, text/plain)
2010-11-24 01:44 UTC, Lucas Meneghel Rodrigues
no flags Details

Description Lucas Meneghel Rodrigues 2010-11-23 17:18:58 UTC
Description of problem: blkid sometimes fails to retrieve UUIDs for device mapper devices


Version-Release number of selected component (if applicable): util-linux-ng-2.17.2-6.el6.x86_64


How reproducible: Most of the times, in different devices


Steps to Reproduce:
1. Run blkid in all the device mapper devices. Some of the runs will fail

blkid -s UUID -o value /dev/dm-*

2. Reboot the machine
3. Do the same. There is a high chance now different devices will fail as well.
  
Actual results: Allways return a UUID while using blkid in /dev/dm-*


Expected results: Sometimes it fails


Additional info: If we use the flag -p (ignore cache), then we can get the UUID

blkid -p -s UUID -o value /dev/dm-*

Comment 2 Lucas Meneghel Rodrigues 2010-11-23 18:43:03 UTC
Other important info about my environment:

[root@virtlab105 ~]# dmsetup ls --tree
vg_virtlab105-lv_home (253:3)
 ├─ (8:2)
 └─mpathbp1 (253:1)
    └─mpathb (253:0)
       ├─ (8:32)
       └─ (8:16)
vg_virtlab105-lv_swap (253:4)
 └─ (8:2)
vg_virtlab105-lv_root (253:2)
 └─mpathbp1 (253:1)
    └─mpathb (253:0)
       ├─ (8:32)
       └─ (8:16)

[root@virtlab105 ~]# ls -l /dev/mapper
total 0
crw-rw---- 1 root root 10, 58 Nov 23 11:45 control
lrwxrwxrwx 1 root root      7 Nov 23 11:45 mpathb -> ../dm-0
lrwxrwxrwx 1 root root      7 Nov 23 11:45 mpathbp1 -> ../dm-1
lrwxrwxrwx 1 root root      7 Nov 23 11:45 vg_virtlab105-lv_home -> ../dm-3
lrwxrwxrwx 1 root root      7 Nov 23 11:45 vg_virtlab105-lv_root -> ../dm-2
lrwxrwxrwx 1 root root      7 Nov 23 11:45 vg_virtlab105-lv_swap -> ../dm-4

[root@virtlab105 ~]# blkid
/dev/dm-1: UUID="pt9vo6-x3qR-3fvV-peKY-npAC-e352-wdgLh9" TYPE="LVM2_member" 
/dev/dm-2: UUID="87cae285-94bc-4450-92c7-a8c5fd1ee566" TYPE="ext4" 
/dev/sda1: UUID="9eb9563c-25df-4b31-96c2-e8fb2905c5fb" TYPE="ext4" 
/dev/sda2: UUID="gxOcle-BJLN-XQrl-QznC-6I0T-IpkZ-G0VvWg" TYPE="LVM2_member" 
/dev/mapper/vg_virtlab105-lv_home: UUID="c2822ad2-4b97-4c02-92d8-add7dd4ce875" TYPE="ext4" 
/dev/mapper/vg_virtlab105-lv_swap: UUID="3e0a2c65-d7a6-485e-8e3c-e796a4242c8c" TYPE="swap" 

The machine's partitioning was automatically setup by anaconda, from an older development release of rhel6.

Comment 3 Karel Zak 2010-11-23 19:37:02 UTC
(In reply to comment #0)
> 1. Run blkid in all the device mapper devices. Some of the runs will fail
> blkid -s UUID -o value /dev/dm-*

 Pretty vague information... what exactly does it return? Nothing?

> Actual results: Allways return a UUID while using blkid in /dev/dm-*

The cache evaluates dependencies between devices. It means that not all devices from system have to be visible on blkid output.

Please, try:

 # rm -r /etc/blkid/blkid.tab
 # blkid
 # cat /etc/blkid/blkid.tab

 # for i in $(ls -d /sys/block/dm-*); do echo "$i: $(cat $i/dm/name)"; done

I'd like see output from these commands. Thanks.

Comment 4 Karel Zak 2010-11-23 19:48:30 UTC
I forgot.. try also:

 BLKID_DEBUG=0xffff blkid -s UUID -o value /dev/dm-*

to get more information.

Comment 5 Lucas Meneghel Rodrigues 2010-11-23 19:56:12 UTC
(In reply to comment #3)
> (In reply to comment #0)
> > 1. Run blkid in all the device mapper devices. Some of the runs will fail
> > blkid -s UUID -o value /dev/dm-*
> 
>  Pretty vague information... what exactly does it return? Nothing?

It returns no UUID in console and return code != 0. Example:

$ blkid -s UUID -o value /dev/dm-3
$
$ echo $?
$ 1

(the return code here was invented, my test code caught it was different from 0 anyway)

> > Actual results: Allways return a UUID while using blkid in /dev/dm-*
> 
> The cache evaluates dependencies between devices. It means that not all devices
> from system have to be visible on blkid output.
> 
> Please, try:
> 
>  # rm -r /etc/blkid/blkid.tab
>  # blkid
>  # cat /etc/blkid/blkid.tab
> 
>  # for i in $(ls -d /sys/block/dm-*); do echo "$i: $(cat $i/dm/name)"; done
> 
> I'd like see output from these commands. Thanks.

[root@virtlab105 ~]# rm -r /etc/blkid/blkid.tab
rm: remove regular file `/etc/blkid/blkid.tab'? y

[root@virtlab105 ~]# blkid
/dev/sdb1: UUID="9eb9563c-25df-4b31-96c2-e8fb2905c5fb" TYPE="ext4" 
/dev/sdb2: UUID="gxOcle-BJLN-XQrl-QznC-6I0T-IpkZ-G0VvWg" TYPE="LVM2_member" 
/dev/mapper/mpathbp1: UUID="pt9vo6-x3qR-3fvV-peKY-npAC-e352-wdgLh9" TYPE="LVM2_member" 
/dev/mapper/vg_virtlab105-lv_root: UUID="87cae285-94bc-4450-92c7-a8c5fd1ee566" TYPE="ext4" 
/dev/mapper/vg_virtlab105-lv_home: UUID="c2822ad2-4b97-4c02-92d8-add7dd4ce875" TYPE="ext4" 
/dev/mapper/vg_virtlab105-lv_swap: UUID="3e0a2c65-d7a6-485e-8e3c-e796a4242c8c" TYPE="swap" 

[root@virtlab105 ~]# cat /etc/blkid/blkid.tab
<device DEVNO="0x0811" TIME="1290542157.988957" UUID="9eb9563c-25df-4b31-96c2-e8fb2905c5fb" TYPE="ext4">/dev/sdb1</device>
<device DEVNO="0x0812" TIME="1290542157.989005" UUID="gxOcle-BJLN-XQrl-QznC-6I0T-IpkZ-G0VvWg" TYPE="LVM2_member">/dev/sdb2</device>
<device DEVNO="0xfd01" TIME="1290542157.989273" PRI="40" UUID="pt9vo6-x3qR-3fvV-peKY-npAC-e352-wdgLh9" TYPE="LVM2_member">/dev/mapper/mpathbp1</device>
<device DEVNO="0xfd02" TIME="1290542157.989526" PRI="45" UUID="87cae285-94bc-4450-92c7-a8c5fd1ee566" TYPE="ext4">/dev/mapper/vg_virtlab105-lv_root</device>
<device DEVNO="0xfd03" TIME="1290542157.989801" PRI="45" UUID="c2822ad2-4b97-4c02-92d8-add7dd4ce875" TYPE="ext4">/dev/mapper/vg_virtlab105-lv_home</device>
<device DEVNO="0xfd04" TIME="1290542157.990063" PRI="45" UUID="3e0a2c65-d7a6-485e-8e3c-e796a4242c8c" TYPE="swap">/dev/mapper/vg_virtlab105-lv_swap</device>

[root@virtlab105 ~]# for i in $(ls -d /sys/block/dm-*); do echo "$i: $(cat $i/dm/name)"; done
/sys/block/dm-0: mpathb
/sys/block/dm-1: mpathbp1
/sys/block/dm-2: vg_virtlab105-lv_root
/sys/block/dm-3: vg_virtlab105-lv_home
/sys/block/dm-4: vg_virtlab105-lv_swap

And the debug flag, I tried it and the output is enormous. I am running some tests on the box now, but in the next round I'll make the test code execute the UUIDs with the debug flag set.

Comment 6 Karel Zak 2010-11-23 23:11:15 UTC
It seems that the cache contains all devices, the problem is probably in the way how libblkid works with device names (e.g. dm-3 vs. vg_virtlab105-lv_home).

Please:

  rm -f /etc/blkid/blkid.tab
  blkid
  BLKID_DEBUG=0xffff blkid /dev/dm-3 &> ~/log

and add the log file to BZ as attachment. Thanks.

Comment 7 Lucas Meneghel Rodrigues 2010-11-24 01:42:01 UTC
Other important info about my environment:

[root@virtlab105 ~]# dmsetup ls --tree
vg_virtlab105-lv_home (253:3)
 ├─ (8:2)
 └─mpathbp1 (253:1)
    └─mpathb (253:0)
       ├─ (8:32)
       └─ (8:16)
vg_virtlab105-lv_swap (253:4)
 └─ (8:2)
vg_virtlab105-lv_root (253:2)
 └─mpathbp1 (253:1)
    └─mpathb (253:0)
       ├─ (8:32)
       └─ (8:16)

[root@virtlab105 ~]# ls -l /dev/mapper
total 0
crw-rw---- 1 root root 10, 58 Nov 23 11:45 control
lrwxrwxrwx 1 root root      7 Nov 23 11:45 mpathb -> ../dm-0
lrwxrwxrwx 1 root root      7 Nov 23 11:45 mpathbp1 -> ../dm-1
lrwxrwxrwx 1 root root      7 Nov 23 11:45 vg_virtlab105-lv_home -> ../dm-3
lrwxrwxrwx 1 root root      7 Nov 23 11:45 vg_virtlab105-lv_root -> ../dm-2
lrwxrwxrwx 1 root root      7 Nov 23 11:45 vg_virtlab105-lv_swap -> ../dm-4

[root@virtlab105 ~]# blkid
/dev/dm-1: UUID="pt9vo6-x3qR-3fvV-peKY-npAC-e352-wdgLh9" TYPE="LVM2_member" 
/dev/dm-2: UUID="87cae285-94bc-4450-92c7-a8c5fd1ee566" TYPE="ext4" 
/dev/sda1: UUID="9eb9563c-25df-4b31-96c2-e8fb2905c5fb" TYPE="ext4" 
/dev/sda2: UUID="gxOcle-BJLN-XQrl-QznC-6I0T-IpkZ-G0VvWg" TYPE="LVM2_member" 
/dev/mapper/vg_virtlab105-lv_home: UUID="c2822ad2-4b97-4c02-92d8-add7dd4ce875" TYPE="ext4" 
/dev/mapper/vg_virtlab105-lv_swap: UUID="3e0a2c65-d7a6-485e-8e3c-e796a4242c8c" TYPE="swap" 

The machine's partitioning was automatically setup by anaconda, from an older development release of rhel6.

Comment 8 Lucas Meneghel Rodrigues 2010-11-24 01:43:22 UTC
Ops, my mistake, posted a repeated comment. Anyway, I've got the log you asked, I am attaching it to the bug.

Comment 9 Lucas Meneghel Rodrigues 2010-11-24 01:44:18 UTC
Created attachment 462502 [details]
blkid log

blkid log with full debug turned on

Comment 10 Karel Zak 2010-11-24 10:43:28 UTC
I see

  /dev/dm-3: UUID="3e0a2c65-d7a6-485e-8e3c-e796a4242c8c" TYPE="swap" 

in the log. It works :-)

Is the machine accessible within Red Hat? I'd like to play with that a little.

Comment 11 Lucas Meneghel Rodrigues 2010-11-24 14:06:29 UTC
Posted login details to Karel via IRC.

Comment 12 Karel Zak 2010-11-24 14:54:19 UTC

*** This bug has been marked as a duplicate of bug 656453 ***


Note You need to log in before you can comment on or make changes to this bug.