31
mkCDrec Howto Inhoudsopgave 1. Introduction ............................................................................................................................... 2 1.1. Copyright ....................................................................................................................... 2 1.2. Installing mkCDrec .......................................................................................................... 2 1.3. Make test ........................................................................................................................ 3 1.4. The Configuration file – Config.sh ...................................................................................... 4 2. Make the Disaster Recovery CD-ROM ........................................................................................... 4 2.1. Rescue CD-ROM only (no backups) .................................................................................... 4 2.2. Into /tmp/backup (to burn on CDROM) ................................................................................ 4 2.3. Enter another path (spare disk or NFS) ................................................................................. 5 2.4. Enter (remote) tape device ................................................................................................. 5 2.5. Quit ............................................................................................................................... 5 2.6. Encrypting the backups ..................................................................................................... 5 2.7. Backups without encryptions .............................................................................................. 5 2.8. During the backups ........................................................................................................... 6 3. Booting from a mkCDrec CD-ROM ............................................................................................. 11 3.1. x86 and x86_64 platforms ................................................................................................ 11 3.2. IA64 (itanium) architecture .............................................................................................. 13 4. Restoring with start-restore.sh ..................................................................................................... 13 4.1. Interactive restore ........................................................................................................... 13 4.2. Automatic Disaster Recovery ............................................................................................ 16 5. Cloning with clone-dsk.sh .......................................................................................................... 17 6. Restoring a single file system with restore-fs.sh .............................................................................. 19 7. Restoring with HP Openview Storage Data Protector ....................................................................... 21 7.1. Integrating HP OpenView Storage Data Protector and mkCDrec .............................................. 21 7.2. Restore with Data Protector .............................................................................................. 21 8. Other uses of mkCDrec .............................................................................................................. 23 8.1. Restore user-mode Linux (UML) ....................................................................................... 23 8.2. Superrescue CD-ROM ..................................................................................................... 24 8.3. MkCDrec Menu (Alt-F5) ................................................................................................. 24 8.4. One-Button Disaster Recovery .......................................................................................... 25 8.5. MkCDrec and PXE Booting ............................................................................................. 25 9. Know Issues ............................................................................................................................. 25 9.1. Secure Shell .................................................................................................................. 25 10. GNU Free Documentation License ............................................................................................. 26 10.1. PREAMBLE ................................................................................................................ 26 10.2. APPLICABILITY AND DEFINITIONS ........................................................................... 26 10.3. VERBATIM COPYING ................................................................................................. 27 10.4. COPYING IN QUANTITY ............................................................................................ 27 10.5. MODIFICATIONS ........................................................................................................ 28 10.6. COMBINING DOCUMENTS ......................................................................................... 29 10.7. COLLECTIONS OF DOCUMENTS ................................................................................ 29 10.8. AGGREGATION WITH INDEPENDENT WORKS ............................................................ 29 10.9. TRANSLATION ........................................................................................................... 30 10.10. TERMINATION ......................................................................................................... 30 10.11. FUTURE REVISIONS OF THIS LICENSE ..................................................................... 30 10.12. ADDENDUM: How to use this License for your documents ................................................ 30 11. Acknowledgements .................................................................................................................. 31 Document History: Version 1.0: 10 April 2003 – initial release 1 XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

MkCDrec Howto v13

Embed Size (px)

Citation preview

Page 1: MkCDrec Howto v13

mkCDrec Howto

Inhoudsopgave1. Introduction ............................................................................................................................... 2

1.1. Copyright ....................................................................................................................... 21.2. Installing mkCDrec .......................................................................................................... 21.3. Make test ........................................................................................................................ 31.4. The Configuration file – Config.sh ...................................................................................... 4

2. Make the Disaster Recovery CD-ROM ........................................................................................... 42.1. Rescue CD-ROM only (no backups) .................................................................................... 42.2. Into /tmp/backup (to burn on CDROM) ................................................................................ 42.3. Enter another path (spare disk or NFS) ................................................................................. 52.4. Enter (remote) tape device ................................................................................................. 52.5. Quit ............................................................................................................................... 52.6. Encrypting the backups ..................................................................................................... 52.7. Backups without encryptions .............................................................................................. 52.8. During the backups ........................................................................................................... 6

3. Booting from a mkCDrec CD-ROM ............................................................................................. 113.1. x86 and x86_64 platforms ................................................................................................ 113.2. IA64 (itanium) architecture .............................................................................................. 13

4. Restoring with start-restore.sh ..................................................................................................... 134.1. Interactive restore ........................................................................................................... 134.2. Automatic Disaster Recovery ............................................................................................ 16

5. Cloning with clone-dsk.sh .......................................................................................................... 176. Restoring a single file system with restore-fs.sh .............................................................................. 197. Restoring with HP Openview Storage Data Protector ....................................................................... 21

7.1. Integrating HP OpenView Storage Data Protector and mkCDrec .............................................. 217.2. Restore with Data Protector .............................................................................................. 21

