DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Troubleshooting system-level problems

Restoring a corrupted root filesystem

If your root filesystem is so corrupted that fsck(ADM) cannot run when you boot the system, or the system displays error messages that make no sense, you must restore the root filesystem from backups. To do this, you need an emergency boot floppy disk set, which you should have created as described in UNRESOLVED XREF-0. If you do not have these diskettes, you must do a partial reinstallation as described in ``Replacing the root hard disk''.


NOTE: The emergency boot floppy disk set must have a kernel with the correct tape drivers installed. If you have changed the type of tape drive since creating your emergency boot floppy disk set, you will need to configure the tape drive at the Boot: prompt as described in ``QIC-02 tape drive bootstrings'' and ``SCSI peripheral bootstrings''.

To restore your root filesystem:

  1. Shut the system off.

  2. Insert your boot floppy (or a single boot/root floppy disk) in the floppy disk drive and power up the system.

  3. At the Boot: prompt, press <Enter>.

  4. When prompted, insert the root floppy disk and press <Enter>.

  5. The system creates a RAM disk and loads a rudimentary root filesystem into memory. After you see the startup messages that list the devices configured into the kernel, the root prompt (#) is displayed. Enter this command:

    fsck /dev/hd0root

    If fsck appears to be successful, shut down the system with haltsys(ADM) and try booting from the hard disk again by pressing <Enter> at the Boot: prompt. If the check fails, continue with the next step.

  6. Enter this command to reconfigure your root disk from scratch:

    mkdev hd


    NOTE: You may see a few error messages like these:
    
    
       /usr/lib/mkdev/hd: uniq: not found
       mv: cannot access /tmp/DKINIT21: No such file or directory (error 2)
    
    These are a consequence of operating from the limited RAM disk filesystem and can be ignored.

    This runs all the programs necessary to initialize your disk as described in ``Installing a hard disk'', including:

    If the hard disk or filesystem information is still valid, you do not need to recreate it. For example, if your hard disk still has a valid badtrk table, you do not need to run a badtrk scan. Intact filesystems will be preserved if possible.

  7. Soon after you see the Making filesystems message, the root prompt is returned. Enter:

    fsck /dev/hd0root

    This cleans the root filesystem on the hard drive.

  8. Enter:

    mount /dev/hd0root /mnt

    This mounts the root filesystem on the hard disk.

  9. Insert the first volume of the root filesystem backup and restore the filesystem with the following commands:

    cd /mnt
    cpio -ivmkBud -I/dev/
    xxx

    where xxx is either rct0 (for a 1/4-inch cartridge tape) or rctmini (for a mini-cartridge tape).


    NOTE: If you see an error message like this when you attempt the restore:
       NOTICE: HTFS: No space on dev ram (31/7)
       cpio: cannot write /_BACKUP_CONTENTS_:...
       ...No Space left on device (error 28)
    
    This means the files were written to the tape device using absolute instead of relative pathnames. You are attempting to write to the root filesystem loaded onto the ramdisk instead of the root filesystem on the hard drive. You must add the -A option to the cpio command line:

    cpio -ivmkBudA -I/dev/xxx

    This suppresses absolute pathnames on the files passed to cpio.


  10. After the restore is complete, make sure there is a stand directory at the top of the root filesystem. If there is not, create it with the following command:

    mkdir stand


    NOTE: If your system is un upgrade from a release prior to SCO OpenServer Release 5, you do not have a boot filesystem (/stand) and you should not create it. You should also skip steps 12-14.

  11. Unmount and clean the newly restored filesystem with the following commands:

    cd /
    umount /dev/hd0root
    fsck /dev/hd0root

    You may see this message, which can be ignored:

       umount: warning: /dev/filesystem was not in mount table
    

  12. Check the boot filesystem (/stand):

    fsck /dev/boot

  13. Mount the filesystem and change directories:

    mount /dev/boot /mnt
    cd /mnt

  14. Insert your backup tape of the boot filesystem and restore it using the same command you used for the root filesystem. When the restore is complete, unmount the filesystem and check it:

    cd /
    umount /mnt
    fsck /dev/boot

  15. Restart your system from the root disk. Power-cycle the computer and boot normally.

  16. Restore any secondary filesystems using the Backup Manager. When this process is complete, your system should be returned to its original state.

Next topic: System crashes
Previous topic: Recording your root disk layout

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005