Bug 492644 - losetup uses hex.
losetup uses hex.
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: util-linux-ng (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Karel Zak
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-27 16:19 EDT by Bill Nottingham
Modified: 2014-03-16 23:18 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-21 13:33:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bill Nottingham 2009-03-27 16:19:19 EDT
Description of problem:

show_loop_fd(int fd, char *device) {
...
                printf("%s: [%04" PRIx64 "]:%" PRIu64 " (%s)",
                       device, loopinfo64.lo_device, loopinfo64.lo_inode,
                       loopinfo64.lo_file_name);
...

Most every place else devices are exported to userspace (/proc/self/mountinfo, ls output, etc.) it's in decimal format.

Version-Release number of selected component (if applicable):

util-linux-ng-2.14.2-4.fc11.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Have losetup /dev/loopX output
2. Have desire to correlate it to entries in /proc/$$/mountinfo
3. Have to do it in shell
  
Actual results:

Aaargh.

(Yes, it's doable, but ... bleah.)
Comment 1 Karel Zak 2009-04-10 06:51:39 EDT
I don't think we can simply change the output format (..because backward compatibility). It would be nice to add something like:

 # losetup -a --columns devname,devno,filename

or

 # losetup -a --format "%(devname) %(devno) %(filename)"


Now you have to be creative:

 # stat -c '%t:%T' $(losetup -a | gawk -v FS=":" '{print $1}')

or:

 # losetup -a | gawk '{ "stat -c %t:%T " gensub("(.*):", "\\1", 1, $1) \
              | getline devno; print $1, devno, $3 }'

 /dev/loop0: 7:0 (/home/images/filesystems/ext2.img)
 /dev/loop1: 7:1 (/home/images/filesystems/vfat.img)

:-)
Comment 2 Bug Zapper 2009-06-09 08:45:12 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 3 Bug Zapper 2010-04-27 09:21:12 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 4 Bug Zapper 2010-07-30 06:37:55 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Karel Zak 2010-10-07 05:43:40 EDT
I'll probably add this functionality to findmnt(1), something like

  findmnt --kernel --evaluate-loop /dev/loop0

will print /proc/self/mountinfo entry, but SOURCE (device name) will be translated to the loop device backing file.
Comment 6 Karel Zak 2012-02-21 13:33:08 EST
I have added this to upstream TODO list.

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