Taking a Snapshot-based Backup
The following procedure describes how to take a snapshot-based backup. The values shown in the procedure are examples.
1.Prepare a destination to hold the backup, as follows. The destination can be a large, writable NFS location. The NFS location should be large enough to hold the backup tar files. For uncustomized partitions, 145 GB should be adequate.
a.Create a mount point for the NFS share using the following command:
mkdir -p /root/tar
b.Mount the NFS location using the following command:
mount -t nfs -o ro,intr,soft,proto=tcp,nolock ip_address:/nfs_location/ /root/tar
In the preceding command, ip_address is the IP address of the NFS server, and nfs_location is the NFS location.
2.Take a snapshot-based backup of the / (root), /u01, and /boot directories, as follows:
a.Create a snapshot named root_snap for the root directory using the following command:
lvcreate -L1G -s -n root_snap /dev/VGExaDb/LVDbSys1
b.Label the snapshot using the following command:
e2label /dev/VGExaDb/root_snap DBSYS_SNAP
c.Mount the snapshot using the following commands:
mkdir /root/mnt
mount /dev/VGExaDb/root_snap /root/mnt -t ext3
d.Create a snapshot named u01_snap for the /u01 directory using the following command:
lvcreate -L5G -s -n u01_snap /dev/VGExaDb/LVDbOra1
e.Label the snapshot using the following command:
e2label /dev/VGExaDb/u01_snap DBORA_SNAP
f.Mount the snapshot using the following commands:
mkdir -p /root/mnt/u01
mount /dev/VGExaDb/u01_snap /root/mnt/u01 -t ext3
g.Change to the directory for the backup using the following command:
cd /root/mnt
h.Create the backup file using one of the following commands:
–System does not have NFS mount points:
# tar -pjcvf /root/tar/mybackup.tar.bz2 * /boot –exclude \
tar/mybackup.tar.bz2 > /tmp/backup_tar.stdout 2> /tmp/backup_tar.stderr
–System has NFS mount points:
# tar -pjcvf /root/tar/mybackup.tar.bz2 * /boot –exclude \
tar/mybackup.tar.bz2 –exclude nfs_mount_points > \
/tmp/backup_tar.stdout 2> /tmp/backup_tar.stderr
In the preceding command, nfs_mount_points are the NFS mount points. Excluding the mount points prevents the generation of large files and long backup times.
i.Check the /tmp/backup_tar.stderr file for any significant errors. Errors about failing to tar open sockets, and other similar errors, can be ignored.
3.Unmount the snapshots and remove the snapshots for the root and /01 directories using the following commands:
cd /
umount /root/mnt/u01
umount /root/mnt
/bin/rm -rf /root/mnt
lvremove /dev/VGExaDb/u01_snap
lvremove /dev/VGExaDb/root_snap
4.Unmount the NFS share using the following command:
umount /root/tar