ufsdump and ufsrestore script

ufsdump and ufsrestore script

Post by mr_potato_h.. » Mon, 31 Jul 2000 04:00:00



HI,
   It seems that maybe I should be using ufsdump and ufsrestore to
backup files to my DLT from what everyone is telling me.  I have 2 sun
machines running solaris 7 and machine A has the tape while machine B
has the tar files, about 400M per, that need to be backed up daily.  I
currently have machine B dumping it's database to a tar file on a daily
basis.  I'd like to modify this script so it also does a remote ufsdump
to the tape drive on machine A.  I'm able to do a "ufsdump
0cuf /dev/rmt/0n <files>".

dilbert# ufsdump 0cuf /dev/rmt/0n seti
  DUMP: Writing 63 Kilobyte records
  DUMP: Date of this level 0 dump: Sun 30 Jul 2000 11:54:02 AM PDT
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c0t0d0s7 (dilbert:/u) to /dev/rmt/0n.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Estimated 19816 blocks (9.68MB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: 19780 blocks (9.66MB) on 1 volume at 1480 KB/sec
  DUMP: DUMP IS DONE
dilbert# ufsdump 0cuf /dev/rmt/0n apache
  DUMP: Writing 63 Kilobyte records
  DUMP: Date of this level 0 dump: Sun 30 Jul 2000 11:54:50 AM PDT
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c0t0d0s7 (dilbert:/u) to /dev/rmt/0n.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Estimated 10910 blocks (5.33MB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: 10834 blocks (5.29MB) on 1 volume at 1253 KB/sec
  DUMP: DUMP IS DONE
dilbert#

I do this with muliple files and I then do a "ufsrestore if /dev/rmt/0"
and I get the following:

dilbert# ufsrestore if /dev/rmt/0
Mount volume 2
then enter volume name (default: /dev/rmt/0)

I'm able to do a ufsdump on one file or directory and the do a
ufsrestore interactive and then see my one file or directory but I
can't seem to get the mulitple backup thing down.  Also, from what I
read, if I did do a mulitple ufsdump and then restore, just to see what
is on my DLT 40GB tape, I'd have to put the tape back to the last
position before I did any more dumps.  How do you do that?  Anyone got
a cool script?  Thanks in advance...

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

ufsdump and ufsrestore script

Post by Logan Sh » Mon, 31 Jul 2000 04:00:00



>   It seems that maybe I should be using ufsdump and ufsrestore to
>backup files to my DLT from what everyone is telling me.
>I'm able to do a "ufsdump >0cuf /dev/rmt/0n <files>".

  :
  :

Quote:>I do this with muliple files and I then do a "ufsrestore if /dev/rmt/0"
>and I get the following:

>dilbert# ufsrestore if /dev/rmt/0
>Mount volume 2
>then enter volume name (default: /dev/rmt/0)

You haven't mentioned rewinding the tape.  Dumping to /dev/rmt/0n will
leave the tape at the end.  Running "ufsrestore" with /dev/rmt/0
immediately after that will start with the tape at the end.  /dev/rmt/0
is the rewinding device, but it rewinds after you're done with it, not
when you start using it.

Anyway, the position the tape, use "mt".  To put it at the
beginning of the first tape file, use

        mt -f /dev/rmt/0n rewind

and to put it at the beginning of the second one, use

        mt -f /dev/rmt/0n asf 1

You can also eject it by doing

        mt -f /dev/rmt/0n offline

Actually, that won't eject it on a DLT system, but it will rewind it
and make it ready to be ejected.

Quote:>  Also, from what I
>read, if I did do a mulitple ufsdump and then restore, just to see what
>is on my DLT 40GB tape, I'd have to put the tape back to the last
>position before I did any more dumps.

Correct.  You can do that with the "mt" command.  I believe the
incantation is this:

        mt -f /dev/rmt/0n eom

Hope that helps.

  - Logan

 
 
 

ufsdump and ufsrestore script

Post by Casper H.S. Dik - Network Security Engine » Tue, 01 Aug 2000 04:00:00


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>dilbert# ufsdump 0cuf /dev/rmt/0n seti
>  DUMP: Dumping /dev/rdsk/c0t0d0s7 (dilbert:/u) to /dev/rmt/0n.

You appear to be backing up subdirectories; you should backup complete
filesystems.  (I.e., ufsdump 0cuf /dev/rmt/0n /u)

Quote:>I'm able to do a ufsdump on one file or directory and the do a
>ufsrestore interactive and then see my one file or directory but I
>can't seem to get the mulitple backup thing down.  Also, from what I
>read, if I did do a mulitple ufsdump and then restore, just to see what
>is on my DLT 40GB tape, I'd have to put the tape back to the last
>position before I did any more dumps.  How do you do that?  Anyone got
>a cool script?  Thanks in advance...

"mt eom" positions the tape at the end and you can start writing again.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

ufsdump and ufsrestore script

Post by Philip Ch » Tue, 01 Aug 2000 04:00:00




>>I'm able to do a ufsdump on one file or directory and the do a
>>ufsrestore interactive and then see my one file or directory but I
>>can't seem to get the mulitple backup thing down.  Also, from what I
>>read, if I did do a mulitple ufsdump and then restore, just to see what
>>is on my DLT 40GB tape, I'd have to put the tape back to the last
>>position before I did any more dumps.  How do you do that?  Anyone got
>>a cool script?  Thanks in advance...
>"mt eom" positions the tape at the end and you can start writing again.

When I first started (SunOS 5.2) I was warned that "mt eom" was unreliable
for positioning the tape at the end of the last dump so I manually
recorded how many dumps I did then used "mt fsf <x>".

Is "mt eom" reliable nowadays?

Philip

---=====================================================================---
 Philip Chee:  Tasek Corporation Berhad, P.O.Box 254, 30908 Ipoh, MALAYSIA

   Guard us from the she-wolf and the wolf, and guard us from the thief,
                  oh Night, and so be good for us to pass.
... Worf:*the prime directive, give the Borg MS-DOS 1.0!
---
 * 20322.16 *

 
 
 

ufsdump and ufsrestore script

Post by Marty Bac » Wed, 02 Aug 2000 04:00:00




>[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>>dilbert# ufsdump 0cuf /dev/rmt/0n seti

>>  DUMP: Dumping /dev/rdsk/c0t0d0s7 (dilbert:/u) to /dev/rmt/0n.

>You appear to be backing up subdirectories; you should backup complete
>filesystems.  (I.e., ufsdump 0cuf /dev/rmt/0n /u)

>>I'm able to do a ufsdump on one file or directory and the do a
>>ufsrestore interactive and then see my one file or directory but I
>>can't seem to get the mulitple backup thing down.  Also, from what I
>>read, if I did do a mulitple ufsdump and then restore, just to see what
>>is on my DLT 40GB tape, I'd have to put the tape back to the last
>>position before I did any more dumps.  How do you do that?  Anyone got
>>a cool script?  Thanks in advance...

>"mt eom" positions the tape at the end and you can start writing again.

Don't forget to specify the no-rewind device, otherwise after
positioning the tape at the end, it will dutifully rewind it. Use
something like: mt -f /dev/mt/0n eom

- Show quoted text -

Quote:

>Casper

 
 
 

ufsdump and ufsrestore script

Post by Marty Bac » Wed, 02 Aug 2000 04:00:00






>>>I'm able to do a ufsdump on one file or directory and the do a
>>>ufsrestore interactive and then see my one file or directory but I
>>>can't seem to get the mulitple backup thing down.  Also, from what I
>>>read, if I did do a mulitple ufsdump and then restore, just to see what
>>>is on my DLT 40GB tape, I'd have to put the tape back to the last
>>>position before I did any more dumps.  How do you do that?  Anyone got
>>>a cool script?  Thanks in advance...

>>"mt eom" positions the tape at the end and you can start writing again.

>When I first started (SunOS 5.2) I was warned that "mt eom" was unreliable
>for positioning the tape at the end of the last dump so I manually
>recorded how many dumps I did then used "mt fsf <x>".

>Is "mt eom" reliable nowadays?

>Philip

Works for me everyday (Solaris 2.6)

- Show quoted text -

>---=====================================================================---
> Philip Chee:  Tasek Corporation Berhad, P.O.Box 254, 30908 Ipoh, MALAYSIA

>   Guard us from the she-wolf and the wolf, and guard us from the thief,
>                  oh Night, and so be good for us to pass.
>... Worf:*the prime directive, give the Borg MS-DOS 1.0!
>---
> * 20322.16 *

 
 
 

1. part 1/2 of: running ufsdump under "script ufsdump.log"

The idea being to use Sun's (unix's?)  "script"-cmd to keep a record of
what rolls-off the top of the (single-user-mode) screen when
doing a multi-hour set of level-0 ufsdumps, one per
partition on the machine.

Now, I suppose doing this wouldn't be safe to have the script-log
living (and growing) on a partitfion that is *not* the one
*currently* being ufsdumped.

(Otherwise that partition's ufsdump would be, uh, worthless?
 True?)

So, I'd have to make sure to have at least *two* partitions
mounted, root and, say, "partition-b" -- which I'd arrange to
get ufsdumped *last*.

Then, until it was time to ufsdump partition-b, I could
do all the others under, say, a single

    "script /some-partition-b-dir/ufsdump.log"

, and when those n-1 partitions had been ufsdumped, exit
that script-job, and start another:

    "script /some-ROOT-partition-dir/ufsdump.log"

this time leaving partition-b "quiescent" for *its* ufsdump.

When *that's* done, I cat together the two .log-files,
and I have a record of the whole thing.

QUESTION-1: does this scheme make any sense?

QUESTION-2: would it be similarly safe(?) to run the ufsdumps
via an EMACS *shell*-window, being sure, *before* starting
up EMACS, to:

     cd /some-ROOT-partition-dir/foodir

Being in single-user mode and thus without CDE or X-11, i'd be running emacs'
via its "--no-windows" option.

  (oops: just now tried to test runing emacs like that,
  right now, when cde *is* up -- emacs comes up uses fonts,
  colors, etc, *anyway*!  I used -nw, and then added, as a
  WAG, "-t /dev/cua" too.

  So, how *do* you invoke emacs so that it thinks it's
  back in pre-Sun days, running on a glass-tty?)

----- And something apparently "off the wall": tempfs  

(Oh, I suppose I *could* use tmpfs to keep the growing log,
since if that works as advertised, it touches NO diskk.

But -- I dimly reacll some recent warning, on this newsgroup,
tot NOT use tempfs while ufsdumping -- although I forget the
reason.)

Thanks!

David

2. Netatalk / appletalk problem

3. part 2/2 of: running ufsdump under "script ufsdump.log"

4. Running X apps remotely

5. Creating mirrored machine with "ufsdump and ufsrestore"

6. Visual design tools...

7. ufsrestore from ufsdump of many volumes

8. ndc always stops

9. ufsdump, ufsrestore problem

10. ufsdump > ufsrestore ----- HELP

11. ufsrestore/ufsdump on Solaris Sparc/x86 incompatibility

12. logging the contents of a ufsdump with ufsrestore

13. ufsdump and ufsrestore to another system