lkml.org 
[lkml]   [2008]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectInconsistent behavior of mount for CDs
Date
Hi all,

For the Debian Installer we've been struggling with the following issue.

The CD-based installation is running (i386 using 2.6.24) mostly in memory.
The CD is mounted on /cdrom as the installer needs access to the CD.

The system being installed is mounted on /target and it too needs to install
packages from the CD. Up till recently we've been using a bind mount for
this, but there are some reasons we'd like to change that to mounting the
CD itself twice.

For most installs (both in Virtualbox and on real hardware) mounting the
same CD simultaneously on /cdrom and in the /target chroot on /media/cdrom0
works fine, but for some installs the second mount (in the chroot) fails
with an -EBUSY.
The issue is 100% reproducible for installs on the same system, so the
difference seems either hardware or driver related as the installs
themselves are basically identical. Nothing is actually accessing the CD at
the time the second mount is being done.

AFAIK having the same CD mounted twice should normally not be a problem
(just like a hard disk can be mounted twice). The only limitation I'd
expect is that a CD that is still mounted at least once cannot be ejected.

Attached an strace for both a successful and an unsuccessful mount (done
through a 'apt-cdrom add' command executed in /target chroot).
The relevant difference seems to be simply:
-25791 mount("/dev/hdc", "/media/cdrom0", "iso9660", MS_MGC_VAL|MS_NOSUID|
MS_NODEV|MS_NOEXEC, NULL) = -1 EROFS (Read-only file system)
+26735 mount("/dev/hda", "/media/cdrom0", "iso9660", MS_MGC_VAL|MS_NOSUID|
MS_NODEV|MS_NOEXEC, NULL) = -1 EBUSY (Device or resource busy)

The hardware for the 2 straces is quite different (the failing one is real
hardware, the other is Virtualbox), but by chance they use the same IDE
driver for the CD: piix. See also attached hw-summary files.

Any ideas what could be causing this difference in behavior?
What is the intended behavior: should one be able to mount a CD twice or
not?

Cheers,
FJP

[unhandled content-type:application/x-gzip][unhandled content-type:application/x-gzip][unhandled content-type:application/x-gzip][unhandled content-type:application/x-gzip]
\
 
 \ /
  Last update: 2008-04-29 00:11    [W:0.032 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site