8. Other uses of mkCDrec .............................................................................................................. 238.1. Restore user-mode Linux (UML) ....................................................................................... 238.2. Superrescue CD-ROM ..................................................................................................... 248.3. MkCDrec Menu (Alt-F5) ................................................................................................. 248.4. One-Button Disaster Recovery .......................................................................................... 258.5. MkCDrec and PXE Booting ............................................................................................. 25

9. Know Issues ............................................................................................................................. 259.1. Secure Shell .................................................................................................................. 25

10. GNU Free Documentation License ............................................................................................. 2610.1. PREAMBLE ................................................................................................................ 2610.2. APPLICABILITY AND DEFINITIONS ........................................................................... 2610.3. VERBATIM COPYING ................................................................................................. 2710.4. COPYING IN QUANTITY ............................................................................................ 2710.5. MODIFICATIONS ........................................................................................................ 2810.6. COMBINING DOCUMENTS ......................................................................................... 2910.7. COLLECTIONS OF DOCUMENTS ................................................................................ 2910.8. AGGREGATION WITH INDEPENDENT WORKS ............................................................ 2910.9. TRANSLATION ........................................................................................................... 3010.10. TERMINATION ......................................................................................................... 3010.11. FUTURE REVISIONS OF THIS LICENSE ..................................................................... 3010.12. ADDENDUM: How to use this License for your documents ................................................ 30

11. Acknowledgements .................................................................................................................. 31

Document History:

Version 1.0: 10 April 2003 – initial release

1

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 2: MkCDrec Howto v13

Version 1.1: 29 August 2003 – apply the GNU Free Documentation License

Version 1.2: September 2004 – review and update document

Version 1.3: March-May 2006 – added HP OV DP section - EFI - converted from word intoXML

E-mail: gdha at users.sourceforge.net

1. IntroductionWe all make backups, right?

Of course we do! This is the basic need for data recovery. Unfortunately hard disks die too fast and too often thesedays including boot disks. Therefore, having backups is not enough. We changed so many configuration files ofthe operating system that we certainly forget to restore some of them and at the time we need them the backup hasbeen expired. Therefore, wouldn’t it be nice to have to same system back as before the disk died?

That’s where mkCDrec comes in…

Make CD-ROM recovery (mkCDrec) makes a bootable (El-Torito) disaster recovery image (CDrec.iso), includingbackups of the GNU/Linux system to the same CD-ROM (or CD-RW) if space permits, or to a multi-volume CD-ROM set. Otherwise, the backups can be stored on another local disk, NFS disk or (remote) tape.

However, a CD-ROM made with mkCDrec can easily be used as a rescue CD-ROM too. Especially, when youhave installed the mkCDrec Utilities aside mkCDrec.

Currently, mkCDrec is working on Linux platform x86 (IA32), IA64, Sparc and PPC only.

Hopefully mkCDrec fills a gap in Open Source projects covering disaster recovery with full backups and withplenty of rescue tools standard delivered.

The reason of this howto is mainly to provide a written guidance for the end-user, as most people prefer to havea piece of paper in front of them instead of staring at the web pages.

1.1. Copyright

MkCDrec is an Open Source project that follows the GNU General Public License (GPL) as published by the FreeSoftware Foundation; either version 2 of the License, or any later version. The full text can be found athttp://www.gnu.org/copyleft/gpl.html

1.2. Installing mkCDrec

The latest mkCDrec sources (and RPMs) can be downloaded from http://mkcdrec.ota.be/ or from SourceForge’swebsite http://sourceforge.net/project/showfiles.php?group_id=25327

Once downloaded the sources, e.g. mkCDrec_v0.8.9.tar.gz you can extract it into any directory of your choice.It really does not matter where you install it as long as you have the root password!

Indeed, it makes no sense to download and try mkCDrec you do not know the root password.

It is also possible to download the binary Intel x86 RPM (and/or source RPM) which should work on many Linuxdistributions such as RedHat, Mandriva and SuSe.

The default installation directory for the binary RPM version is /var/opt/mkcdrec.

2

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 3: MkCDrec Howto v13

To install a RPM based version of mkCDrec use the command “rpm –i” for a first time install or “rpm –U” toupgrade an older version. To remove a RPM based mkcdrec version use the command “rpm –e”.

The binaries for Debian is also available for download and use the command “dpkg -i” to install it.

While you are busy make some extra time to download the mkCDrec Utilities too (available from the same website) into mkcdrec/ directory:

A rule of dumb with the mkCDrec utilities is to install the highest available version. mkCDrec Utilities is not amust, but do contain some nice tools.

1.3. Make test

A small note before starting using mkCDrec is that the “make” command is needed on your GNU/Linux system.Check this with “which make” which should return the location of the executable. If not, then you have to installthe make rpm from your distribution.

On Debian systems do “apt-get update; apt-get install make”.

After unpacking mkCDrec run “make test” to check whether your system fulfill the requirements to create abootable El-Torito CD-ROM.

If mkCDrec notices there is something missing “make test” will tell you, and sometimes gives some hints too.

