Bug 491175

Summary: mount of tmpfs FSs fail at boot
Product: [Fedora] Fedora Reporter: Tom London <selinux>
Component: util-linux-ngAssignee: Karel Zak <kzak>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: kzak
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: 2009-03-20 13:12:08 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:
Attachments:
Description Flags
/var/log/boot.log from "failing" boot. none

Description Tom London 2009-03-19 17:36:01 UTC
Created attachment 335894 [details]
/var/log/boot.log from "failing" boot.

Description of problem:
After upgrading to util-linux-ng-2.14.2-5.fc11.x86_64, I notice the following in /var/log/boot.log:

Setting up Logical Volume Management:   2 logical volume(s) in volume group "VolGroup00" now active
^[[60G[^[[0;32m  OK  ^[[0;39m]^M
Checking filesystems
F10-Snap2-x86_64: clean, 196403/5627904 files, 17261769/22503424 blocks
/boot: clean, 58/50400 files, 37903/200812 blocks
^[[60G[^[[0;32m  OK  ^[[0;39m]^M
Remounting root filesystem in read-write mode:  ^[[60G[^[[0;32m  OK  ^[[0;39m]^M
Mounting local filesystems:  mount: wrong fs type, bad option, bad superblock on tmpfs,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

mount: wrong fs type, bad option, bad superblock on tmpfs,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so


I attach complete boot.log.

Running "mount" shows tmpfs items not mounted:

[tbl@tlondon ~]$ mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,noatime,nodiratime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda3 on /boot type ext3 (rw,noatime,nodiratime)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /home/tbl/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=tbl)
/dev/sdb1 on /media/E0FD-1813 type vfat (rw,nosuid,nodev,uhelper=devkit,uid=500,gid=500,shortname=lower,dmask=0077)
/dev/sda1 on /media/WinXP type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/dm-3 on /media/extra type ext3 (rw,nosuid,nodev,uhelper=devkit)
[tbl@tlondon ~]$ 

/etc/fstab indicates mounting 2 tmpfs's:

[tbl@tlondon ~]$ cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Fri Oct 17 14:03:24 2008
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or vol_id(8) for more info
#
/dev/VolGroup00/LogVol00 /                       ext3    defaults,noatime,nodiratime        1 1
UUID=27db997b-1bda-4e46-8a89-ae5159412a00 /boot  ext3    defaults,noatime,nodiratime        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
tmpfs                   /tmp                    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/VolGroup00/LogVol01 swap                    swap    defaults        0 0
#LABEL=WinXP             /mnt/winXP              ntfs-3g  defaults       0 0
#LABEL=extra             /mnt/extra              ext3    defaults,noatime,nodiratime       0 0
#/mnt/extra/tbl          /home/tbl/Music/more    none    defaults,bind   0 0
[tbl@tlondon ~]$ 

Not 100% sure this is due to util-linux-ng.  Please redirect .....

Version-Release number of selected component (if applicable):
util-linux-ng-2.14.2-5.fc11.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Tom London 2009-03-19 17:46:43 UTC
A bit more:

Trying "mount -t tmpfs" from a root window fails:

[root@tlondon ~]# mount -t tmpfs tmpfs /ephemeral
mount: wrong fs type, bad option, bad superblock on tmpfs,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

[root@tlondon ~]#

Comment 2 Tom London 2009-03-19 17:58:41 UTC
Reverting to util-linux-ng-2.14.2-4.fc11.x86_64.rpm fixes:

[root@tlondon Download]# rpm -Uvh --oldpackage util-linux-ng-2.14.2-4.fc11.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:util-linux-ng          ########################################### [100%]
[root@tlondon Download]# mount -t tmpfs tmpfs /ephemeral
[root@tlondon Download]#

Comment 3 Tom London 2009-03-19 18:23:18 UTC
The following "works":

[root@tlondon packages]# /bin/mount tmpfs /ephemeral -i -t tmpfs
[root@tlondon packages]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,noatime,nodiratime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda3 on /boot type ext3 (rw,noatime,nodiratime)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /home/tbl/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=tbl)
/dev/sdb1 on /media/E0FD-1813 type vfat (rw,nosuid,nodev,uhelper=devkit,uid=500,gid=500,shortname=lower,dmask=0077)
/dev/sda1 on /media/WinXP type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/dm-3 on /media/extra type ext3 (rw,nosuid,nodev,uhelper=devkit)
tmpfs on /ephemeral type tmpfs (rw)
[root@tlondon packages]# 

Running /sbin/mount.tmpfs with "sh -x":

[root@tlondon packages]# sh -x /sbin/mount.tmpfs tmpfs /srv
+ echo tmpfs /srv
+ grep -q -E '(fs|def|root)?context='
++ ls -Zd /srv
++ cut -f 5 -d ' '
+ con=
+ /bin/mount tmpfs /srv -o 'rootcontext=""' -i -t tmpfs
mount: wrong fs type, bad option, bad superblock on tmpfs,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

+ exit 32
[root@tlondon packages]# 

Should the '-f 5' be '-f 4' to grab the context?

Comment 4 Karel Zak 2009-03-20 08:11:49 UTC
Thanks for your quick response.

> Should the '-f 5' be '-f 4' to grab the context?  

I don't think so, there is one extra space between file mode and file owner in ls(1) output.

Note that the ideal solution is "stat --format='%C'" -- unfortunately the stat(1) util is in the /usr/bin directory.

The problem is probably the condition:

   if con=$(ls -Zd "$2" | cut -f 5 -d ' '); then 

I think better is:

if ! echo "$@" | grep -q -E '(fs|def|root)?context='; then
  con=$(ls --scontext -d "$2" | cut -f 1 -d ' ')
  if [ -n "$con" ] && [ "$con" != "?" ] && [ "$con" != "unlabeled" ]; then
      /bin/mount "$@" -o rootcontext=\"$con\" -i -t tmpfs
      exit $?
  fi
fi

Note, ls(1) returns "?" or "unlabeled" when selinux is off and the directory is not labeled.