Recover an sdb.db file from the Reserve partition

Description:

 

Sometimes you may find out that your sdb.db is not working as desired. It is very unusual that the sdb.db becomes corrupt using the AppGate Console, but it is of course possible to make it non working by removing all accounts with administrator role membership or otherwise make it less usefull.

A recovery method may then be to reboot the system from the reserve partition but you may then lose some other configuration that takes time to set up. An other method is to mount the reserve partition and only copy the sdb.db from it - or possibly any other single files that may have been broken.

Figure out where the Reserve partition is

In an AppGate system the Reserve partition is on the same physical disk as the Primary partition, is is just on an other Slice in Solaris terms. The Primary is alway on Slice 0 and Reserve is on Slice 3. So the only thing you need to do is to figure out what the disk is called. To do that run as root and do:

df -h /
The output will look like:
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0d0s0 3.4G 835M 2.6G 24% /
Observe the first part /dev/dsk/c0d0s0 , this is the name of the Primary partition, where s0 indicates slice 0. Consequently the name of the Reserve will in this case be /dev/dsk/c0d0s3 .

Mounting the Reserve partition

Do the following commands as root and start with creating a mountpoint (on some systems this is allready done):

mkdir /mnt
Mount the Reserve partition:
mount /dev/dsk/c0d0s3 /mnt
Move to the database dir
cd /var/opt/appgate/database
Save a copy of the current database file
cp sdb.db sdb.db.orig
Copy a new from the Reserve partition.
cp /mnt/var/opt/appgate/database/sdb.db sdb.db
For safety use the logcat -f to get a continous log and wait for a successful automatic reload message. Then:
umount /mnt