Please note the warning given at test 10 about the SCSIDEVICE setting. Please edit the Config.sh file in the homedirectory of mkCDrec and change the setting.

3

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 4: MkCDrec Howto v13

1.4.The Configuration file – Config.sh

It is worth the time to view the Config.sh file at least once as it contains plenty of parameters that can be modifiedby the end-user. At least you have to modify those variables as told after running a ‘make test’, otherwise you willnever succeed in running mkCDrec successfully.

For a full list of the most important parameters see the web page http://mkcdrec.ota.be/project/config.html

Please note, mkCDrec also recognizes /etc/mkcdrec.conf file containing variables which override the settings inConfig.sh. This is very handy to keep your local settings upgrade proof.

2. Make the Disaster Recovery CD-ROMAfter the “make test” was successful you can run mkCDrec in two different modes, interactive and in batch.

To run in interactive mode just type “make” and the following screen will be displayed:

To run in batch mode, then you have to add an option to the make command. The batch mode commands are listedin the same order as the interactive mode:

1. Make rescue

2. Make CD-ROM

3. Make path DESTINATION_PATH=/foo

4. Make device

Another important option to make is “clean”:

# make clean

will remove all temporary files made by mkCDrec including the ISO9960 images created.

2.1. Rescue CD-ROM only (no backups)

If you select option 1 from the menu then you will create a small ISO9960 image without backups, but still usefulas a simple rescue CD-ROM built on your Linux platform. You can even burn the image to a business card sizeCD-ROM. Of course, you cannot restore backups with this CD-ROM unless you have your complete system filesystems on another backups media, such as Tivoli Storage Manager or Data Protector.

2.2. Into /tmp/backup (to burn on CDROM)

Option 2 will create a rescue CD-ROM including a complete backup of your system’s file systems. Of course itwill exclude any files or file systems you set in Config.sh EXCLUDE_LIST.

If necessary mkCDrec will create multi-volume CD-ROM images or can even burn a DVD too.

4

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 5: MkCDrec Howto v13

2.3. Enter another path (spare disk or NFS)

Option 3 expects that you NFS mounted the ISOFS_DIR (see Config.sh file)! Still a rescue CD-ROM will be madebut the destination path on the CD-ROM will point to the NFS mount point and it will try to auto-mount it. If thatdoes not work, then try it manually before starting a restore, clone operation.

2.4. Enter (remote) tape device

Option 4 will prompt for a no-rewinding tape device, either local or remote accessible, e.g. /dev/nst0.

Also now a mkCDrec ISO image will be created that must be used for a recovery operation.

So, to restore a system you first need to boot from the CD-ROM and then insert the tape into the tape drive (localor remote) and start the restore to retrieve the data from tape.

Note that there is the possibility to create an OBDR tape (no CD-ROM image will be burned).

2.5. Quit

What can we say about this option? Quit.

2.6. Encrypting the backups

If in the Config.sh file you activated encryption cipher, e.g. openssl Blowfish cipher

CIPHER=bf

Then you will be prompted twice for a password:

2.7. Backups without encryptions

When in the Config.sh file CIPHER=”” (default value) then the backups will not be encrypted.

In interactive mode you will see the following question appearing:

5

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 6: MkCDrec Howto v13

If there are file systems listed that should not be backup’ed then press Control-C now and unmount those filesystems immediately. In batch mode the above screen will not be disabled!

Thereafter, just run “make” command again to restart the backup process.

2.8. During the backups

What follows is a series of screen dumps of such a run to give you an impression of how it looks.

It will start with some primary checking, including if encryption will be used or not. The network settings arestored in a system file. Later when you boot from the mkCDrec CD-ROM it will allocate the IP address as foundwhile making the disaster recovery image, unless you have chosen DHCP setting in the Config.sh configurationfile, or if you are using DHCP right now.

Then it will create the root file system for the RAM disk. In above picture the RAM disk is created as an ext2 filesystem. It is also possible to use another file system as ext3, minix, reiserfs, xfs or jfs, but you loose so much RAMdisk space on journaling it is unwise to use journaling file systems such as ext3, reiserfs, xfs and jfs. Ext2 is goodenough for a RAM disk anyway as it lives in memory only and not an a real hard disk.

The root file system is mounting and filled with directories and binaries (stripped binaries) as seen in followingscreen shots.

6

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 7: MkCDrec Howto v13

Somewhere after copying the binaries and libraries mkCDrec will create lots of scripts and rescue files in the rootfile system etc/recovery directory.

After a while the root file system is complete and will get unmounted and compressed.

After the RAM root file system is compressed, and only when the mkCDrec Utilities were installed you will seethe following cfg2html run. This creates 2 important files (one as plain text and one in HTML format) that containa complete overview of your current system’s hardware and software installed, including all the configurationsettings. For this alone it is worth installing the mkCDrec Utilities. The information that these files contain willbe very appreciated in case of trouble! Believe me.

7

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 8: MkCDrec Howto v13

