Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 2.1 product line. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 102941

Summary: LTC4022-df FileSystem name doesn't match getmntent's mnt_fsname
Product: Red Hat Enterprise Linux 2.1 Reporter: IBM Bug Proxy <bugproxy>
Component: anacondaAssignee: Michael Fulbright <msf>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: high Docs Contact:
Priority: high    
Version: 2.1CC: msw
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-08-22 21:27:04 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:

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.