9.6. Data Problems

Data problems are 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 from before your system failed. SUSE Linux offers dedicated YaST modules for system backup and restoration as well as a rescue system that can be used to recover a corrupted system from the outside.

9.6.1. Backing Up Critical Data

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

  1. As root, start YaST and select System+System Backup.

  2. Create a backup profile holding all details needed for the backup, filename of the archive file, scope, and type of the backup:

    1. Select Profile Management+Add.

    2. Enter a name for the archive.

    3. Enter the path to the location of the backup if you want to keep a local backup. For your backup to be archived on a network server (via NFS), enter the IP address or name of the server and the directory that should hold your archive.

    4. Determine the archive type and click Next.

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

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

    6. Finally, set the search constraints to exclude certain system areas from the backup area that do not need to be backed up, such as lock files or cache files. Add, edit, or delete items until your needs are met and leave with OK.

  3. Once you have finished the profile settings, you can start the backup right away with Create Backup or configure automatic backup. It is also possible to create other profiles tailored for various other purposes.

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

  1. Select Automatic Backup from the Profile Management menu.

  2. Select Start Backup Automatically.

  3. Determine the backup frequency. Choose daily, weekly, or monthly.

  4. Determine the backup start time. These settings depend on the backup frequency selected.

  5. Decide whether to keep old backups and how many should be kept. To receive an automatically generated status message of the backup process, check Send Summary Mail to User root.

  6. Click OK for your settings to be applied and the first backup started at the time specified.

9.6.2. Restoring a System Backup

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

  1. Start YaST+System+System Restoration.

  2. Enter the location of the backup file. This could be a local file, a network mounted file, or a file on a removable device, such as a floppy or a CD. Then click Next.

    The following 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. Clicking OK returns you to the Archive Properties dialog.

  4. Expert Options opens a dialog in which to fine-tune the restore process. Return to the Archive Properties dialog by clicking OK.

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

    Press Accept to restore all files in the archive or use the various Select All, Deselect All, and Select Files buttons for a fine-tuning of your selection. Only check the Restore RPM Database option if it is corrupted or deleted and if this file is included in the backup.

  6. After you click Accept, the backup is restored. Click Finish to leave the module after the restore process is completed.

9.6.3. Recovering a Corrupted System

There are several reasons why a system could fail to come up and run properly. A corrupted file system after a system crash, corrupted configuration files, or a corrupted boot loader configuration are the most common ones.

SUSE Linux offers a graphical front-end for system repair. The following section introduces the YaST System Repair module.

SUSE Linux offers two different methods to cope with this kind of situation. You can either use the YaST System Repair functionality or boot the rescue system. The following sections cover both flavors of system repair.

9.6.3.1. Using YaST System Repair

Before launching the YaST System Repair module, determine in which mode to run it to best fit your needs. Depending on the severeness and cause of your system failure and your expertise, there are three different modes to choose from:

Automatic Repair

If your system failed due to an unknown cause and you basically do not know which part of the system is to blame for the failure, use Automatic Repair. An extensive automated check will be performed on all components of your installed system. For a detailed description of this procedure, refer to Section 9.6.3.1.1, “Automatic Repair”.

Customized Repair

If your system failed and you already know which component is to blame, you can cut the lengthy system check with Automatic Repair short by limiting the scope of the system analysis to those components. For example, if the system messages prior to the failure seem to indicate an error with the package database, you can limit the analysis and repair procedure to checking and restoring this aspect of your system. For a detailed description of this procedure, refer to Section 9.6.3.1.2, “Customized Repair”.

Expert Tools

If you already have a clear idea of what component failed and how this should be fixed, you can skip the analysis runs and directly apply the tools necessary for the repair of the respective component. For details, refer to Section 9.6.3.1.3, “Expert Tools”.

Choose one of the repair modes as described above and proceed with the system repair as outlined in the following sections.

9.6.3.1.1. Automatic Repair

