5.6 Data Problems

Data problems are those times when the machine might or might not boot properly but, in either case, it is clear that there is data corruption on the system and that the system needs to be recovered. These situations call for a backup of your critical data, enabling you to recover the status quo if your system fails. NLD comes with dedicated YaST modules for system backup and recovery as well as with a rescue system that can be used to recover a corrupted system from the outside.

5.6.1 How do I backup critical data?

System backups can be easily managed using the YaST System Backup module:

  1. As root, start YaST and click System > System Backup.

    For more information, see Section A.1, Starting YaST.

  2. Create a backup profile holding all details needed for the backup (filename of the archived file, scope, and type of the backup).

    1. Click Profile Management > Add.

    2. Specify a name for the archive.

    3. Specify the path to the location of the backup, if you want to keep a local backup.

      If you want your backup to be archived on a network server (via NFS), specify the IP address or name of the server and the directory which should hold your archive.

    4. Select the archive type, then click Next.

    5. Select the backup options to use (whether files not belonging to any package should be backed up, whether a list of files should be displayed prior to creating the archive, and whether changed files should be identified using the (time-consuming) MD5 mechanism).

      Use the Expert button to open a dialog for the backup of entire hard disk areas. Currently, this option applies only to the Ext2 file system.

    6. Finally, set the search constraints excluding certain system areas from the backup area which do not need to be backed up (like lock files or cache files); add, edit, or delete items until your needs are met; then click OK.

  3. After you have finished the profile settings, do any of the following:

    • Start the backup right away (click Start)
    • Configure automatic backup
    • Create other profiles tailored for various other purposes

To configure automatic backup for a given profile, proceed as follows:

  1. As root, start YaST and click System > System Backup.

    For more information, see Section A.1, Starting YaST.

  2. Select the profile you want, then click Profile Management > Automatic Backup.

  3. Click Start Backup Automatically.

  4. Select the backup frequency (daily, weekly, or monthly).

  5. Set the backup start time.

    These settings depend on the backup frequency you selected.

  6. Select whether you want to keep old backups and how many of them should be kept.

    If you want to receive an automatically generated status message of the backup process, select Send Summary Mail to user root.

  7. Click OK to apply the settings.

5.6.2 How do I replay a system backup?

Use the YaST Restore System module to restore the system configuration from a backup. You can either replay the entire backup or select specific components that are corrupted and need to be reset to their old state.

  1. As root, start YaST and click System > Restore System.

    For more information, see Section A.1, Starting YaST.

  2. Specify the location of the backup file, then click Next.

    This can be a local file, a network mounted file, or a file on a removable device such as a floppy or a CD.

    A dialog displays a summary of the archive properties, such as the filename, date of creation, type of backup, and optional comments.

  3. Review the archived content by clicking Archive content, then clicking OK to go back to the Archive properties dialog.

  4. Click Expert to open a dialog where you can do some additional finetuning to the restore process, accept the default options, then return to the Archive properties dialog by clicking OK.

  5. Click Next to launch the view of packages to restore.

  6. Click Accept to restore all files in the archive or use the various Select buttons for a finetuning of your selection.

    Select Restore RPM database only if you corrupted or deleted the package database by accident and if this file is included in the backup. Otherwise, leave this option unchecked.

    After you click Accept, the backup is applied.

  7. Click Finish to leave the module after the restore process is finished.

5.6.3 How do I recover a corrupted system?

There are several reasons why an NLD system could fail to come up and run properly. A corrupted file system after a system crash, corrupted configuration files, and corrupted boot loader configurations are the most common reasons. If the system can't be booted from hard disk, use the installation media (CD1) as boot media and launch the rescue system.

After you log in to the rescue system, you can recover and complete a number of other tasks:

  • Manipulate any type of configuration file.
  • Check, modify, and reinstall the boot loader configuration.
  • Check the file system for defects and start automatic repair processes.
  • Resize partitions using the parted command. More information on this tool can be found at the GNU Parted Web site.

To manipulate a configuration file, proceed as follows:

IMPORTANT:Before entering the rescue system, make sure you have a copy of the partition table of your NLD system. Otherwise, you cannot mount the root file system of your NLD installation to the rescue system in Step 4.

  1. Launch the rescue system of NLD by inserting CD1 into the CD-ROM drive of your machine.

    Make sure that the BIOS uses the CD-ROM as the preferred source of boot information and that you reboot the system using the RESET button.

  2. When the initial boot screen appears, select Rescue System and press Enter.

  3. Select the language and keyboard layout used in the rescue system, then click OK.

    The system boots into a minimal Linux system that resides entirely in a RAM disk and is thus totally independent of your installed system.

  4. To access your original NLD system, mount its root file system to a directory in the rescue system.

    For example, to mount a root file system located under /dev/hda3 to the rescue system, use the following command:

    mount /dev/hda3 /mnt

    All directories of the NLD system are now located in /mnt.

  5. Change to the directory in the mounted NLD root file system by entering

    cd /mnt

  6. Open the broken configuration file in the minimal text editor vi using the following command:

    vi myfile

  7. Enter and save your changes.

  8. Unmount the NLD root file system from the rescue system by entering

    umount /mnt

  9. Reboot the machine.

To check the boot loader configuration and reinstall the boot loader, proceed as follows:

  1. Mount the root file system of your NLD system under the rescue system as described in the previous procedure.

  2. Check whether the following files are correctly configured according to the GRUB configuration principles outlined in “Chapter 8: Booting and Boot Managers” in the SUSE LINUX Enterprise Server 9 Administration Guide:

    • etc/grub.conf
    • boot/grub/device.map
    • boot/grub/menu.lst

    Apply fixes to the device mapping (device.map) or the location of the root partition and configuration files, if necessary.

  3. Reinstall the boot loader using the following command sequence:

    Rescue:~ # chroot /mnt Rescue:/ # grub --batch < /etc/grub.conf

  4. Reboot the system.

Checking a file system while it is mounted is virtually impossible. If the root file system is corrupted, you can analyze and fix it only through the rescue system. The rescue system contains all file system (check) utilities needed for any of the major Linux file systems.