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.
Bug 1337409 - Mounting volume read-write under read-only volume mount fails
Summary: Mounting volume read-write under read-only volume mount fails
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-19 07:06 UTC by Jan Pazdziora
Modified: 2019-03-06 01:08 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-03 18:29:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2016-05-19 07:06:20 UTC
Description of problem:

When software wants to generate output in its subdirectory, it might be useful to mount volume for the output read-write, while reading the software itself read-only. Attempt to do that fails.

Version-Release number of selected component (if applicable):

docker-1.9.1-40.el7.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. mkdir -p /tmp/parent-ro /tmp/child-rw
2. docker run -ti -v /tmp/parent-ro:/data:ro -v /tmp/child-rw:/data/_build:Z rhel7 bash

Actual results:

Timestamp: 2016-05-19 03:02:32.120707018 -0400 EDT
Code: System error

Message: mkdir /var/lib/docker/devicemapper/mnt/7279426326d7425f6f2c4c501c9ae43ce25a490a2b1bc11f392a9205fa11992c/rootfs/data/_build: read-only file system

Frames:
---
0: setupRootfs
Package: github.com/opencontainers/runc/libcontainer
File: rootfs_linux.go@40
---
1: Init
Package: github.com/opencontainers/runc/libcontainer.(*linuxStandardInit)
File: standard_init_linux.go@57
---
2: StartInitialization
Package: github.com/opencontainers/runc/libcontainer.(*LinuxFactory)
File: factory_linux.go@242
---
3: initializer
Package: github.com/docker/docker/daemon/execdriver/native
File: init.go@35
---
4: Init
Package: github.com/docker/docker/pkg/reexec
File: reexec.go@26
---
5: main
Package: main
File: docker.go@18
---
6: main
Package: runtime
File: proc.go@63
---
7: goexit
Package: runtime
File: asm_amd64.s@2232
Error response from daemon: Cannot start container 7279426326d7425f6f2c4c501c9ae43ce25a490a2b1bc11f392a9205fa11992c: [8] System error: mkdir /var/lib/docker/devicemapper/mnt/7279426326d7425f6f2c4c501c9ae43ce25a490a2b1bc11f392a9205fa11992c/rootfs/data/_build: read-only file system

Expected results:

Container started, both volumes mounted.

Additional info:

Comment 2 Daniel Walsh 2016-06-03 18:29:12 UTC
1. mkdir -p /tmp/parent-ro /tmp/child-rw
2. docker run -ti -v /tmp/parent-ro:/data:ro -v /tmp/child-rw:/data/_build:Z rhel7 bash

The problem here is docker attempts to create the _build directory under /tmp/parent-ro after it is mounted ro.

1. mkdir -p /tmp/parent-ro/_build /tmp/child-rw


Would fix the problem.

There is no way to fix this since you started with a readonly directory.

Comment 3 Jan Pazdziora 2016-06-07 16:08:04 UTC
You are right, this fixes the problem. Thank you.


Note You need to log in before you can comment on or make changes to this bug.