Less Known Solaris features: Jumpstart Enterprise Toolkit - Part 15: Using flash archives for recovery

You can´t use flash without any further thinking for system recovery. As i wrote before, the new system is cloned and has a new personality, it´s not a copy. But there is a trick.

The basic trick

My colleague Mario Beck showed it to me several years ago. The problem is the sysunconfig as it deletes the configuration information. The basic trick is simple. Before you create the flash archive, just do a backup of those files in one of the directories covered by the archive creation. Later on you can use this data to recover the configuration by copying those files in their original location.

Using an augumented Flash archive

The flash archive is just a cpio copy of the complete system minus explicitly excluded parts. Everything on the system is included in the flash archive, not just the OS\footnote{otherwise the flash archives wouldn make sense}. So we can easly rescue the personality of the system into the flash archive. To simplify this task, i use the following script:

#!/bin/sh<br />
mkdir -p /var/opt/recovery<br />
mkdir -p /var/opt/recovery/etc<br />
cp -p /etc/hosts /var/opt/recovery/etc<br />
cp -p /etc/shadow /var/opt/recovery/etc<br />
cp -p /etc/passwd /var/opt/recovery/etc<br />
cp -p /etc/vfstab /var/opt/recovery/etc<br />
cp -p /etc/nodename /var/opt/recovery/etc<br />
cp -p /etc/hostname.* /var/opt/recovery/etc<br />
cp -p /etc/dhcp.* /var/opt/recovery/etc<br />
cp -p /etc/defaultdomain /var/opt/recovery/etc<br />
cp -p /etc/TIMEZONE /var/opt/recovery/etc<br />
mkdir -p /var/opt/recovery/etc/inet<br />
cp -p /etc/inet/netmasks /var/opt/recovery/etc/inet/netmasks<br />
cp -p /etc/defaultrouter /var/opt/recovery/etc/defaultrouter<br />
mkdir -p /var/opt/recovery/var/ldap<br />
cp -p /etc/.rootkey /var/opt/recovery/etc<br />
cp -p /etc/resolv.conf /var/opt/recovery/etc<br />
cp -p /etc/sysidcfg /var/opt/recovery/etc<br />
cp -p /var/ldap/ldap_client_cache /var/opt/recovery/var/ldap/ldap_client_cache<br />
cp -p /var/ldap/ldap_client_file /var/opt/recovery/var/ldap/ldap_client_file<br />
cp -p /var/ldap/ldap_client_cred /var/opt/recovery/var/ldap/ldap_client_cred<br />
cp -p /var/ldap/cachemgr.log /var/opt/recovery/var/ldap/cachemgr.log<br />
mkdir -p /var/opt/recovery/var/nis<br />
cp -p /var/nis/NIS_COLD_START /var/opt/recovery/var/nis<br />
mkdir -p /var/opt/recovery/var/yp<br />
cp -R -p /var/yp/ /var/opt/recovery/var/yp

When you create a flar archive after running this script, it will include this directory in the archive, thus a newly installed machine with this flash archive will have this directory as well. So you can use it to recover the old status of the system. The process is simple. Just do a cp -R /var/opt/recovery/* / . The process of jumpstarting the server is identical of doing a normal flash install.