The next important phase in mkCDrec disaster recovery image making is the creation of the initial RAM diskwhich is a small boot image that loads some loadable modules in memory to mount the CD-ROM and bootstrapinto the bigger root file system RAM disk.

As you can see not much binaries are needed in the initial RAM disk.

After the initial RAM disk mkCDrec will create a bootable floppy in memory, but it is possible to write to a realfloppy too if the size permits. See the Config.sh file to toggle this.

The boot floppy contains the Linux kernel and the initial RAM disk. Once the boot floppy is done syslinux willmake it bootable.

If you have installed mkCDrec Utilities you will notice that the behavior is somewhat different as it will use isolinuxdirectly to boot from the CD-ROM instead of emulating a boot floppy booting from a CD-ROM.

8

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 9: MkCDrec Howto v13

After the boot floppy it is time to create the backups of the mounted file systems using GNU tar.

The behavior can be different as seen below if you have selected backup to tape or another disk.

The cutstream program is nothing more then a calculator to split the backups into 650 Mbytes images so mkCDreccan create an ISO9660 image of it. The image size is a variable that is defined in the Config.sh file (MAXCDSIZE).

mkCDrec uses mkisofs to create a bootable El-Torito CD-ROM.

9

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 10: MkCDrec Howto v13

Once the CDrec.iso has been created by mkisofs it will be checked to see whether it is useable and an md5sumchecksum will be implanted in the image too.

If you have selected to use a CDRW (variable in Config.sh) it will blank the CD, otherwise it will skip this step.

Burning the CDrec.iso image to the CDR(W) is done with cdrecord.

Above error will normally not been seen as in this case vmware was used to capture the screen shots, but it givesyou an impression that you will be given a second chance to write the image to CDR(W) if the first one fails. If itstill fails it will move the CDrec.iso image to another filename and continue with the backups.

After the entire file systems are backup’ed the last CDrec.iso image will be written.

10

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 11: MkCDrec Howto v13

3. Booting from a mkCDrec CD-ROM

3.1. x86 and x86_64 platforms

To be able to boot from a CD-ROM made by mkCDrec make sure the computer’s BIOS is capable of booting offa CD. Therefore, it might be necessary to enter the Setup and modify the boot sequence as follow:

You will see a message from syslinux (or isolinux) when the boot process starts from the CD-ROM.

Then the boot process stops and waits on your input (isolinux only, when mkCDrec Utilities are installed). To bootfrom the CD-ROM enter option 2.

Once option 2 has been entered and the enter key has been pressed the boot process continues with loading theLinux kernel and the initial RAM disk.

As you can see the initial RAM disk gets loaded and uncompressed into the computer’s memory and it launcheslinuxrc that is part of the initial RAM disk.

11

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 12: MkCDrec Howto v13

The initial RAM disk duty is to find the CD-ROM drive device and to load the necessary loadable kernel modules.Once the CD-ROM device gets mounted the initial RAM disk will read and uncompress the bigger root file systeminto main memory. If this step is successful it will activate the root file system via pivot_root (for linux kernel 2.4and above) as shown below.

The root file system uses BusyBox, the Swiss nice under Linux tool boxes, as an all-in-one utility among manyother Unix binaries. Once BusyBox activation is successful you will see a more or less normal boot sequence allbe it much less then a normal Linux distribution.

It boots up to the point you will see a prompt appearing. No root password is required to get started.

MkCDrec has 5 console login screens behind each ALT-F1 to ALT-F5 key combinations. Maybe, you will noticethat the 5th screen is a bit different as it requests a user and password via the login process.

Valid users are root, admin or mkcdrec and the password is “mkCDrec”. The idea is to add an automatic menubehind it to simplify the restore/recover situation.

So far mkCDrec disaster recovery is mend for administrators, which are used to work with command line interfaces.

From this point on you can use mkCDrec as a rescue tool or for any other non-destructive purposes.

12

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 13: MkCDrec Howto v13

Please note that mkCDrec CD-ROMs are a very powerful tool if used by the wrong people, if you understandwhat I mean. Keep the images (CD-ROMs) in a safe place!

3.2. IA64 (itanium) architecture

The Itanium systems are using ELF to bootstrap the Linux kernel, therefore, we cannot use e.g. isolinux to createa bootable CD-ROM image.

The EFI Shell is a console interface used to launch applications (such as the Red Hat Enterprise Linux installationprogram), load EFI protocols and device drivers, and execute simple scripts. It is similar to a DOS console andcan only access media that is FAT16 (VFAT) formatted.

The EFI Shell also contains common utilities that can be used on the EFI system partition. These utilities includeedit, type, cp, rm, and mkdir. For a list of utilities and other commands, type help at the EFI Shell prompt.

The EFI Shell contains a bootloader called ELILO. Additional information on EFI can be found at the followingURL:

http://developer.intel.com/technology/efi/index.htm

Each Itanium system contains a FAT16 (VFAT) system partition that is mounted on /boot/efi which contains theLinux kernel as well as the ELILO configuration file (elilo.conf).

