ASCII Smiley Face Daniel Dickinson Mini Headshot
The C Shore
Daniel Dickinson's Website - Experimental

NB: The main page content is close to the 2007-2011 version (you can view it with no styles or graphics). There are major technical updates for future work, however.

Debian CD to APT Pool

Abstract: This HOWTO introduces a set of scripts that make it easy to create and maintain and apt pool directory from a set of loop mounted .iso’s (CD images).


1. Introduction

Would you like to mirror debian cd as well as the regular mirror but don’t have the space?

This HOWTO introduces a set of scripts that make it easy to create and maintain pool directory from a set of loop mounted .iso’s (CD images). This makes it more likely that one will have the space to mirror the debian CD’s and a debian mirror at the same time. Updates are easy and take only a little bandwitch because jidgo is used to take the existing pool to build the new iso. In addition, assuming space is at a premium, this script updates the cd’s and removes old ones as it goes instead of building the whole new set and then deleting the old one (or leaving it). If this is not the desired behaviour the scripts can, of course, be modified.

2. The scripts

3. Requirements

You should give any user who will be adding, deleting, or updating the cd-to-pool archive permissions in /etc/sudoers so that they can execute /usr/local/sbin/pool-addcd-to-fstab and /usr/local/sbin/pool-delcd-from-fstab without a password, e.g. by saying

user	host=(root) NOPASSWD: /usr/local/sbin/pool-addcd-to-fstab
user	host=(root) NOPASSWD: /usr/local/sbin/pool-delcd-from-fstab

You need to have enough loopback mounts available. This is done by having a file in /etc/modprobe.d with a line like:

options loop max_loop 255

4. Basic Usage

Assuming the following:

4.1 You have a mirror but no CD images

Try using the following:

mirror-new-cd-set /srv/debcd/i386 /srv/debcd-contents/i386 500 /srv/debian 4 --jigdo-url http://cdimage.debian.org/debian-cd/5.0.0/i386/jigdo-cd/

and when jigdo prompts, leave the scan for files prompt empty, but at the mirror prompt point to your local mirror.

4.2 You have CD images but no mirror

First make sure the pol directory exists, then try:

mirror-new-cd-set /srv/debcd/i386 /srv/debcd-contents/i386 500 /srv/debian 4 --from-iso

4.3 You don’t have a mirror or CD images

Try using the following:

mirror-new-cd-set /srv/debcd /srv/debcd-contents 500 /srv/debian 4 –jigdo-url http://cdimage.debian.org/debian-cd/5.0.0/i386/jigdo-cd/

and when jigdo prompts, leave the scan for files prompt empty, but at the mirror prompt point to your preferred mirror.

5. Updating

Assuming the following:

You should be able to:

mirror-new-cd-set /srv/debcd /srv/debcd-contents 500 /srv/debian 4 --jigdo-url http://cdimage.debian.org/debian-cd/5.0.0/i386/jigdo-cd/ --old-version 4.0_r6

6. Keeping Old Versions

Just don’t specify any –old parameters

7. Multiple architectures

As you may have guessed you need to run the script for each architecture, substituting the chosen architecture for i386 in each case.


Good Luck!

Please note that I can’t do any more work on this, at least for a while, because I have had to eliminate the server that had the debian mirror and pool cd’s

Also note: if you have people mirroring from your mirror via rsync make sure they don’t copy symlinks but instead copy actual files


Author: Daniel F. Dickinson Address: openwrt@thecshore.com Version: 1.0 Date: February 25, 2009 Language: en