Bug 102941 - LTC4022-df FileSystem name doesn't match getmntent's mnt_fsname
Summary: LTC4022-df FileSystem name doesn't match getmntent's mnt_fsname
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: anaconda
Version: 2.1
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Michael Fulbright
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-08-22 20:55 UTC by IBM Bug Proxy
Modified: 2007-11-30 22:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-08-22 21:27:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description IBM Bug Proxy 2003-08-22 20:55:07 UTC
The following has be reported by IBM LTC:  
df FileSystem name doesn't match getmntent's mnt_fsname
Please fill in each of the sections below.

Hardware Environment:
Intel 32 bit (doesn't really matter)

Software Environment:
RHAS 2.1 kernel 2.4.19 or RH 8.0, kernel 2.4.19.  glibc 2.2.4-26
But, our program is compiled with the Intel compiler V7


Steps to Reproduce:
1.Do a df -k /myfilesystem
  You will get a file system with a name like "/dev/hdd6"
2.From within a C program,
  while ((m = getmntent(f)) != NULL)
  {
    if (!strcmp(m->mnt_dir, szDrive))
    {
      j += sprintf(sb + j, "\t<name>%s</name>\n", m->mnt_fsname);
    }
  }

  If this is a Redhat system with Anaconda, you will get back a file
  system name in the format "LABEL=/myfs".


Actual Results:
df -k returns /dev/.. format
getmntent's mnt_fsname returns LABEL=/... format



Expected Results:
I would prefer both return the /dev/... format so it is the same user experience
in RedHat and SuSE.  But, I need them to be consistent so we can match up the
results.

 


Additional Information:
I am pretty sure that getmntent is pulling the information from /etc/fstab.
RedHat's Anaconda uses the LABEL=/ format for file systems it sets up.  
I am not sure where df gets its information.

If I can't get a fix, I need a work around.  I need a shell command that
given a mount point, I can get the FileSystem name that is in the LABEL= format

OR

A C library routine like getmntent that will return File System names
like df does.

A workaround needs to work on either SuSE or RH.

And, yes, I believe I could change the values in /etc/fstab so getmntent 
works as expected.  But, we are delivering a product that hopefully will be
used by a lot of people with different levels of experience.  I am NOT
willing to recommend they all change their /etc/fstab.
this is an install (anaconda) / file system issue which I think
should be best addressed by Red Hat.  SuSE does not have this problem.  As
Mary pointed out above, anaconda uses the LABEL= format (instead of /dev/
format) as it sets up file systems in /etc/fstab.  Thanks.

Comment 1 Jeremy Katz 2003-08-22 21:27:04 UTC
getmntent returns exactly what is in the fstab.  We mount by label so that if
your SCSI devices change the order they're in, you can still mount your
filesystems.  You could just as well get UUIDs of the filesystem when calling
getmntent.  Relying on it to return devices is broken.

/proc/mounts will have the actual information on mounted filesystems or you can
look at the code in util-linux/mount/get_label_uuid.c to see how mount
determines the labels.

Comment 2 IBM Bug Proxy 2005-06-14 23:29:24 UTC
changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mranweil.com
             Status|REJECTED                    |CLOSED




------- Additional Comments From mranweil.com  2005-06-14 19:10 EDT -------
Non-duplicate rejected bug that's been rejected for over 6 months.  Marking
closed, you can re-open if needed. 


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