Dump
Joshua Oreman
oremanj at get-linux.org
Mon Sep 1 08:35:54 PDT 2003
On Mon, Sep 01, 2003 at 10:15:08AM -0400 or thereabouts, Michael Alestock wrote:
> I had a question....
>
> I have 4 filesystems that I want to dump(8) to my SCSI Tape backup drive
> (Travan 4GB uncompressed). The filesystems are, "/", "/usr", "/var", and
> "/usr/home." All four filesystems equal about 2.5Gigs of data.
>
> I dumped the first filesystem "/" by executing, "dump -0uf /dev/sa0 / "
> ....then executed, "mt -f /dev/sa0 eom" to move the tape to the end of the
> backup (to append to the tape), then dumped the second filesystem (/usr)
> using,"dump -0uf /dev/sa0 /usr". Then once again I executed, "mt -f
> /dev/sa0" to move the tape to the end (to append to it).
>
> When I go to execute, "restore -if /dev/sa0" to confirm that both filesystems
> were saved so far, there's only ONE filesystem saved to the tape "/". I
> can't 'cd' to /var because it's not on the tape. What am I doing wrong??? I
> know I still have plenty of tape left to save other filesystems, but it's not
> dumping anything after the first filesystem.
>
> Any ideas as to what I'm doing wrong??
First, no need to run eom.
So backup goes like this:
# for FS in / /usr /usr/home /var; do
> dump -0uf /dev/sa0 $FS
> done && mt -f /dev/sa0 rewind
To restore, you have to skip the tape to the correct position (read up on mt fsf).
Then you can run `restore if /dev/sa0' to get files from *THAT PARTITION ONLY*.
So if you wanted to restore a file in / but not /var or /usr (assuming rewound tape),
do:
# restore -if /dev/sa0
like you tried.
To restore a file on /usr (assuming above order) on a rewound tape, do:
# mt -f /dev/sa0 fsf
# restore -if /dev/sa0
To restore a file on /usr/home, rewound tape, do `fsf 2'.
To restore a file on /var and rewound tape, use `fsf 3'.
To rewind the tape:
# mt -f /dev/sa0 rewind
It may be useful to keep a catalog as the first file on the tape. So you might want to
do something like this before a backup of multiple file systems on one tape:
# mt -f /dev/sa0 erase # CAREFUL! this erases previous backup!
# dd of=/dev/sa0 <<EOF
Backup of `hostname` made on `date +%D`
sector 0: this catalog
fsf 1: /
fsf 2: /usr
fsf 3: /usr/home
fsf 4: /var
EOF
# dump 0uf /dev/sa0 /
# dump 0uf /dev/sa0 /usr
# dump 0uf /dev/sa0 /usr/home
# dump 0uf /dev/sa0 /var
# mt -f /dev/sa0 rewind
Using this kind of thing, you can see exactly where each backup is located.
To get to a certain backup, do:
# mt -f /dev/sa0 rewind
# dd if=/dev/sa0
<catalog will be output>
<assumes you want to restore a file from /usr/home, fsf 3>
# mt -f /dev/sa0 fsf 3
# cd /usr/home
# restore if /dev/sa0
Note that when restoring a file system other than /, paths are relative to the
root of that filesystem. So, for example, if you're restoring from /usr backup,
then /usr/X11R6 is actually /X11R6. /home will be there, but empty (it's a mount
point).
Also, in the above catalog, file numbers really start at 1; I was simplifying it
so it would be easy to see exactly what you need to give to mt.
-- Josh
>
>
> Thanks,
>
> >>> Michael
>
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions
mailing list