Restoring a corrupted root filesystem
If your root filesystem is so corrupted that
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
If you do not have these diskettes, you must do a
partial reinstallation as described in
``Replacing the root hard disk''.
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''
``SCSI peripheral bootstrings''.
To restore your root filesystem:
Shut the system off.
Insert your boot floppy (or a single boot/root floppy disk)
in the floppy disk drive and power up the system.
Boot: prompt, press <Enter>.
When prompted, insert the root floppy disk and press <Enter>.
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:
If fsck appears to be successful,
shut down the system with
and try booting from the hard disk
again by pressing <Enter> at the
If the check fails, continue with the next step.
Enter this command to reconfigure your root disk from scratch:
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'',
setting disk parameters with
if necessary; this is skipped for SCSI disks
partitioning the disk with
If you had multiple partitions, you should use the information
you recorded as described in
``Recording your root disk layout''.
If only the root filesystem is corrupted, it is not necessary
to repartition the drive and you can simply quit out of
mapping bad blocks or sectors with
You can choose quick or thorough and destructive or non-destructive
scans. If you destructively scan the disk, you will overwrite the
boot sectors of the drive -- see
for more information.
recreating the filesystems and swap space with
Use the information you recorded in
``Recording your root disk layout''.
If you want to change the sizes, ensure they are at least
as large as before.
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.
Soon after you see the
Making filesystems message,
the root prompt is returned. Enter:
This cleans the root filesystem on the hard drive.
mount /dev/hd0root /mnt
This mounts the root filesystem on the hard disk.
Insert the first volume of the root filesystem backup
and restore the filesystem with the following commands:
cpio -ivmkBud -I/dev/xxx
where xxx is either rct0 (for a 1/4-inch cartridge tape)
or rctmini (for a mini-cartridge tape).
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.
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:
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
Unmount and clean the newly restored filesystem with the
You may see this message, which can be ignored:
umount: warning: /dev/filesystem was not in mount table
Check the boot filesystem (/stand):
Mount the filesystem and change directories:
mount /dev/boot /mnt
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:
Restart your system from the root disk.
Power-cycle the computer and boot normally.
Restore any secondary filesystems using the Backup Manager.
When this process is complete, your system should be returned
to its original state.
Recording your root disk layout
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005