Bug 627833

Summary: get-e2uuid should use blkid instead of "tune2fs -l" to get filesystem UUID
Product: Red Hat Enterprise Linux 6 Reporter: Jinxin Zheng <jzheng>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: dallan, mbooth, mshao, virt-maint, yuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libguestfs-1.7.17-4.el6 Doc Type: Bug Fix
Doc Text:
The get-e2uuid command retrieved file system UUIDs via "tune2fs -l". This failed on journaling block devices (JBDs) and other devices that were not second, third or fourth extended file systems (ext2, ext3 or ext4). get-e2uuid has been reimplemented so that it retrieves UUIDs via "blkid" instead of "tune2fs -l", resolving this issue. However, since the get-e2uuid command has been deprecated, customers should retrieve UUIDs with the vfs-uuid command instead.
Story Points: ---
Clone Of: 597112 Environment:
Last Closed: 2011-05-19 11:44:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 597112, 613593    
Bug Blocks:    

Description Jinxin Zheng 2010-08-27 05:16:02 UTC
Clone to RHEL 6 to ensure it will get fixed in 6.1.

+++ This bug was initially created as a clone of Bug #597112 +++

Description of problem:
Currently, get-e2uuid gets filesystem UUID via "tune2fs -l". However, this doesn't work for JBD(journaling block device): whenever you try to get uuid of a JBD, you get a error that tells "Filesystem has unsupported feature(s)". In another way, UUID could be gotten via blkid, for both JBD or filesystems such as ext2/3/4. So it would be better to replace "tune2fs -l" with "blkid" in the implementation of get-e2uuid. 

Version-Release number of selected component (if applicable):
><fs> version 
major: 1
minor: 2
release: 7
extra: 


How reproducible:
Always

Steps to Reproduce:
1. ><fs> mke2journal 1024 /dev/VG/jounal
2. ><fs> get-e2uuid /dev/VG/jounal
libguestfs: error: get_e2uuid: tune2fs: Filesystem has unsupported feature(s) while trying to open /dev/VG/jounal
Couldn't find valid filesystem superblock.

3.
  
Actual results:


Expected results:
get-e2uuid should return UUID successfully for JBD

Additional info:

--- Additional comment from rjones on 2010-06-01 10:39:07 EDT ---

Patches posted upstream:
https://www.redhat.com/archives/libguestfs/2010-June/msg00006.html

--- Additional comment from rjones on 2010-06-02 17:32:50 EDT ---

This patch has been pushed upstream.

If this needs to be fixed for RHEL 5 / 6, please clone
this bug and adjust the Product accordingly.

Comment 1 Richard W.M. Jones 2010-10-16 13:32:29 UTC
Bump version to 6.1.  This will be fixed if we rebase
(bug 613593).

Comment 2 Richard W.M. Jones 2011-01-04 14:17:01 UTC
Fixed by the rebase.

In this case note that get-e2uuid is now deprecated, and
callers can use vfs-uuid instead (which uses blkid and
works for any filesystem type).

Comment 4 Yufang Zhang 2011-02-15 03:09:39 UTC
QA verified this bug with libguestfs-1.7.17-12.el6.x86_64 and
guestfish-1.7.17-12.el6.x86_64:

><fs> mke2journal 1024 /dev/vdb
><fs> get-e2uuid /dev/vdb
aebff5f2-f809-40ce-931f-d6a939695255

So change this bug to VERIFIED.

Comment 7 Laura Bailey 2011-04-19 01:51:16 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The get-e2uuid command retrieved file system UUIDs via "tune2fs -l". This failed on journaling block devices (JBDs) and other devices that were not second, third or fourth extended file systems (ext2, ext3 or ext4). get-e2uuid has been reimplemented so that it retrieves UUIDs via "blkid" instead of "tune2fs -l", resolving this issue. However, since the get-e2uuid command has been deprecated, customers should retrieve UUIDs with the vfs-uuid command instead.

Comment 8 Richard W.M. Jones 2011-04-19 07:39:56 UTC
This is OK, thanks.

Comment 9 errata-xmlrpc 2011-05-19 11:44:24 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0586.html

Comment 10 errata-xmlrpc 2011-05-19 13:10:30 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0586.html