PRIMECLUSTER Global File Services Configuration and Administration Guide 4.2 (Solaris(TM) Operating Environment)
Contents Index PreviousNext

Appendix B Reference Manual> B.2 Management Commands Specific to the GFS Local File System

B.2.8 sfxmkbkup(1M), sfxmkrstr(1M) - Creates a shell script for backing up

[SYNOPSIS]

sfxmkbkup [ -a ] [ -c ] [ -b n ] [ -o filename ] special | mount_point backup_dev
sfxmkbkup -e [ -c ] [ -b n ] special | mount_point
sfxmkrstr [ -a ] [ -c ] [ -b n ] [ -o filename ] special | mount_point backup_dev

[DESCRIPTION]

The sfxmkbkup command creates a shell script to obtain backup data of the GFS Local File System specified by the representative device name special or mount point mount_point.

sfxmkbkup creates two types of scripts: a backup script that backs up data for each volume with dd(1M) and a restore script that restores data for each volume with sfxddr(1M).

sfxmkrstr creates only a restore script.

Super-user authority (root) is required to execute sfxmkbkup and run shell scripts created by sfxmkbkup.

[OPTIONS]

-a

This option associates backup data for one medium when the data is output. In this case, a device indicated by no-rewind must be specified for backup_dev.

-c

This option creates a script that compresses data during a backup with compress(1) and uncompresses data when the data is restored.

-b n

Specify the block size of the backup medium in n bytes. The character string specified in this option is specified as obs during backup with dd(1M) or as ibs during restoration with sfxddr(1M). As with ibs for dd(1M), each numeric value can be suffixed by k or b, and multiplication can be indicated with x. The default is 256k.

-o filename

Specify a file name for a shell script that will be created. The backup and restore scripts are created with path names suffixed by ".bkup" and ".rstr," respectively. The default is "sfxfs."

-e

This option displays indicates the backup size. No shell script is created.

special

Specify a special file name for the representative partition of the GFS Local File System.

mount_point

This option specifies the mount point for the GFS Local File System.

backup_dev

This option specifies a backup destination device.

[EXAMPLES]

To back up the GFS Local File System to a tape unit using special file /dev/sfdsk/gfs/dsk/vol1301 as a representative partition, execute the following command:

# sfxmkbkup /dev/sfdsk/gfs/dsk/vol1301 /dev/rmt/0

The backup script below, sfxfs.bkup, is created in the current work directory.

#!/bin/sh
IBS=1024k
OBS=256k
TAPE=/dev/rmt/0
SPECS="/dev/sfdsk/gfs/rdsk/vol1301 /dev/sfdsk/gfs/rdsk/vol1401 /dev/sfdsk/gfs/rdsk/vol1501"

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."

The restore script sfxfs.rstr is as follows:

#!/bin/sh
IBS=256k
OBS=1024k
TAPE=/dev/rmt/0
SPECS="/dev/sfdsk/gfs/rdsk/vol1301 /dev/sfdsk/gfs/rdsk/vol1401 /dev/sfdsk/gfs/rdsk/vol1501"
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/sfxfs/sfxddr $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."

To back up and restore data using multiple tape drives, execute sfxmkbkup for the number of tape drives shown below, and edit the value of the SPECS variable in the shell script. Then allocate partitions to the sfxfs. bkup and sfxfs.rstr shell scripts.

# sfxmkbkup -o ex1 /dev/sfdsk/gfs/dsk/vol1301 /dev/rmt/0
# sfxmkbkup -o ex2 /dev/sfdsk/gfs/dsk/vol1301 /dev/rmt/1

To restore some partitions to a different disk from that from which the data was backed up, edit the value of the SPECS variable for the restore script. In this case, be sure to specify an exclamation point, which indicates that volume information is not checked, just before the edited special file name.

SPECS="/dev/sfdsk/gfs/rdsk/vol1301 !/dev/sfdsk/gfs/rdsk/vol2101 /dev/sfdsk/gfs/rdsk/vol1501"

[SEE ALSO]

sfxddr(1M)

[NOTES]

- If the backed-up data is restored to a disk other than the one from which the backup was made, the structure of the disk on which the data is restored must be the same as that of the original disk.
- Do not specify a partition that includes the first cylinder of the disk as the partition to which another partition data is restored. If this is done by mistake, the disk's configuration information will be destroyed and the disk will not be able to be used in the current configuration.
- Once the backed-up data has been restored into to disk other than the original one, the partition information changed with sfxadm(1M). Specify all partitions in the GFS Local File System and execute sfxadm(1M).


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2004