mount can exit 0 (success) when it fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
util-linux (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
I'm on softlayer in an official Ubuntu image and 'mount' exits
success even when it fails.
$ cat /etc/cloud/
build_name: server
serial: 20171116
$ cat /etc/fstab
LABEL=cloudimg-
# Added by Cloud Image build process
LABEL=cloudimg-
# 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/
LABEL=SWAP-xvdb1 none swap sw,comment=
$ blkid
/dev/xvda1: LABEL="
/dev/xvda2: LABEL="
/dev/xvdh: SEC_TYPE="msdos" LABEL="config-2" UUID="9796-932E" TYPE="vfat"
/dev/xvdb1: LABEL="SWAP-xvdb1" UUID="d51fcca0-
$ whoami
root
$ grep /var/lib/
$ mount /var/lib/
$ echo $?
0
## it exited 0 so it should be mounted, but it is not.
$ ls /var/lib/
$ grep /var/lib/
## 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,
$ find /mnt/
/mnt/
/mnt/openstack
/mnt/openstack/
/mnt/openstack/
/mnt/openstack/
/mnt/openstack/
/mnt/openstack/
$ journalctl -o short-monotonic --boot --no-pager | pastebinit
http://
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: mount 2.27.1-6ubuntu3.3
ProcVersionSign
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_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: util-linux
UpgradeStatus: No upgrade log present (probably fresh install)
summary: |
- mount can exit (success) when it fails + mount can exit 0 (success) when it fails |
I didn't notice initially but just did. The entry in /etc/fstab is bogus, containing a LABEL=METADATA but the disk here is LABEL=config-v2.
That is clearly broken, but 'mount' should not exit success.