mkCDrec Make CD-ROM Recovery

Installation and Getting Started



  • Download the latest mkCDrec_v0.6.5.tar.gz or higher.
  • Become root
  • Extract the archive as following:
    # tar zxvf  mkCDrec_v0.6.5.tar.gz
  • Go into the directory 'mkcdrec'
  • Read the README file, which points to the introduction.html document
  • Check the prerequisites . It is very, very important to check the points mentioned strictly, otherwise you will not be able to boot/mount the CD-ROM afterwards, and make the whole exercise worthless!
    # make test
  • Install the missing executables listed as not found by a 'make test' run. Change also the items listed as bad by the make test run.
  • Edit the file and change (if needed) the following entries:
    • ISOFS_DIR=/tmp/backup
      This directory will be used during build time to collect all the necessary files which will be collected in the CDrec.iso (ISO9660 with Joliet extention) file. If this directory has to contain also the backups of the system make sure it is big enough (is checked too during the build process). It is best to use a disk with at least 800 MB free space.
    • TAPE_DEV=/dev/nst0
      Fill it in if you have a tape device. Use the "no"-rewinding device name! In any other case, do not bother this entry.
      Word of caution: do not trust the GNU mt utility for tape handling. Check with "mt --version"
      Download and install the mt-st utilities from your distribution CD or from
    • SCSI_MODULES="...."
      If the kernel was compiled with SCSI modules you may write them here explicitly. Normally during build time they will get noticed, but on laptops it can happen that there is no SCSI PCMCIA card inserted during the build, and therefore, would not be noticed.
    • OTHER_MODULES="...."
      Add here any other module you think you will need. It does not matter if the build sees it twice.
    • If you want the mkCDrec procedure stores the backups on another disk or on a NFS or CIFS mounted disk make sure you have mounted it properly, otherwise, surprise (disk full). Check with 'df' command.
    • Want to use a (remote) tape device (or another external device) make sure it is online and accesible. Do not forget to insert a tape too.
    • Unmount filesystems you do not want to backup, or add those explicit in the file as excluded, e.g.

Some rules:

"/test" will exclude all items in /test (if /test is a directory) and also /test will NOT exist upon restore if /test is a file, it will only exclude that file
Mostly used for files or mount-points you don't want backup'ed
"/test/*" will exclude all items in the directory /test but /test will be created upon restore
this is what most people want for directories
"/var/log/maillog*" will exlude all /var/log/maillog* files this demonstrates wildcards so you can exclude frequently updated files (most commonly logfiles)