Mkcdrec creates a bootable image for CD-ROM and a recovery image stored under the /boot/efi/efi/recoverydirectory.

Important notice is that you better enable SERIAL=”ttyS0” in the Config.sh file if you want to work with theLAN console and have no real access to any VGA console.

To boot from the local EFI partition interrupt the boot process and enter the EFI shell and select the local disk (e.g.fs0: ) and cd to efi/revovery and type elilo to boot (without any physical CD-ROM made).

4. Restoring with start-restore.shAfter booting your PC with a mkCDrec CD-ROM you should see a # prompt on your screen. If the archives arenot on a CD-ROM make sure the tape is inserted, or the file system has been mounted where original backupswere stored on.

4.1. Interactive restore

To restore your system completely from scratch go into directory /etc/recovery and type

# ./start-restore.sh

If you come across the following warning then mkCDrec was not able to guess your bootloader (lilo, grub, …). Ifyou are working with the first console, then due to a bug in BusyBox shell it is not possible to type Control-C. Towork-around that problem open second console with ALT-F2 and pressing Enter key.

13

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 14: MkCDrec Howto v13

Find out what the pid is of start-restore.sh shell script and kill it.

Go back to the first console (ALT-F1) and edit the BOOTLOADER file and replace the UNKNOWN keywordwith LILO or GRUB. Thereafter, restart the start-restore.sh shell script again.

The restore is quite simple – just follow the questions.

Per disk a question will be asked to restore or not.

Another question is whether you want to reformat the disk if mkCDrec finds an existing partition table on it.

The reformat will wipe out the entire disk. There is no way back once done!

After reformatting the disk the partitions are ready for creating file systems on it.

14

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 15: MkCDrec Howto v13

with some file system types, e.g. ReiserFS, a question may be asked.

Immediately after the creating of a file system on a partition it will get mounted and the restore starts in verbosemode. All the filenames will fly by quite quickly.

In case there are multiple CDs involved then you will see a message like the following when mkCDrec needs thenext CD in sequence:

Once a partition has been restored it will get unmounted and a file system check will happen to check the integrityof it.

15

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 16: MkCDrec Howto v13

At the end when all disks and file systems have been restored mkCDrec will mount the / and /boot directoryagain to run lilo or grub. This is necessary to make the disk bootable again.

You should see a blue message when the restore went fine. Otherwise, you will see a red banner with some warningsfor further inspections.

To reboot your system do the following:

And, finally type, “reboot” after removing the CD-ROM.

If the restore went fine then the disk should be bootable as before…

4.2. Automatic Disaster Recovery

If in Config.sh the option Automatic Disaster Recovery (AUTODR) was set to “y” then when you boot from themkCDrec CD-ROM the start-restore.sh procedure will be started automatically (after a warning and an interruptionpossibility of 20 seconds).

Of course, when multiple CDs are involved the automatic restore will be interrupted when mkCDrec needs thenext CD:

16

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 17: MkCDrec Howto v13

5. Cloning with clone-dsk.shIf the archives are not on a CD-ROM make sure the tape is inserted, or the file system has been mounted whereoriginal backups were stored on.

To clone one disk go into the /etc/recovery directory and type ./clone-sk.sh

Just follow the questions and select what you want:

17

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 18: MkCDrec Howto v13

That’s about it for cloning a disk.

Or maybe not!

Before rebooting always double check the /mnt/local/etc/lilo.conf file, or /mnt/local/boot/grub.conffile whether the boot and root device are correct. Need to change it? Use the “chroot /mnt/local” command to putthe restored disks into root mode for the system.

Another issue that may strike you is when you clone to another PC which is 100% the same then it is perhapsnecessary to edit the /mnt/local/etc/modules.conf file and change e.g. the scsi_hostadapter, eth0, and so on.

Also, a bit more tricky is when the initial ramdisk needs to be changed. Why do you need the initial ramdisk youmight wonder? Well if the new PC has another SCSI card for example then the original one!

Think wisely before start using mkCDrec on the source PC and add the SCSI modules you might need on the targetPC to the Config.sh file!

To create a new initial ramdisk do the following:

# cd /

# df

Make sure that /mnt/local (and /mnt/local/boot) are mounted. Also before doing a chroot mount also the/usr if needed.

# chroot /mnt/local

# cd /boot

# mv initrd-2.4.20-x.img initrd-2.4.20-x.img.sav

# mkinitrd –v --preload=BusLogic --omit-lvm-modules initrd-2.4.20-x.img 2.4.20-x

creates a new initial ramdisk. Execute the lilo command once more to be sure.

18

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 19: MkCDrec Howto v13

6. Restoring a single file system with restore-fs.shSometimes you do not want to restore a complete system or just one disk, but only one particular file system. Inthat case restore-fs.sh is the script you need. If the archives are not on a CD-ROM make sure the tape is inserted,or the file system has been mounted where original backups were stored on.

As before go into the /etc/recovery directory and type ./restore-fs.sh to launch it.