To start the automatic repair mode of YaST System Repair, proceed as follows:

  1. Boot the system with the original installation medium used for the initial installation (as outlined in Chapter 1, Installation with YaST).

  2. Select the Repair Installed System installation mode.

  3. Select Automatic Repair.

    YaST now launches an extensive analysis of the installed system. The progress of the procedure is displayed at the bottom of the screen with two progress bars. The upper bar shows the progress of the currently running test. The lower bar shows the overall progress of the analysis. The log window in the top section tracks the currently running test and its result. See Figure 9.2, “Automatic Repair Mode”. The following main test runs are performed with every run. They contain, in turn, a number of individual subtests.

    Figure 9.2. Automatic Repair Mode

    Automatic Repair Mode
    Partition Tables of All Hard Disks

    Checks the validity and coherence of the partition tables of all detected hard disks.

    Swap Partitions

    The swap partitions of the installed system are detected, tested, and offered for activation where applicable. The offer should be accepted for the sake of a higher system repair speed.

    File Systems

    All detected file systems are subjected to a file system–specific check.

    Entries in the File /etc/fstab

    The entries in the file are checked for completeness and consistency. All valid partitions are mounted.

    Boot Loader Configuration

    The boot loader configuration of the installed system (GRUB or LILO) is checked for completeness and coherence. Boot and root devices are examined and the availability of the initrd modules is checked.

    Package Database

    This checks whether all packages necessary for the operation of a minimal installation are present. While it is optionally possible also to analyze the base packages, this takes a long time because of their vast number.

  4. Whenever an error is encountered, the procedure stops and a dialog opens outlining the details and possible solutions.

    Read the screen messages carefully before accepting the proposed fix. If you decide to decline a proposed solution, your system remains unchanged.

  5. After the repair process has been terminated successfully, click OK and Finish and remove the installation media. The system automatically reboots.

9.6.3.1.2. Customized Repair

To launch the Customized Repair mode and selectively check certain components of your installed system, proceed as follows:

  1. Boot the system with the original installation medium used for the initial installation (as outlined in Chapter 1, Installation with YaST).

  2. Select the Repair Installed System installation mode.

  3. Select Customized Repair.

    Choosing Customized Repair shows a list of test runs that are all marked for execution at first. The total range of tests matches that of automatic repair. If you already know where no damage is present, unmark the corresponding tests. Clicking Next starts a narrower test procedure that probably has a significantly shorter running time.

    Not all test groups can be applied individually. The analysis of the fstab entries is always bound to an examination of the file systems, including existing swap partitions. YaST automatically resolves such dependencies by selecting the smallest number of necessary test runs.

  4. Whenever an error is encountered, the procedure stops and a dialog opens outlining the details and possible solutions.

    Read the screen messages carefully before accepting the proposed fix. If you decide to decline a proposed solution, your system remains unchanged.

  5. After the repair process has been terminated successfully, click OK and Finish and remove the installation media. The system automatically reboots.

9.6.3.1.3. Expert Tools

If you are knowledgeable with SUSE Linux and already have a very clear idea of what needs to be repaired in your system, directly apply the tools skipping the system analysis.

To make use of the Expert Tools feature of the YaST System Repair module, proceed as follows:

  1. Boot the system with the original installation medium used for the initial installation (as outlined in Chapter 1, Installation with YaST).

  2. Select the Repair Installed System installation mode.

  3. Select Expert Tools.

    Choose one or more of the following options to repair your faulty system:

    Install New Boot Loader

    This starts the YaST boot loader configuration module. Find details in Section 9.3, “Configuring the Boot Loader with YaST” (↑Reference).

    Run Partitioning Tool

    This starts the expert partitioning tool in YaST. Find details in Section 2.5.6, “Partitioner”.

    Repair File System

    This checks the file systems of your installed system. You are first offered a selection of all detected partitions and can then choose the ones to check.

    Recover Lost Partitions

    It is possible to attempt to reconstruct damaged partition tables. A list of detected hard disks is presented first for selection. Clicking OK starts the examination. This can take a while depending on the processing power and size of the hard disk.

    [Important]Reconstructing a Partition Table

    The reconstruction of a partition table is tricky. YaST attempts to recognize lost partitions by analyzing the data sectors of the hard disk. The lost partitions are added to the rebuilt partition table when recognized. This is, however, not successful in all imaginable cases.

    Save System Settings to Floppy

    This option saves important system files to a floppy disk. If one of these files become damaged, it can be restored from disk.

    Verify Installed Software

    This checks the consistency of the package database and the availability of the most important packages. Any damaged installed packages can be reinstalled with this tool.

  4. After the repair process has been terminated successfully, click OK and Finish and remove the installation media. The system automatically reboots.