RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 790728 - blkid ignores swap UUIDs if the first byte is a zero byte
Summary: blkid ignores swap UUIDs if the first byte is a zero byte
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: util-linux-ng
Version: 6.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: Branislav Blaškovič
URL:
Whiteboard:
Depends On:
Blocks: 836160 840699
TreeView+ depends on / blocked
 
Reported: 2012-02-15 09:35 UTC by Mohua Li
Modified: 2016-04-08 09:10 UTC (History)
7 users (show)

Fixed In Version: util-linux-ng-2.17.2-12.8.el6
Doc Type: Bug Fix
Doc Text:
Cause: blkid command ignores swap area UUIDs if the first byte is zero Consequence: the swap areas is not possible to address by UUIDs for example from /etc/fstab. Fix: libblkid has been fixed
Clone Of:
Environment:
Last Closed: 2013-02-21 10:22:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0517 0 normal SHIPPED_LIVE Low: util-linux-ng security, bug fix and enhancement update 2013-02-20 21:29:06 UTC

Description Mohua Li 2012-02-15 09:35:20 UTC
Description of problem:

the swap partition failed to be labeled with some uuid value, like uuid value "0019036e-016a-4b2f-86e5-d379137983e1" which generated by uuidgen,  when the uuid is "0019036e-016a-4b2f-86e5-d379137983e1", then get-e2uuid will return a null value for uuid 

Version-Release number of selected component (if applicable):
libguestfs-1.16.5-1.el6

How reproducible:
quite random

Steps to Reproduce:
1.guestfish -xv -N fs  
2.mkswap_U $uuid /dev/vda1
3.blkid /dev/vda1, or get-e2uuid /dev/vda1
4.swapon-uuid $uuid
  
Actual results:
swap can't be labeled with some uuid value generated by uuidgen

Expected results:
swap should be labeled with any valid uuid value

Additional info:


you could find the detail info of fail here,

http://fileshare.englab.nay.redhat.com/pub/logs//45171/default/1808116/debug/libguestfs.lvm-off.nofs.raw.fs_swap.swapon-uuid.DEBUG


scenario1, swap could be labeled with uuid "959b33c2-d7ac-46d6-887d-515dffb0b710
"


><fs> mkswap_U "959b33c2-d7ac-46d6-887d-515dffb0b710" "/dev/vda1"

libguestfs: trace: mkswap_U "959b33c2-d7ac-46d6-887d-515dffb0b710" "/dev/vda1"

libguestfs: send_to_daemon: 100 bytes: 00 00 00 60 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 84 | 00 00 00 00 | ...

guestfsd: main_loop: proc 42 (mkfs) took 0.22 seconds

guestfsd: main_loop: new request, len 0x60

mkswap --help

Usage: mkswap [-c] [-pPAGESZ] [-L label] [-U UUID] /dev/name [blocks]

mkswap -f -U 959b33c2-d7ac-46d6-887d-515dffb0b710 /dev/vda1

libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 84 | 00 00 00 01 | 00 12 34 02 | ...

libguestfs: trace: mkswap_U = 0

><fs> blkid /dev/vda1

libguestfs: trace: blkid "/dev/vda1"

libguestfs: send_to_daemon: 60 bytes: 00 00 00 38 | 20 00 f5 f5 | 00 00 00 04 | 00 00 01 2f | 00 00 00 00 | ...

guestfsd: main_loop: proc 132 (mkswap_U) took 0.01 seconds

guestfsd: main_loop: new request, len 0x38

blkid -p /dev/null

blkid -i

The low-level probing mode requires a device

blkid -c /dev/null -p -i -o export /dev/vda1

libguestfs: recv_from_daemon: 244 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 01 2f | 00 00 00 01 | 00 12 34 03 | ...

libguestfs: trace: blkid = ["UUID", "959b33c2-d7ac-46d6-887d-515dffb0b710", "VERSION", "2", "TYPE", "swap", "USAGE", "other", "MINIMUM_IO_SIZE", "512", "PHYSICAL_SECTOR_SIZE", "512", "LOGICAL_SECTOR_SIZE", "512"]