This script has been kept as simple as possible, just follow the questions.

Do not worry the following question will ask you on which partition you want to restore:

Be aware; make no mistake on which partition you select! Otherwise unpleasant situations can be created.

19

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 20: MkCDrec Howto v13

The next question gives you the chance to change the original file system type! However, only select the file systemtype you can actually use. With other words make sure that your Linux kernel is capable of using the select typeand for which you have the necessary tools on board.

It will create a file system on your partition, one of the list above, and only then the following question will beasked.

Select Y to restore the archive from the backup medium, be it CD-ROM, tape or anther disk.

Do manually a “chroot /mnt/local “ and edit /etc/lilo.conf file if needed. Thereafter, just run “lilo” to makethe disk bootable.

The file system has been restored and in our case we activated lilo too. We are ready to reboot the system.

20

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 21: MkCDrec Howto v13

7. Restoring with HP Openview Storage Data Protector

7.1. Integrating HP OpenView Storage Data Protector and mkCDrec

If you prefer to use Data Protector as backup storage instead of burning CD-ROMs or DVDs then you can configuremkCDrec to just generate a rescue CD-ROM with the needed executables to be able to restore from a booted rescueCD-ROM.

Therefore, edit the Config.sh file and define the following variables:

1. DP_RESTORE=”y”

2. DP_DATALIST_NAME=”the name of your datalist”

Thereafter run mkCDrec in rescue mode only as now you do not rely on mkCDrec to create a full backup!

make rescue

or

mkcdrec rescue

Burn the image on a CD-ROM and keep it safe for later usage.

7.2. Restore with Data Protector

Boot with the rescue CD-ROM and do the following:

cd /etc/recovery

./dp-restore.sh

and follow the instructions…

screendumps will follow

If you want to push the restore (for security reason for example or if the pull method failed for some reason) thenuse the Data Protector GUI when the dp-restore.sh gives you the chance.

What follows is an example restore via a Data Protector Manager GUI:

21

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 22: MkCDrec Howto v13

It is important that you restore into “/mnt/local” and select the “overwrite” button.

No additional options were selected.

22

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 23: MkCDrec Howto v13

Click next or finish to start the restore.

When the restore is finished type enter on your console window where you started the dp-restore.sh so it can finishthe GRUB or LILO part.

8. Other uses of mkCDrec

8.1. Restore user-mode Linux (UML)

MkCDrec version 0.7.4 and higher is able to restore a mkCDrec backup to a user-mode Linux installation. RonYorston experimented with this and basically this was his cookbook:

# extract the initrd file from the boot floppy image on the CD

mount -t iso9660 /dev/cdrom /mnt/cdrom

cp /mnt/cdrom/bootflop.img /tmp

umount /mnt/cdrom

23

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 24: MkCDrec Howto v13

mount -o loop -t vfat /tmp/bootflop.img /mnt/spare

cp /mnt/spare/initrd.gz .

umount /mnt/spare

gunzip initrd.gz

# make a 20 Gb disk to restore to

dd if=/dev/zero of=mkcdrec_fs bs=1024k count=1 seek=20000

# start UML connected to the 20 Gb disk and the CD drive

linux initrd=initrd ubd0=mkcdrec_fs ubd1=/dev/cdrom fakehd fake_ide \

ubd=3 ramdisk_size=32768 mem=64M devfs=nomount

More on UML can be found on:

1. http://user-mode-linux.sourceforge.net/

2. http://linuxhacker.ru/uml/

8.2. Superrescue CD-ROM

The Superrescue CD-ROM mode will copy the complete /usr from your source Linux system onto the CD-ROM.

Basically it is quiet easy to make a superrescue CD-ROM with mkCDrec on Intel architecture only. Just do thefollowing:

# make –f Makefile.x86 superrescue

This way all commands from /usr/bin, /sbin will be available on the CD-ROM.

8.3. MkCDrec Menu (Alt-F5)

Once booted from a mkCDrec CD-ROM you will be logged on by default on the /dev/console (also known as Alt-F1). However, there exist a mkCDrec menu to make the life easier of end-users.

Therefore type the Alt-F5 key and login as user mkcdrec (with password mkCDrec):

You will now see the following menu:

24

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 25: MkCDrec Howto v13

The options are straightforward and need no further explanations.

8.4. One-Button Disaster Recovery

OBDR can rapidly restore or replicate a server's operating system, software applications, and data using a tapecartridge(s). This is possible because the tape drive emulates a CD-ROM that allows the server to "boot from tape".This standard feature is embedded in the firmware of HP tape drives.

For more information go to http://www.hp.com/go/obdr

What does this mean? MkCDrec will create an ISO9660 image and put it on a tape instead of burning to a CD-R(W). The backups of the file systems are put after the ISO image. So basically, everything fits on one tape.

To boot from tape you need:

1. a HP tape drive which supports OBDR (see URL above)

2. a PC BIOS able to boot from SCSI (maybe it is needed to put SCSI on top of the list)

3. power-off the PC completely

