blkid output was above. and as I said in my first comment the entry in 
/etc/fstab is wrong.
there is no LABEL=METADATA device.  So 'mount' *should* fail, but I would have 
expected it to exit non-zero.

I noticed just now that '/etc/fstab' has 'nofail' for that line.  I
removed that, and it fails as you show and as expected.   So the issue
here is really just 2 things

a.) the Canonical provided image has a bogus and confusing entry in /etc/fstab
b.) mount really should not exit '0' when explicitly asked to mount something 
even if it has 'nofail'.


heres the info you asked for:


$ mount -l -vvv /var/lib/cloud/seed/config_drive; echo $?
0

$ blkid
/dev/xvda1: LABEL="cloudimg-bootfs" UUID="63ea63a7-f64c-493c-90d4-384adc196be9" 
TYPE="ext3" PARTUUID="3276fc6f-01"
/dev/xvda2: LABEL="cloudimg-rootfs" UUID="82ca1e17-8bc2-4895-96bb-3c39e5863238" 
TYPE="ext4" PARTUUID="3276fc6f-02"
/dev/xvdh: SEC_TYPE="msdos" LABEL="config-2" UUID="9796-932E" TYPE="vfat"
/dev/xvdb1: LABEL="SWAP-xvdb1" UUID="d51fcca0-6b10-4934-a572-f3898dfd8840" 
TYPE="swap" PARTUUID="00025cdb-01"

$ cat /proc/mounts 
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=483664k,nr_inodes=120916,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=101204k,mode=755 0 0
/dev/xvda2 / ext4 rw,relatime,data=ordered 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup 
rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd
 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup 
rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup 
rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/perf_event cgroup 
rw,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs 
rw,relatime,fd=37,pgrp=1,timeout=0,minproto=5,maxproto=5,direct 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
none /proc/xen xenfs rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
/dev/xvda1 /boot ext3 rw,relatime,data=ordered 0 0
lxcfs /var/lib/lxcfs fuse.lxcfs 
rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
tmpfs /run/user/0 tmpfs rw,nosuid,nodev,relatime,size=101204k,mode=700 0 0
/dev/xvdh /mnt vfat 
rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
 0 0

$ ls -altr /dev/disk/by-label/
total 0
drwxr-xr-x 4 root root  80 Dec  5 15:39 ..
drwxr-xr-x 2 root root 120 Dec  5 15:39 .
lrwxrwxrwx 1 root root  10 Dec  5 15:39 config-2 -> ../../xvdh
lrwxrwxrwx 1 root root  11 Dec  5 15:39 cloudimg-bootfs -> ../../xvda1
lrwxrwxrwx 1 root root  11 Dec  5 15:39 SWAP-xvdb1 -> ../../xvdb1
lrwxrwxrwx 1 root root  11 Dec  5 15:40 cloudimg-rootfs -> ../../xvda2


** Changed in: util-linux (Ubuntu)
       Status: New => Confirmed

** Changed in: util-linux (Ubuntu)
   Importance: Undecided => Low

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to util-linux in Ubuntu.
https://bugs.launchpad.net/bugs/1736556

Title:
  mount can exit (success) when it fails

Status in util-linux package in Ubuntu:
  Confirmed

Bug description:
  I'm on softlayer in an official Ubuntu image and 'mount' exits 
  success even when it fails.

  $ cat /etc/cloud/build.info 
  build_name: server
  serial: 20171116

  $ cat /etc/fstab 
  LABEL=cloudimg-rootfs   /        ext4   defaults,relatime       0 0

  # Added by Cloud Image build process
  LABEL=cloudimg-bootfs   /boot   ext3    defaults,relatime    0 0
  # CLOUD_IMG: This file was created/modified by the Cloud Image build process
  # Mount the metadata disk for cloud-init, if present
  LABEL=METADATA /var/lib/cloud/seed/config_drive vfat defaults,nofail 0 0
  LABEL=SWAP-xvdb1        none    swap    sw,comment=cloudconfig  0       2

  $ blkid 
  /dev/xvda1: LABEL="cloudimg-bootfs" 
UUID="63ea63a7-f64c-493c-90d4-384adc196be9" TYPE="ext3" PARTUUID="3276fc6f-01"
  /dev/xvda2: LABEL="cloudimg-rootfs" 
UUID="82ca1e17-8bc2-4895-96bb-3c39e5863238" TYPE="ext4" PARTUUID="3276fc6f-02"
  /dev/xvdh: SEC_TYPE="msdos" LABEL="config-2" UUID="9796-932E" TYPE="vfat"
  /dev/xvdb1: LABEL="SWAP-xvdb1" UUID="d51fcca0-6b10-4934-a572-f3898dfd8840" 
TYPE="swap" PARTUUID="00025cdb-01"

  $ whoami
  root
  $ grep /var/lib/cloud/seed/config_drive /proc/mounts 
  $ mount /var/lib/cloud/seed/config_drive
  $ echo $?
  0

  ## it exited 0 so it should be mounted, but it is not.
  $ ls /var/lib/cloud/seed/config_drive
  $ grep /var/lib/cloud/seed/config_drive /proc/mounts

  
  ## try somewhere else and with /dev/ path. it works.
  $ mount /dev/xvdh /mnt
  $ echo $?
  0
  $ grep /mnt /proc/mounts 
  /dev/xvdh /mnt vfat 
rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
 0 0
  $ find /mnt/
  /mnt/
  /mnt/openstack
  /mnt/openstack/latest
  /mnt/openstack/latest/meta_data.json
  /mnt/openstack/latest/network_data.json
  /mnt/openstack/latest/user_data
  /mnt/openstack/latest/vendor_data.json

  $ journalctl -o short-monotonic --boot --no-pager | pastebinit
  http://paste.ubuntu.com/26119983/

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: mount 2.27.1-6ubuntu3.3
  ProcVersionSignature: Ubuntu 4.4.0-98.121-generic 4.4.90
  Uname: Linux 4.4.0-98-generic x86_64
  ApportVersion: 2.20.1-0ubuntu2.12
  Architecture: amd64
  Date: Tue Dec  5 17:52:14 2017
  ProcEnviron:
   TERM=screen
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: util-linux
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1736556/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to