Main menu

  • READY? Type:
    # make
  • You will see a screen which looks alike:
    Main Menu
  • As you can see there are 5 topics to select in the main menu of mkCDrec:
    1 mkCDrec will create a bootable El-Torito based CD-ROM useable as a disaster recovery CD (even better when the mkCDrec utilities were installed too).
    2 mkCDrec creates one or more CD-ROMs (images or write to CD-R(W)s) featuring a bootable disaster recovery linux system including compressed backups of all filesystems mounted (and not excluded) at the time the 'make' was started.
    3 Same as 2, only the backups are not stored on CD-ROM, but on another path, e.g. another (remote NFS/SMB) disk.
    4 Same as 2, only the backups are stored on some (local or remote) tape device.
    5 Quit (by why start it up in the first place then?

First trial

  • Make your choice. Number 1 is very safe for the first time ;-)
    You can watch the progress (if you can follow it t.i.), until it comes back to prompt you with (only when in PROMPT_BOOT_FLOPPY=1):  bootfloppy
  • If you typed "Y" then it will ask you to insert a 1.44 Mb (3.5") floppy into drive A:
    It will format it and copy the boot images to floppy. Keep the floppy with the CD-ROM in case your PC's BIOS cannot boot directly from the El Torito CD-ROM made by mkCDrec.
    Important notice: mkCDrec will save a boot image of the floppy on the CD-ROM too if the size permits it (1.44 or 1.72 Mb) in the directory floppy/ even when the option PROMPT_BOOT_FLOPPY was 0! Noticed this is sometimes very handy!
  • A few moments later the 'make' finishes and you will find in the /tmp directory a file called CDrec.iso which can be transferred with cdrecord to a CDR. Please note that in the file you can change the default location (directory) for writing the CDrec.iso file.
  • The ISO image can be written to a CDR(W) automatically if enabled in For those who have an ISO image and want to transfer to a CDR you can still use the following command anytime (after mkCDrec finishes of course):
    # cdrecord -v -speed=2 dev=1,0,0  CDrec.iso
    The dev=1,0,0 is the result of doing a "cdrecord -scanbus" command 
    Or, enable in BURNCDR=y (and, use 'make test' first to get more information about your Cd-writer).
  • Important to know that above mentioned step of writing to a CDR or CD-RW can be automated by mkCDrec (see BURNCDR=y)
  • Try to boot with the resulting CDR. When you encounter problems with the boot process try to figure out what went wrong by carefully checking where it goes wrong (make notes of it). Afterwards, when rebooted to original linux system inspect the mkcdrec.log file for mistakes if any.
  • In case of errors: check the FAQs, or Sourgeforge forums, or Sourgeforge users mailing list. Probably, your case has already be encountered by others and a solution is maybe provided. Otherwise, you could check mkCDrec' support pages and submit a bug report to Sourceforge.
  • When you are convinced that mkCDrec CD-ROM boots properly it is time to try step 2, 3 or 4 of the make procedure.
  • The ultimate test is the restore from a mkCDrec CD-ROM! Please try it out on a test system before doing this on a production system!!!!
    WARNING: do NOT choose option 2 on a production system if you have never tried it out on a scratch system.  If you do and loose data: do not blame me please, thank you!!!

Backups on CD-ROM (option 2)

Backups are done via GNU tar and compressed afterwards. Before really starting with mkCDrec the user gets a confirmation of what will be backuped. In this stadium it is very easy to inrrupt mkCDrec and mount or umount a local filesystem. 
Please note that mkCDrec will not attempt to backup a NFS/SMB based filsystem.
Main menu option has been selected
After pressing Enter mkCDrec starts making the necessary boot images needed for the CD-ROM and afterwards the backups in compressed format (gzip, bzip2, compress, lzop depending on what the user defined in
If needed, mkCDrec will temporarely interrupt the backup process to create an ISO9660 image after 650 Mb worth of backup. When the image has been created or written to CD-R(W) mkCDrec continues with the backups and create more images if needed. 

Backups on another destination path (option 3)

After selecting option 3 from main menu one sees first the selected filesystems for backup. The user has to accept that by pressing Enter or cancel it by Control-C (see above figure from option 2 to have an idea what kind of screen we're talking about).
After pressing Enter one sees:
Enter other destination path

Please enter a valid destination path - it will not continue otherwise. 
After doing that it will create first a disaster recovery CD-ROM needed to restore the data afterwards as it contains all the information about your system and where the backups are kept. The backups of course are written to the given destination path. Do not delete them, otherwise, you cannot restore them when needed (make sense, but...) 

Backups on (remote) tape device (option 4)

After selecting option 4 from main menu one sees first the selected filesystems for backup. The user has to accept that by pressing Enter or cancel it by Control-C (see above figure from option 2 to have an idea what kind of screen we're talking about).
After pressing Enter one sees:
Enter tape device

The given tape device will be checked on correctness, otherwise one will loop forever in this menu untill a working tape device is given. Please do enter the "norewinding" device name as mkCDrec will not attempt to verify this (until someone delivers a patch of course ;-) 
Once the tape device has been accepted mkCDrec will make a disaster recovery CD-ROM and puts the backups on the tape. 
Unfortunately, multiple volume tape support will probably not work yet.

Using mkCDrec non-interactively (batch mode)

  • make CD-ROM

  • Is the same as option 2 (backups included on CD) 
  • make rescue

  • Is the same as option 1 (disaster recovery CD only) 
  • make path DESTINATION_PATH=/foo

  • Is the same as option 3 (backups on another destination path) 
  • make device

  • Is the same as option 4 (backup on tape)
  • make help

  • gives overview of make options.
Word of caution: before using mkCDrec in batch mode please try it out interactively first with the "make" command (without options). 

Check the ISO9660 image or CD-ROM

When mkCDrec has finished making the disaster recovey CD-ROM it implants a checksum into the ISO9660 image. To check the integrity of the ISO9660 image or CD-ROM use the following command (build in mediacheck/ directory): 

# checkisomd5    CDrec.iso 
# checkisomd5   /dev/cdrom
Read     0 MB
Md5sums match.

The advantage is there is no need to write down the md5 checksum anymore. It is always burned onto the image itself. This technique was first used on RedHat's installation CD-ROMs.
Note: available since mkCDrec v0.6.5

Booted from the mkCDrec CD-ROM

    After booting from CD-ROM (or floppy and CD-ROM) you will be presented with a prompt, type the following two lines to start the recovery procedure:
    # cd  /etc/recovery
    # ./
From this point in time the script will ask for confirmation before really starting to reformat your hard disk(s) and if it cannot find the backups it will refuse to continue until you corrected the situation at shell level.
  • The CD-ROM should contain enough tools (a normal fdisk is also included) to get it going
    Check the network connections when you try to restore from NFS mounted disks. And, it is better to mount those disks in advance before starting the script.
    You will find plenty of information in /etc/recovery directory.
    Note: script can only restore backups to disks of the same (or bigger) size as the original disk. Do not despare: script can restore to smaller disks (but only one disk at a time).
    Note2: is also capable to restore from scratch a Software RAID and LVM based filesystem, albeit from scratch, meaning from scratch!
  • To clone a disk to another system use the command:
    # cd  /etc/recovery
    # ./
    The cloning script will prompt for the source disk and after scanning the current system for all the possible disk devices it will prompt for the target disk. From that point on the restore is fully automatic and equal to
  • Restore a single file system to a new disk is also possible with script. As an add-on a different target file system type can be specified.
IT3 Support needed?
   Support mkCDrec    IT3 Consultants    Valid XHTML 1.0 Transitional SourceForge