This page documents issues with the new feature that allows using multiple CDs or DVDs during an installation. The main purpose of this page is to provide background information to users in the hope that that will help narrow down the real cause of the problem.

Note: on the rest of this page "CD" will be used for both CDs and DVDs.

Introduction

The Sarge version of Debian Installer (D-I) still used base-config which supported scanning of multiple CDs before installing "additional software" during the second stage of the installation of a new system (after the first reboot).

With the Etch version of the installer base-config was replaced by various different D-I components, including:

For Etch, apt-setup only supported using the installation CD and not scanning additional CDs. This regression was accepted because of the general advantages of being able to do the whole installation in a consistent environment without needing to reboot.

For Lenny Beta1, apt-setup has been changed to support scanning multiple CDs again. For this to be possible, changes were needed in various other D-I components, including pkgsel.

After the release of Lenny Beta1 some additional changes have been made to the way D-I uses CDs.

The main problem with supporting multiple CDs is that the installation CD is needed simultaneously in the "D-I environment" and in the "target environment", which basically means that the CD has to be mounted twice.

As a CD can only be changed (ejected) if it is unmounted, some regulation of how/when a CD is used for what was needed.

Internals

This section gives an overview how the installer uses CDs, both now and in the past.

Note that only the use of real CDs that are accessed through either a physical or virtual (in the case of emulators) CD drive is described, not the use of CD images (.iso files) as used with the hd-media installation method.

CD usage in D-I -- Etch

The CD drives are detected early in the installation and if an installation CD is found, it is mounted on /cdrom.

During the installation of the base system (base-installer, the CD is first used by debootstrap using APT's file protocol (i.e: debootstrap does not actually know it's reading a CD; it just uses a directory).

After that base-installer "bind mounts" the CD in the target environment to allow additional packages to be installed. The command used is (using /dev/hdc as example for the CD drive):

mount -o bind /cdrom/ /target/cdrom/

Because the directory is bind mounted, the CD obviously cannot be unmounted and remounted by apt-cdrom in the target environment, so a trick is used to avoid that. Before apt-cdrom is actually run, the configuration of APT in /target/etc/apt/ is changed (for the duration of the installation) in such a way that apt-cdrom does not try to mount or unmount the CD. Essentially it is told to use 'true' as the mount/unmount command, which always succeeds, but does nothing.

With that setup the CD can then simply be scanned by using:

chroot /target apt-cdrom add

But it should now be obvious why CD changing will not work :-)

During apt-setup the installer creates /etc/apt/sources.list from scratch, so the CD will be scanned again, but the situation does not really change.

CD usage in D-I -- Lenny Beta 1

Everything up to and including base-installer remains unchanged, but in apt-setup two different cases are distinguished:

  1. the installation CD is not part of a set
  2. the installation CD is part of a set

In the first case, nothing changes: the installer still works like it did for Etch.

In the second case, the following is done in apt-setup:

There are also changes in pkgsel and when individual packages are installed after this point. Basically we need to make sure that /cdrom is not mounted whenever we run apt or aptitude in the target environment because we do not know beforehand whether APT will need a package that is not on a different CD and having /cdrom mounted would prevent ejecting and changing the CD by the user when APT asks him to.

Each time after APT has been used in the target environment, the installer checks if the installation CD is in the drive. If it is not, it will ask the user to insert it. When the installation CD is detected, it is mounted on /cdrom again.

This is fairly complex, but it does ensure that

Changes after the release of Lenny Beta1

After the release of Beta1, the handling of CDs has been made more consistent by not using the bind mount at all. The use of the CD during debootstrap is not changed, but after that apt-cdrom is allowed to mount and unmount the CD as needed, including single-CD installs and installs that use the netinst CD.

What this means with that, if there are problems with using the CD due to the CD changing support, users will first see them after base-installer for Lenny Beta1, but with images based on current unstable they may first see them during base-installer.

The basic assumption behind this change is that mounting and unmounting the CD in the target environment should be possible regardless of whether or not the CD is also mounted in the D-I environment. It's not possible to eject a CD that's still mounted somewhere, but mounting a CD more once should not be a problem.

The issues

As this is fairly complex new functionality, some initial problems are almost inevitable. It is important to distinguish between the issues seen (and solved) before the release of Beta1 and the current issues.

Before Lenny Beta1

Before Beta1 there was an issue where the CD was remounted in the D-I environment at a time it was not supposed to be mounted, which prevented changing CDs when multiple CDs were being used.

This was the problem behind [http://bugs.debian.org/470423 #470423] and this was solved in time for the release.

Current issues

The issues that have been reported after Beta1 seem to be revolve around the fact that apt-cdrom for some reason fails to recognize or mount the CD in the target environment while it is also mounted in the D-I environment.

There are two cases:

  1. with Beta1 or weekly images: early during pkgsel if a only the first CD (or DVD) of a set is used (i.e. if the user has answered that he does not want to scan any additional CDs) - [http://bugs.debian.org/474346 #474346]

  2. with a daily netinst: during base-installer when the installer first tries to use the CD after debootstrap - [http://bugs.debian.org/476897 #476897] (unconfirmed)

Because of the post-Beta1 changes it is likely that this is actually the same issue.

As the new code works fine for most people, the challenge now is to find out exactly why it fails for some, and fix that. And as we cannot reproduce the problem ourselves we really need the help of the people that can!

Helping to debug the issue

There are some things you can do to help get this issue resolved.

Please start by filing an [http://d-i.alioth.debian.org/manual/en.i386/ch05s03.html#submit-bug installation report] and include both of the following files after running the 'Save debug logs' option in the main menu of the installer:

Next, start a debug shell and check:

When you see the first failure, try the following commands from a debug shell and report the results:

# dmesg -c                        # clear dmesg
# mount                           # list current mounts in D-I environment
# chroot /target mount            # list current mounts in target environment
# chroot /target mount /cdrom     # try mounting the CD manually in target
# chroot /target mount            # did that work?
# chroot /target umount /cdrom    # if it did, unmount again
# dmesg                           # did all this result in any messages?
# chroot /target                  # let's try to do things manually in the chroot
sh-3.1# apt-get install binutils
sh-3.1# exit
#