Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
Systems booted and was appearing to do an fsck but was failing because of the args past in via /etc/fstab
/ partition referenced in /etc/fstab looked like this (note the -e)
[root@seaking ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Fri Jan 7 15:10:37 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
-e/dev/mapper/rootvg-rootlv / ext4 defaults 1 1
UUID=1d960796-c08d-4a0d-926f-3cf3c193ebd2 /boot ext4 defaults 1 2
/dev/mapper/rootvg-tmplv /tmp ext4 defaults 1 2
/dev/mapper/rootvg-varlv /var ext4 defaults 1 2
/dev/mapper/rootvg-crashlv /var/crash ext4 defaults 1 2
/dev/mapper/rootvg-swaplv swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/md0 /data ext4 defaults,nodiratime,noatime,barrier=0 0 0
Notice how mount -a doesn't recognize an issue
[root@seaking ~]# mount -a
[root@seaking ~]#
Now if I add a space after -e an issue is recognized.
[root@seaking ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Fri Jan 7 15:10:37 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
-e /dev/mapper/rootvg-rootlv / ext4 defaults 1 1
UUID=1d960796-c08d-4a0d-926f-3cf3c193ebd2 /boot ext4 defaults 1 2
/dev/mapper/rootvg-tmplv /tmp ext4 defaults 1 2
/dev/mapper/rootvg-varlv /var ext4 defaults 1 2
/dev/mapper/rootvg-crashlv /var/crash ext4 defaults 1 2
/dev/mapper/rootvg-swaplv swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/md0 /data ext4 defaults,nodiratime,noatime,barrier=0 0 0
[root@seaking ~]# mount -a
[mntent]: line 9 in /etc/fstab is bad
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1.
2.
3.
Actual results:
mount -a
echo $? returns 0
Expected results:
mount -a should be able to catch the noted typo above
Additional info:
[root@seaking ~]# for fs in $(awk '!/^#/ {print $1}' /etc/fstab) ; do mount -fv ${fs} >/dev/null || echo ${fs} ; done
mount: invalid option -- 'e'
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
One can change the type of mount containing the directory dir:
mount --make-shared dir
mount --make-slave dir
mount --make-private dir
mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
mount --make-rshared dir
mount --make-rslave dir
mount --make-rprivate dir
mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .
-e/dev/mapper/rootvg-rootlv
mount: according to mtab, /dev/sdb1 is already mounted on /boot
UUID=1d960796-c08d-4a0d-926f-3cf3c193ebd2
mount: according to mtab, /dev/mapper/rootvg-tmplv is already mounted on /tmp
/dev/mapper/rootvg-tmplv
mount: according to mtab, /dev/mapper/rootvg-varlv is already mounted on /var
/dev/mapper/rootvg-varlv
mount: according to mtab, /dev/mapper/rootvg-crashlv is already mounted on /var/crash
/dev/mapper/rootvg-crashlv
mount: according to mtab, /dev/mapper/rootvg-swaplv is already mounted on swap
/dev/mapper/rootvg-swaplv
mount: according to mtab, tmpfs is already mounted on /dev/shm
tmpfs
mount: according to mtab, devpts is already mounted on /dev/pts
devpts
mount: according to mtab, sysfs is already mounted on /sys
sysfs
mount: according to mtab, proc is already mounted on /proc
proc
mount: according to mtab, /dev/md0 is already mounted on /data
/dev/md0
(In reply to Dave Sullivan from comment #0)
> [root@seaking ~]# mount -a
> [mntent]: line 9 in /etc/fstab is bad
...
> Expected results:
> mount -a should be able to catch the noted typo above
What do you mean with "catch"? It reports the malformed line and the line is ignored. What else do you expect?
Maybe the return code should be 64 ("some mounted") rather than zero.
The basic "mount -a" feature is to be optimistic and continue working if possible. It's unwanted to stop when something is wrong with fstab (
Note that in RHEL7 we use systemd instead of "mount -a" and systemd is more pedantic and many users hate it.
The first example with -e/dev/mapper/rootvg-rootlv / ext4 defaults 1 1
It doesn't catch the malformed line and returns 0.
I think it's fine to have it continue just think with above example knowing that fsck will bail on the -e this should be addressed and especially if customers were thinking a mount -a test before reboot would catch any fstab problems.
Wasn't really sure how on boot fstab is addressed relative to mount -a.
Just know we were past grub which had identified the root device, noticed the fs needed fsck and we got some bogus fsck fail error with -e due to the typo. So I know on rhel6 fsck was trying to fsck, and assume some like mount -a reads the whole thing after pivot_root.
Description of problem: Systems booted and was appearing to do an fsck but was failing because of the args past in via /etc/fstab / partition referenced in /etc/fstab looked like this (note the -e) [root@seaking ~]# cat /etc/fstab # # /etc/fstab # Created by anaconda on Fri Jan 7 15:10:37 2011 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # -e/dev/mapper/rootvg-rootlv / ext4 defaults 1 1 UUID=1d960796-c08d-4a0d-926f-3cf3c193ebd2 /boot ext4 defaults 1 2 /dev/mapper/rootvg-tmplv /tmp ext4 defaults 1 2 /dev/mapper/rootvg-varlv /var ext4 defaults 1 2 /dev/mapper/rootvg-crashlv /var/crash ext4 defaults 1 2 /dev/mapper/rootvg-swaplv swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 /dev/md0 /data ext4 defaults,nodiratime,noatime,barrier=0 0 0 Notice how mount -a doesn't recognize an issue [root@seaking ~]# mount -a [root@seaking ~]# Now if I add a space after -e an issue is recognized. [root@seaking ~]# cat /etc/fstab # # /etc/fstab # Created by anaconda on Fri Jan 7 15:10:37 2011 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # -e /dev/mapper/rootvg-rootlv / ext4 defaults 1 1 UUID=1d960796-c08d-4a0d-926f-3cf3c193ebd2 /boot ext4 defaults 1 2 /dev/mapper/rootvg-tmplv /tmp ext4 defaults 1 2 /dev/mapper/rootvg-varlv /var ext4 defaults 1 2 /dev/mapper/rootvg-crashlv /var/crash ext4 defaults 1 2 /dev/mapper/rootvg-swaplv swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 /dev/md0 /data ext4 defaults,nodiratime,noatime,barrier=0 0 0 [root@seaking ~]# mount -a [mntent]: line 9 in /etc/fstab is bad Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: mount -a echo $? returns 0 Expected results: mount -a should be able to catch the noted typo above Additional info: [root@seaking ~]# for fs in $(awk '!/^#/ {print $1}' /etc/fstab) ; do mount -fv ${fs} >/dev/null || echo ${fs} ; done mount: invalid option -- 'e' Usage: mount -V : print version mount -h : print this help mount : list mounted filesystems mount -l : idem, including volume labels So far the informational part. Next the mounting. The command is `mount [-t fstype] something somewhere'. Details found in /etc/fstab may be omitted. mount -a [-t|-O] ... : mount all stuff from /etc/fstab mount device : mount device at the known place mount directory : mount known device here mount -t type dev dir : ordinary mount command Note that one does not really mount a device, one mounts a filesystem (of the given type) found on the device. One can also mount an already visible directory tree elsewhere: mount --bind olddir newdir or move a subtree: mount --move olddir newdir One can change the type of mount containing the directory dir: mount --make-shared dir mount --make-slave dir mount --make-private dir mount --make-unbindable dir One can change the type of all the mounts in a mount subtree containing the directory dir: mount --make-rshared dir mount --make-rslave dir mount --make-rprivate dir mount --make-runbindable dir A device can be given by name, say /dev/hda1 or /dev/cdrom, or by label, using -L label or by uuid, using -U uuid . Other options: [-nfFrsvw] [-o options] [-p passwdfd]. For many more details, say man 8 mount . -e/dev/mapper/rootvg-rootlv mount: according to mtab, /dev/sdb1 is already mounted on /boot UUID=1d960796-c08d-4a0d-926f-3cf3c193ebd2 mount: according to mtab, /dev/mapper/rootvg-tmplv is already mounted on /tmp /dev/mapper/rootvg-tmplv mount: according to mtab, /dev/mapper/rootvg-varlv is already mounted on /var /dev/mapper/rootvg-varlv mount: according to mtab, /dev/mapper/rootvg-crashlv is already mounted on /var/crash /dev/mapper/rootvg-crashlv mount: according to mtab, /dev/mapper/rootvg-swaplv is already mounted on swap /dev/mapper/rootvg-swaplv mount: according to mtab, tmpfs is already mounted on /dev/shm tmpfs mount: according to mtab, devpts is already mounted on /dev/pts devpts mount: according to mtab, sysfs is already mounted on /sys sysfs mount: according to mtab, proc is already mounted on /proc proc mount: according to mtab, /dev/md0 is already mounted on /data /dev/md0