UUID: 959b33c2-d7ac-46d6-887d-515dffb0b710

VERSION: 2

TYPE: swap

USAGE: other

MINIMUM_IO_SIZE: 512

PHYSICAL_SECTOR_SIZE: 512

LOGICAL_SECTOR_SIZE: 512

><fs> get-e2uuid /dev/vda1

libguestfs: trace: get_e2uuid "/dev/vda1"

libguestfs: send_to_daemon: 60 bytes: 00 00 00 38 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 53 | 00 00 00 00 | ...

guestfsd: main_loop: proc 303 (blkid) took 0.03 seconds

guestfsd: main_loop: new request, len 0x38

blkid -c /dev/null -o value -s UUID /dev/vda1

libguestfs: recv_from_daemon: 80 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 53 | 00 00 00 01 | 00 12 34 04 | ...

libguestfs: trace: get_e2uuid = "959b33c2-d7ac-46d6-887d-515dffb0b710"

959b33c2-d7ac-46d6-887d-515dffb0b710




scenario2, swap can't be labeled with uuid "0019036e-016a-4b2f-86e5-d379137983e1"

><fs> mkswap_U "0019036e-016a-4b2f-86e5-d379137983e1" "/dev/vda1"

libguestfs: trace: mkswap_U "0019036e-016a-4b2f-86e5-d379137983e1" "/dev/vda1"

libguestfs: send_to_daemon: 100 bytes: 00 00 00 60 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 84 | 00 00 00 00 | ...

guestfsd: main_loop: proc 42 (mkfs) took 0.24 seconds

guestfsd: main_loop: new request, len 0x60

mkswap --help

Usage: mkswap [-c] [-pPAGESZ] [-L label] [-U UUID] /dev/name [blocks]

mkswap -f -U 0019036e-016a-4b2f-86e5-d379137983e1 /dev/vda1

libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 84 | 00 00 00 01 | 00 12 34 02 | ...

libguestfs: trace: mkswap_U = 0



><fs> get-e2uuid /dev/vda1

libguestfs: trace: get_e2uuid "/dev/vda1"

libguestfs: send_to_daemon: 60 bytes: 00 00 00 38 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 53 | 00 00 00 00 | ...

guestfsd: main_loop: proc 303 (blkid) took 0.04 seconds

guestfsd: main_loop: new request, len 0x38

blkid -c /dev/null -o value -s UUID /dev/vda1

libguestfs: recv_from_daemon: 44 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 53 | 00 00 00 01 | 00 12 34 04 | ...

libguestfs: trace: get_e2uuid = ""

Comment 1 Qixiang Wan 2012-02-15 09:48:49 UTC
could be reproduced by:

# guestfish -N disk mkswap_U "0019036e-016a-4b2f-86e5-d379137983e2" "/dev/vda" : get-e2uuid "/dev/vda"

it's happen when the UUID begin with '00'.

also I can reproduce this with mkswap tool on host:

# qemu-img create test.img 5G
Formatting 'test.img', fmt=raw size=5368709120 
# mkswap -f -U 0084e9f3-ef57-4da7-bc27-0e48ee8a0c14 test.img
Setting up swapspace version 1, size = 5242876 KiB
no label, UUID=0084e9f3-ef57-4da7-bc27-0e48ee8a0c14
# blkid -c /dev/null -o value -s UUID test.img
# rpm -qf `which mkswap`
util-linux-ng-2.17.2-12.4.el6.x86_64

But not sure whether this is a bug in util-linux-ng.

Comment 2 Richard W.M. Jones 2012-02-15 09:57:22 UTC
This is actually a bug in blkid which was fixed upstream:
http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/4273

Libguestfs just uses mkswap (etc) from util-linux, so updating
or fixing util-linux in RHEL should be sufficient to fix the bug
in libguestfs.

Because of this, I am reassigning the bug to util-linux-ng.

Comment 4 RHEL Program Management 2012-03-01 17:09:56 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 5 Suzanne Logcher 2012-05-18 20:51:46 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 11 errata-xmlrpc 2013-02-21 10:22:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0517.html


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