4. push (while PC is off) on the eject button of the tape drive and switch on the PC. This will activate the OBDRmode and the tape drive will emulate a SCSI CD-ROM. You will notice that the green/orange led’s intermittentlight up.On newer PCs the procedure may be different (F8 instead). See URL above.

5. PC loads the linux and initrd from the tape.

6. tape drive goes out of OBDR mode and become a plain tape drive again.

7. the rd-base.img is read from tape.

8. Linux system is up and running. Restore is possible, see chapter 4.

Simple! How can you make an OBDR tape? There are two ways:

1. Via the menu option 4 (tape backup) the question will be asked to OBDR or not;

2. Via the command line: make OBDR

8.5. MkCDrec and PXE Booting

Download the document http://www.ota.be/linux/workshops/20031129/mkCDrec-PXE-notes.zip

9. Know Issues

9.1. Secure Shell

Be aware when trying to secure copy files from another host to mkCDrec’s rescued PC on the first console(/dev/console – use the “tty” command is verify), e.g.

# scp user@other_hsost:/tmp/missing_file /tmp

Host key verification failed.

An error may be expected as seen above. Nothing to worry as this is a SSH restriction! Switch to another console(ALT-F2…). Use again the “tty” command to verify, e.g. /dev/tty2. And, try again.

Now success it guaranteed.

25

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 26: MkCDrec Howto v13

10. GNU Free Documentation LicenseVersion 1.2, November 2002

Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is notallowed.

10.1. PREAMBLE

The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in thesense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifyingit, either commercially or noncommercially.

Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not beingconsidered responsible for modifications made by others.

This License is a kind of "copyleft", which means that derivative works of the document must themselves be freein the same sense. It complements the GNU General Public License, which is a copyleft license designed for freesoftware.

We have designed this License in order to use it for manuals for free software, because free software needs freedocumentation: a free program should come with manuals providing the same freedoms that the software does.But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matteror whether it is published as a printed book. We recommend this License principally for works whose purpose isinstruction or reference.

10.2. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work, in any medium, that contains a notice placed by the copyrightholder saying it can be distributed under the terms of this License. Such a notice grants a worldwide, royalty-freelicense, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refersto any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept thelicense if you copy, modify or distribute the work in a way requiring permission under copyright law.

A "Modified Version" of the Document means any work containing the Document or a portion of it, either copiedverbatim, or with modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively withthe relationship of the publishers or authors of the Document to the Document's overall subject (or to relatedmatters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in parta textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be amatter of historical connection with the subject or with related matters, or of legal, commercial, philosophical,ethical or political position regarding them.

The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of InvariantSections, in the notice that says that the Document is released under this License. If a section does not fit the abovedefinition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zeroInvariant Sections. If the Document does not identify any Invariant Sections then there are none.

The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, inthe notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words,and a Back-Cover Text may be at most 25 words.

A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specificationis available to the general public, that is suitable for revising the document straightforwardly with generic texteditors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing

26

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 27: MkCDrec Howto v13

editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitablefor input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence ofmarkup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. Animage format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" iscalled "Opaque".

Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format,LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML,PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCFand JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary wordprocessors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold,legibly, the material this License requires to appear in the title page. For works in formats which do not have anytitle page as such, "Title Page" means the text near the most prominent appearance of the work's title, precedingthe beginning of the body of the text.

A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or containsXYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific sectionname mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preservethe Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ"according to this definition.

The Document may include Warranty Disclaimers next to the notice, which states that this License applies to theDocument. These Warranty Disclaimers are considered to be included by reference in this License, but only asregards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and hasno effect on the meaning of this License.

10.3. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially or noncommercially, providedthat this License, the copyright notices, and the license notice saying this License applies to the Document arereproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may notuse technical measures to obstruct or control the reading or further copying of the copies you make or distribute.However, you may accept compensation in exchange for copies. If you distribute a large enough number of copiesyou must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publicly display copies.

10.4. COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numberingmore than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in coversthat carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Textson the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. Thefront cover must present the full title with all words of the title equally prominent and visible. You may add othermaterial on the covers in addition. Copying with changes limited to the covers, as long as they preserve the titleof the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as manyas fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include amachine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standardnetwork protocols a complete Transparent copy of the Document, free of added material. If you use the latteroption, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to

27

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 28: MkCDrec Howto v13

ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after thelast time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before redistributing any largenumber of copies, to give them a chance to provide you with an updated version of the Document.

10.5. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above,provided that you release the Modified Version under precisely this License, with the Modified Version filling therole of the Document, thus licensing distribution and modification of the Modified Version to whoever possessesa copy of it. In addition, you must do these things in the Modified Version:

1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those ofprevious versions (which should, if there were any, be listed in the History section of the Document). Youmay use the same title as a previous version if the original publisher of that version gives permission.

2. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modificationsin the Modified Version, together with at least five of the principal authors of the Document (all of its principalauthors, if it has fewer than five), unless they release you from this requirement.

