Strange behaviour with mount --bind
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
The following problem appears with Ubuntu wily 15.10 and xenial 16.04:
I bind-mount my rootfs to a temporary folder. I explicitly use --bind and NOT --rbind. The result is as expected: I only see the files which are in the rootfs, any other mounts are invisible in this directory. But when I mount another directory later, It automatically also gets mounted in my temporary directory.
Example (tested with the Live CD xubuntu-
root@xubuntu:~# mkdir /mnt/source
root@xubuntu:~# mkdir /mnt/target
root@xubuntu:~# mount --bind / /mnt/source
root@xubuntu:~# ls /mnt/source/
root@xubuntu:~# mount -t tmpfs none /mnt/target
root@xubuntu:~# touch /mnt/target/
root@xubuntu:~# ls /mnt/source/
testfile
The testfile in the last line SHOULD NOT APPEAR because /mnt/source/
I don't find an explanation for this behaviour.
I found this because I wanted to run:
tar cpC /mnt/source/ . | tar xpC /mnt/target/
The command began to cyclic copy /mnt/source/
This scenario always worked in the past versions of Ubuntu and Debian
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-
ProcVersionSign
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
CasperVersion: 1.376
Date: Mon Apr 25 08:40:52 2016
IwConfig:
enp0s3 no wireless extensions.
lo no wireless extensions.
LiveMediaBuild: Xubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
Lsusb:
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: innotek GmbH VirtualBox
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcFB:
ProcKernelCmdLine: file=/cdrom/
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
RelatedPackageV
linux-
linux-
linux-firmware 1.157
RfKill:
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 12/01/2006
dmi.bios.vendor: innotek GmbH
dmi.bios.version: VirtualBox
dmi.board.name: VirtualBox
dmi.board.vendor: Oracle Corporation
dmi.board.version: 1.2
dmi.chassis.type: 1
dmi.chassis.vendor: Oracle Corporation
dmi.modalias: dmi:bvninnotekG
dmi.product.name: VirtualBox
dmi.product.
dmi.sys.vendor: innotek GmbH
This change was made by a bot.