PRIMECLUSTER Global File Services Configuration and Administration Guide 4.2 (Solaris(TM) Operating Environment) |
Contents Index |
Part 3 Global File Services Shared File System | > Chapter 24 File System Backing-up and Restoring |
The sfcmkbkup command is a support tool for backing up and restoring by executing the dd command. A GFS Shared File System can be created with a multi-partition configuration. In this configuration, however, operation is complicated because the dd command must be executed several times to backup the GFS Shared File System. In addition, each backup of the multiple partitions must be restored to its correct partition during restoration. If the backups are not restored to the correct partitions, the restore may fail.
The sfcmkbkup(1M) command is a support tool that solves this problem. The sfcmkbkup(1M) command can be executed to create shell scripts for backing up and restoring a GFS Shared File System. These commands provide a safe backup and restoration process for a GFS Shared File System.
This section shows how to execute sfcmkbkup(1M) command to backup and restore a GFS Shared File System.
For details on sfcmkbkup(1M), see Appendix F.2.12, "sfcmkbkup(1M)."
Super user authority (root) is required to execute the sfcmkbkup(1M) command and run shell scripts created by the sfcmkbkup(1M) command.
Assume a GFS Shared File System has the multi-partition configuration shown below.
# sfcinfo /dev/sfdsk/gfs/dsk/volume1 FSID special size Type mount 1 /dev/sfdsk/gfs/dsk/volume1(3fa0081) 25986 META /mnt 1 /dev/sfdsk/gfs/dsk/volume1(3fa0081) 105751 DATA /mnt 1 /dev/sfdsk/gfs/dsk/volume2(3fa0082) 5120 LOG /mnt 1 /dev/sfdsk/gfs/dsk/volume3(3fa0083) 131736 DATA /mnt
To backup and restore this file system, specify the representative partition of the file system and the media device used to make the backup copy then create a shell script for the backup and restoration.
The following shows an example of creating a shell script to backup and restore the above file system using /dev/rmt/0 as the backup device.
# sfcmkbkup /dev/sfdsk/gfs/rdsk/volume1 /dev/rmt/0
After executing the sfcmkbkup(1M) command, the following two shell scripts are generated in the current working directory:
sfcfs.bkup Shell script for performing backup
sfcfs.rstr Shell script for restoring
These scripts are executed to back up or restore a file system.
The following shows the procedure to back up.
1. Set for super user.
% su #
2. Preparation of the backup media
The device size required for the backup can be estimated by using the sfcmkbkup(1M) command before performing the backup. Prepare the required medium for the backup in accordance with the estimate.
Specify the representative partition to execute the sfcmkbkup(1M) command.
# sfcmkbkup -e /dev/sfdsk/gfs/rdsk/volume1 special size(KB) /dev/sfdsk/gfs/rdsk/volume1 131760 /dev/sfdsk/gfs/rdsk/volume2 131760 /dev/sfdsk/gfs/rdsk/volume3 131760
3. Stopping the file system
Because an inconsistency occurs in the backup content when the data of file system is changed while backing up, file system to be backed up is stopped.
# sfcumntgl /dev/sfdsk/gfs/dsk/volume1
4. Execute backup
Execute backup by using the sfcfs.bkup shell script
# ./sfcfs.bkup
dd(1M) command is used in sfcfs.bkup shell script. For details on sfcfs.bkup and dd(1M), see Section 24.4.2, "Backing up an entire file system" and the "Solaris X Reference Manual Collection."
The following shows the procedure to restore.
1. Set for super user.
% su #
2. Preparation of the backup media
Prepare backup data.
If a partition is restored to one different than that of the backup source, the partition configuration at the restore destination must be the same as that at the backup source.
If a partition is restored to one different than that of the backup source, sfcfs.rstr shell script is edited to change variable SPECS. And an exclamation mark ("!") that shows that volume information is not checked is added to head of the changed special file name.
# SPECS="/dev/sfdsk/gfs/rdsk/volume1 !/dev/sfdsk/gfs/rdsk/volume2 /dev/sfdsk/gfs/rdsk/volume3"
3. Stopping the file system
File system to be restored is stopped.
# sfcumntgl /dev/sfdsk/gfs/dsk/volume1
4. Execute restoration
Execute restoration by using the sfcfs.rstr shell script
# ./sfcfs.rstr
dd(1M) command is used in sfcfs.rstr shell script. For details on sfcfs.bkup and dd(1M), see Section 24.5.2, "Restoring an entire file system", Section 24.5.3, "Setup after Restoration" and the "Solaris X Reference Manual Collection."
Contents Index |