3. State on the Title page the name of the publisher of the Modified Version, as the publisher.

4. Preserve all the copyright notices of the Document.

5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.

6. Include, immediately after the copyright notices, a license notice giving the public permission to use theModified Version under the terms of this License, in the form shown in the Addendum below.

7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in theDocument's license notice.

8. Include an unaltered copy of this License.

9. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year,new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled"History" in the Document, create one stating the title, year, authors, and publisher of the Document as givenon its Title Page, then add an item describing the Modified Version as stated in the previous sentence.

10. Preserve the network location, if any, given in the Document for public access to a Transparent copy of theDocument, and likewise the network locations given in the Document for previous versions it was based on.These may be placed in the "History" section. You may omit a network location for a work that was publishedat least four years before the Document itself, or if the original publisher of the version it refers to givespermission.

11. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preservein the section all the substance and tone of each of the contributor acknowledgements and/or dedicationsgiven therein.

12. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbersor the equivalent are not considered part of the section titles.

13. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version.

14. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any InvariantSection.

15. Preserve any Warranty Disclaimers.

28

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 29: MkCDrec Howto v13

If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections andcontain no material copied from the Document, you may at your option designate some or all of these sections asinvariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. Thesetitles must be distinct from any other section titles.

You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your ModifiedVersion by various parties--for example, statements of peer review or that the text has been approved by anorganization as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of

Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity.If the Document already includes a cover text for the same cover, previously added by you or by arrangementmade by the same entity you are acting on behalf of, you may not add another; but you may replace the old one,on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission to use their names forpublicity for or to assert or imply endorsement of any Modified Version.

10.6. COMBINING DOCUMENTS

You may combine the Document with other documents released under this License, under the terms defined insection 4 above for modified versions, provided that you include in the combination all of the

Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of yourcombined work in its license notice, and that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and multiple identical Invariant Sections may bereplaced with a single copy. If there are multiple Invariant Sections with the same name but different contents,make the title of each such section unique by adding at the end of it, in parentheses, the name of the original authoror publisher of that section if known, or else a unique number. Make the same adjustment to the section titles inthe list of Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled "History" in the various original documents, formingone section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sectionsEntitled "Dedications". You must delete all sections Entitled "Endorsements".

10.7. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents released under this License, andreplace the individual copies of this License in the various documents with a single copy that is included in thecollection, provided that you follow the rules of this License for verbatim copying of each of the documents in allother respects.

You may extract a single document from such a collection, and distribute it individually under this License, providedyou insert a copy of this License into the extracted document, and follow this License in all other respects regardingverbatim copying of that document.

10.8. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and independent documents or works, in oron a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from thecompilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit.When the Document is included in an aggregate, this License does not apply to the other works in the aggregatewhich are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document isless than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the

29

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 30: MkCDrec Howto v13

Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form.Otherwise they must appear on printed covers that bracket the whole aggregate.

10.9.TRANSLATION

Translation is considered a kind of modification, so you may distribute translations of the Document under theterms of section 4. Replacing Invariant Sections with translations requires special permission from their copyrightholders, but you may include translations of some or all Invariant Sections in addition to the original versions ofthese Invariant Sections. You may include a translation of this License, and all the license notices in the Document,and any Warranty Disclaimers, provided that you also include the original English version of this License and theoriginal versions of those notices and disclaimers. In case of a disagreement between the translation and the originalversion of this License or a notice or disclaimer, the original version will prevail.

If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section4) to Preserve its Title (section 1) will typically require changing the actual title.

10.10.TERMINATION

You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under thisLicense. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automaticallyterminate your rights under this License. However, parties who have received copies, or rights, from you underthis License will not have their licenses terminated so long as such parties remain in full compliance.

10.11. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License fromtime to time. Such new versions will be similar in spirit to the present version, but may differ in detail to addressnew problems or concerns. See http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the Document specifies that a particularnumbered version of this License "or any later version" applies to it, you have the option of following the termsand conditions either of that specified version or of any later version that has been published (not as a draft) bythe Free Software Foundation. If the Document does not specify a version number of this License, you may chooseany version ever published (not as a draft) by the Free Software Foundation.

10.12. ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of the License in the document and put thefollowing copyright and license notices just after the title page:

Copyright (c) YEAR YOUR NAME.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU FreeDocumentation License, Version 1.2 or any later version published by the Free Software Foundation; with noInvariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the sectionentitled "GNU Free Documentation License".

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this:

with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with theBack-Cover Texts being LIST.

If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those twoalternatives to suit the situation.

If your document contains nontrivial examples of program code, we recommend releasing these examples inparallel under your choice of free software license, such as the GNU General Public License, to permit their usein free software.

30

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/

Page 31: MkCDrec Howto v13

11. AcknowledgementsThis section acknowledges all the people who contributed to this howto in some way.

1. IT3 Consultants’ boss wise decision to apply the “GNU Free Documentation License”

2. Ron Yorston for the section “Restore user-mode Linux (UML)”

31

mkCDrec Howto

XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/