Friday 19 September 2014

How To Restore the repository (i.e svc.configd: smf(5) database integrity check of: /etc/svc/repository.db)

svc.configd: smf(5) database integrity check of:

    /etc/svc/repository.db

  failed. The database might be damaged or a media error might have
  prevented it from being verified.  Additional information useful to
  your service provider is in:

    /etc/svc/volatile/db_errors

  The system will not be able to boot until you have restored a working
  database.  svc.startd(1M) will provide a sulogin(1M) prompt for recovery
  purposes.  The command:

    /lib/svc/bin/restore_repository

  can be run to restore a backup version of your repository.  See
  http://sun.com/msg/SMF-8000-MY for more information.

Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
svc.configd exited with status 102 (database initialization failure)

Root password for system maintenance (control-d to bypass):
single-user privilege assigned to /dev/console.
Entering System Maintenance Mode

root@ # bash
root@ # mount -o rw,remount /
root@ # TERM=vt100
root@ # export TERM
root@ # vi /etc/vfstab
comment the root

#/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      -

And changed to

/dev/dsk/c1t0d0s5       /dev/rdsk/c1t0d0s5      /       ufs     1       no

root@ # ls -ld /dev/dsk/c1t0d0s5
lrwxrwxrwx   1 root     root          70 Sep 18  2011 /dev/dsk/c1t0d0s5 -> ../../devices/pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01332cb21,0:f
root@ # reboot /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w500000e01332cb21,0:f

Rebooting with command: boot /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w500000e01332cb21,0:f
Boot device: /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w500000e01332cb21,0:f  File and args:
SunOS Release 5.10 Version Generic_144488-14 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
|
svc.configd: smf(5) database integrity check of:

    /etc/svc/repository.db

  failed. The database might be damaged or a media error might have
  prevented it from being verified.  Additional information useful to
  your service provider is in:

    /etc/svc/volatile/db_errors

  The system will not be able to boot until you have restored a working
  database.  svc.startd(1M) will provide a sulogin(1M) prompt for recovery
  purposes.  The command:

    /lib/svc/bin/restore_repository

  can be run to restore a backup version of your repository.  See
  http://sun.com/msg/SMF-8000-MY for more information.

Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
svc.configd exited with status 102 (database initialization failure)

Root password for system maintenance (control-d to bypass):
single-user privilege assigned to /dev/console.
Entering System Maintenance Mode

Aug 18 03:32:12 su: 'su root' succeeded for root on /dev/console
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
You have new mail.



root@ # cd /etc/svc/volatile
root@ # cat db_errors

root@ # /lib/svc/bin/restore_repository

See http://sun.com/msg/SMF-8000-MY for more information on the use of
this script to restore backup copies of the smf(5) repository.

If there are any problems which need human intervention, this script will
give instructions and then exit back to your shell.

Note that upon full completion of this script, the system will be rebooted
using reboot(1M), which will interrupt any active services.

The following backups of /etc/svc/repository.db exist, from
oldest to newest:

manifest_import-20070611_215048
manifest_import-20090124_021149
manifest_import-20100804_015714
boot-20100804_023922
boot-20100915_030758
boot-20110919_003828
manifest_import-20110919_003844
boot-20110919_004907

The backups are named based on their type and the time what they were taken.
Backups beginning with "boot" are made before the first change is made to
the repository after system boot.  Backups beginning with "manifest_import"
are made after svc:/system/manifest-import:default finishes its processing.
The time of backup is given in YYYYMMDD_HHMMSS format.

Please enter either a specific backup repository from the above list to
restore it, or one of the following choices:

        CHOICE            ACTION
        ----------------  ----------------------------------------------
        boot              restore the most recent post-boot backup
        manifest_import   restore the most recent manifest_import backup
        -seed-            restore the initial starting repository  (All
                            customizations will be lost, including those
                            made by the install/upgrade process.)
        -quit-            cancel script and quit
Enter response [boot]: "boot"
/etc/svc/repository-"boot": not found
Enter response [boot]: boot-20110919_004907

After confirmation, the following steps will be taken:

svc.startd(1M) and svc.configd(1M) will be quiesced, if running.
/etc/svc/repository.db
    -- renamed --> /etc/svc/repository.db_old_20130818_034915
/etc/svc/volatile/db_errors
    -- copied --> /etc/svc/repository.db_old_20130818_034915_errors
/etc/svc/repository-boot-20110919_004907
    -- copied --> /etc/svc/repository.db
and the system will be rebooted with reboot(1M).

Proceed [yes/no]? yes

Quiescing svc.startd(1M) and svc.configd(1M): done.
/etc/svc/repository.db
    -- renamed --> /etc/svc/repository.db_old_20130818_034915
/etc/svc/volatile/db_errors
    -- copied --> /etc/svc/repository.db_old_20130818_034915_errors
/etc/svc/repository-boot-20110919_004907
    -- copied --> /etc/svc/repository.db

The backup repository has been successfully restored.

Rebooting in 5 seconds.
syncing file systems... done
rebooting...

Resetting ...
Rebooting with command: boot
Boot device: /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w500000e0184db961,0:a  File and args:
SunOS Release 5.10 Version Generic_144488-14 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
Hostname: xyz
Loading smf(5) service descriptions: 2/2
Reading ZFS config: done.

Regrads,
Suresh

No comments:

Post a Comment