Less known Solaris Features: Point-in-time copy with AVS - Part 9: Disaster recovery

The process of syncing master and shadow is bidirectional. You can´t not only update the shadow from the master, you can update the master from the shadow as well. This is a really neat feature for diaster recovery.
Let´s assume, you tried a new version of your software. At first all is well, but a minute later the system is toast. Later you will find out, that there was a race condition in the new code, that only manifested on your production system. But you don´t know this now. And to add insult to injury, your face go white after looking into the directory.

# ls -l /mnt/testindex*<br />
-rw-r--r--   1 root     root           0 Apr 25 19:40 /mnt/testindex1<br />
-rw-r--r--   1 root     root           0 Apr 25 19:41 /mnt/testindex2

The new code killed your testindex-files. Zero bytes. And you hear the angry guy or lady from customer support shouting your name. But you were cautious, you´ve created a point-in-time copy before updating the system. So, calm down and recover before a customer support lynch mob reach your office with forks and torches. Leave the filesystem and unmount it.

# cd /<br />
# umount /mnt

Now sync the master with the slave. Yes, the other way round.

# iiadm -u m /dev/rdsk/c1d1s3<br />
Overwrite master with shadow volume? yes/no yes

Okay … after a few moments the shell prompt appears again. Now you can mount it again.

# mount /dev/dsk/c1d0s3 /mnt<br />
# cd /mnt

Let´s check our work and check the testindex files.

# ls -l /mnt/testindex*<br />
-rw------T   1 root     root        1024 Apr 25 18:11 /mnt/testindex1<br />
-rw------T   1 root     root        3072 Apr 25 19:33 /mnt/testindex2

Phew … rescued … and the lynch mob in front of your office throws the torches out of the window, directly on the car of the CEO (of course by accident ;) )