Inconsistent behavior of mount for CDs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: apt-cdrom_bad.strace.gz
Description: GNU Zip compressed data

Attachment: hw-summary_good.txt.gz
Description: GNU Zip compressed data

Attachment: apt-cdrom_good.strace.gz
Description: GNU Zip compressed data

Attachment: hw-summary_bad.txt.gz
Description: GNU Zip compressed data


[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux