From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078608810454.tru64-unix-managers.marc@archive.invalid> From: Craig Silva Date: Mon, 24 Feb 1997 01:03:06 +0000 To: tru64-unix-managers Subject: SUMMARY: vdump and multiple filesets X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078608810454 Thanks again to all who helped out with this: The response was huge - must have been a real easy question :-> As it turns out what I was missing was the mt fsf "x" command used to "fast forward" through the saved filesets. I also learned that not only can you use -N to not rewind but that there is a /dev/nrmt0h non-rewinding tape device. There are some useful tape backup scripts appended to this summary which put this into practice. Original post: Can anyone suggest a way that I might get multiple filesets on to the one tape using vdump or am I limited to one per tape? Seems like an awful waste of tape if I can't :-< The responses: Michael Bradford: ------------------ This is quite simple. When doing the vdump, write to the no-rewind tape device, i.e.: vdump -f /dev/nrmt0h /usr To remove the tape from the drive use: mt offline To rewind the tape, use: mt rewind When doing restores, use the command: mt -f /dev/nrmt0h fsf n (where n is the number of filesets you wish to skip over) before using vrestore. Note: if you are going to restore multiple savesets, it is best to do a rewind and another skip forward command between each restore. ---------- Matthew Calthrop ----------------- You sure can. Just vdump each filesystem in succession. To restore (vrestore) from tape, each filesysytem you dumped is seen as a logical "file", so to restore data from the third filesystem you backed up, issue "mt rewind ; mt fsf 2", and the tape will be at the correct place for restoring. (I'm assuming that when you say "fileset", you are not referring to an advfs fileset, but rather a filesystem). -------------- Rainer Landes: -------------- you will have to use the non-rewinding tape device /dev/nrmtYh where Y is the number of the tape. Then use scu seod to get to the end of the data on tape. Then do vdump. With scu you can step through the files on tape to get to the right dump, when restoring again. ---------------- Tom Dulaney: -------------- If you vdump to /dev/nrmt0h instead of /dev/rmt0h the tape will not rewind after the dump finishes (non-rewinding magnetic tape vs. rewinding magnetic tape) The command(s) I ust to back up my system disk vdump -C0uvf /dev/nrmt0h / vdump -C0uvf /dev/nrmt0h /usr vdump -C0uvf /dev/nrmt0h /var This dumps the three system partitions onto the tape one after the other. C compresses the files as they're backed up. 0 is the dump level u stands for update the dumplog v stans for verbose. It displays the names of the files as they're being backed up. It slows things down, so I use it more for psychological reasons. f devicename routes the vdump to the proper device. If you're dumping to a rewinding magnetic tape, it is not necessary. -------------------- Christopher L. Davis: ---------------------- Here's a little script I use. Chris #! /bin/csh -f # # Usage: dovdumps [level] [directory | device | host:device] # # level ::= "0" .. "9" # device ::= "/dev/nrmt0h" # host:device ::= hostname ":" device # # Example: # # To do disk-to-disk backups to the directory /usr/users/dumps # # ./dovdumps 0 /usr/users/dumps # # To do backups to local tape # # ./dovdumps 0 /dev/nrmt0h # # To do backups to disk on a remote system # # ./dovdumps 0 csc1:/directory # # To do backups to tape on a remote system # # ./dovdumps 0 csc1:/dev/rmt/dat_driven # if ($#argv > 0) then set level=$1 else set level=0 endif set hostname=`hostname | sed 's/\..*//'` set remote=0 set device=0 if ($#argv > 1) then set output=$2 if ( "$2" =~ *:* ) then set remote=1 endif else set output="/dev/nrmt0h" endif if ( "${output}" =~ */dev* ) then set device=1 endif echo "Performing level $level dumps of system `hostname`." if ( $remote == 1 ) then echo "Doing level $level dump on device ${device}" else echo "Doing level $level dump on remote device ${device}." endif foreach part ( / \ # /usr \ # /usr/var/spool/mail \ # /usr/var/spool/news \ ) if ( "$part" == "/" ) then set namedpart="root" else set namedpart="`echo ${part} | colrm 1 1`" endif if ( $device == 0 ) then set result="${output}/`echo ${namedpart} | tr / .`.dump-${level}" else set result="$output" endif if ( $remote == 0 ) then /sbin/vdump -${level} -N -u -f ${result} $part else /usr/sbin/rdump ${level}Nnbusdf 128 6000 24000 ${result} $part endif end ---------------- Greg Merrell: ------------- Here's my backup script that I run from cron every night. Greg #!/bin/sh # PATH=/sbin:/usr/sbin:/bin:/usr/bin export PATH # # echo "**Full root" vdump -0uCN / # echo "**Full usr" clonefset usr primary backup mount usr#backup /backup/usr vdump -0uCN /backup/usr umount /backup/usr rmfset -f usr backup # echo "**Full users" clonefset users primary backup mount users#backup /backup/users vdump -0uCN /backup/users umount /backup/users rmfset -f users backup # echo "**Full var" clonefset var primary backup mount var#backup /backup/var vdump -0uCN /backup/var umount /backup/var rmfset -f var backup # echo "**Full ftp" clonefset ftp primary backup mount ftp#backup /backup/ftp vdump -0uC /backup/ftp umount /backup/ftp rmfset -f ftp backup # echo "**Defragment usr" defragment usr echo "**Defragment users" defragment users echo "**Defragment var" defragment var echo "**Defragment ftp" defragment ftp ----------- Larry Griffith: ---------------- Use the mt program. To advance one fileset (either for reading or writing), use mt fsf 1. The 1 can be replaced by other numbers. For example, here's the shell file I use to restore (I have four filesets on a tape: /usr, /, /usr/local, and /usr/users in that order; /usr is first because that's where mt itself is in case you need to restore it): #! /usr/bin/ksh PS3="Choose fileset by number --> " mt rewind select fileset in root usr local users do case "$fileset" in root) cd / mt fsf vrestore -i mt offline exit;; usr) cd /usr vrestore -i mt offline exit;; local) cd /usr/local mt fsf 2 vrestore -i mt offline exit;; users) cd /usr/users mt fsf 3 vrestore -i mt offline exit;; esac done --------------------------------------------------------- Craig Silva, Electronic Outreach Program Officer Victorian Health Promotion Foundation, Melbourne Australia e-mail: csilva@vichealth.vic.gov.au, Tel: 61 3 9345 3211 Post: PO Box 154, Carlton Sth Victoria. 3053. Australia ---------------------------------------------------------