PRIMECLUSTER Global File Services Configuration and Administration Guide 4.2 (Solaris(TM) Operating Environment) |
Contents Index |
Appendix F Reference Manual | > F.2 Management Commands Specific to the GFS Shared File System |
sfcmkbkup [ -a ] [ -c ] [ -b n ] [ -o filename ] special | mount_point backup_dev
sfcmkbkup -e [ -c ] [ -b n ] special | mount_point
sfcmkrstr [ -a ] [ -c ] [ -b n ] [ -o filename ] special | mount_point backup_dev
The sfcmkbkup command generates shell scripts for backing up the GFS Shared File System specified by the representative device name specified for special or a mount point specified for mount_point. The command generates two types of scripts: a script for backing-up and a script for restoring. The script for backing-up script creates a backup of each every volume using dd(1M). The script for restoring restores each volume using sfcddr(1M). The sfcmkrstr command generates only a script for restoring.
These commands and the scripts generated by them must be executed with super user authority (root).
The following options can be specified:
-a
Specifies one medium to which the backup output is linked. This option requires a no-rewind device to be specified as the backup_dev parameter.
-c
Generates a script by which data is compressed with compress(1) during backing-up and data is uncompressed during restoring.
-b n
Specifies the block size of the backup medium as n bytes. A character string (value) specified for this parameter is supplied as is to dd(1M) and to sfcddr(1M) as obs for backing-up and ibs for restoring. For ibs in a dd(1M) command line, k or b can be appended to the value or multiplication can be specified with x. The default is 256k.
-o filename
Specifies the file name of the shell script to be generated. A script for backing-up is generated with the path name of the specified file name, which has a ".bkup" extension. A script for restoring is generated with the path name of the specified file name, which has a ".rstr" extension. The default is "sfcfs."
-e
Displays the space required for backing-up. Does not generate a shell script.
If the -c option is specified concurrently with this option, the command displays the space required for the file system with the data compressed. For a large file system, some time may elapse before the required space is displayed.
The following operands can be specified:
special
Specifies a special file name for the representative partition of the GFS Shared File System.
mount_point
Specifies a mount point for the GFS Shared File System.
backup_dev
Specifies the device to which the backup data is transferred.
To back up the GFS Shared File System whose representative partition is the special file /dev/sfdsk/gfs/dsk/volume1 to a tape device, execute the following command.
# sfcmkbkup /dev/sfdsk/gfs/dsk/volume1 /dev/rmt/0
When the command is executed, a script for backing up with the file name sfcfs.bkup (see below) is generated in the current working directory.
#!/bin/sh IBS=1024k OBS=256k TAPE=/dev/rmt/0 SPECS="/dev/sfdsk/gfs/rdsk/volume1 /dev/sfdsk/gfs/rdsk/volume2 /dev/sfdsk/gfs/rdsk/volume3"n=`echo $SPECS | /usr/bin/wc -w` echo "It will need $n volume(s) to backup."
i=1 for s in $SPECS do echo "Backup $s" echo "Prepare volume #$i/$n for $TAPE and press RETURN:\c" read yes until /usr/bin/dd if=$s of=$TAPE ibs=$IBS obs=$OBS do echo "Press RETURN and retry:\c" read yes done i = `/usr/bin/expr $i + 1` done
echo "Backup done."
A script for restoring with the file name sfcfs.rstr is generated as shown below:
#!/bin/sh IBS=256k OBS=1024k TAPE=/dev/rmt/0 SPECS="/dev/sfdsk/gfs/rdsk/volume1 /dev/sfdsk/gfs/rdsk/volume2 /dev/sfdsk/gfs/rdsk/volume3"n=`echo $SPECS | /usr/bin/wc -w` echo "It will need $n volume(s) to restore."
i=1 for s in $SPECS do if echo $s | /usr/bin/grep "^!"; then s=`echo $s | /usr/bin/cut -c2-` opt="-f" else opt="" fi echo "Restore $s" echo "Prepare volume #$i/$n for $TAPE and press RETURN:\c" read yes until /usr/lib/fs/sfcfs/sfcddr $opt if=$TAPE of=$s ibs=$IBS obs=$OBS do echo "Change to CORRECT volume #$i/$n and press RETURN:\c" read yes done i = `/usr/bin/expr $i + 1` done
echo "Restore done."
If multiple tape drives are used for backing-up and restoring, execute sfcmkbkup once for each tape drive. Next, edit the setting of shell script variable SPECS to assign the partitions to their respective shell scripts.
# sfcmkbkup -o ex1 /dev/sfdsk/gfs/dsk/volume1 /dev/rmt/0 # sfcmkbkup -o ex2 /dev/sfdsk/gfs/dsk/volume1 /dev/rmt/1
To restore partitions to a disk that is different from the disk from which the backup was made, edit the setting of variable SPECS in the script for restoring. Type an exclamation point (!) before the edited special file name to indicate that a volume information check is not to be executed.
SPECS="/dev/sfdsk/gfs/rdsk/volume1 ! /dev/sfdsk/gfs/rdsk/volume2 /dev/sfdsk/gfs/rdsk/volume3"
compress(1) and dd(1M) in the "Solaris X Reference Manual Collection."
Contents Index |