mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Inconsistent behavior of mount for CDs
@ 2008-04-28 22:08 Frans Pop
  0 siblings, 0 replies; only message in thread
From: Frans Pop @ 2008-04-28 22:08 UTC (permalink / raw)
  To: linux-ide; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2014 bytes --]

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


[-- Attachment #2: apt-cdrom_bad.strace.gz --]
[-- Type: application/x-gzip, Size: 3309 bytes --]

[-- Attachment #3: hw-summary_good.txt.gz --]
[-- Type: application/x-gzip, Size: 1016 bytes --]

[-- Attachment #4: apt-cdrom_good.strace.gz --]
[-- Type: application/x-gzip, Size: 41593 bytes --]

[-- Attachment #5: hw-summary_bad.txt.gz --]
[-- Type: application/x-gzip, Size: 1672 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-28 22:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-28 22:08 Inconsistent behavior of mount for CDs Frans Pop

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®