SUMMARY: ufsdump and ufsrestore

From: Bruce Shaw (Bruce.Shaw_at_gov.ab.ca)
Date: 06/24/05

  • Next message: John DiMarco: "IMPORTANT: Read this before posting to Sun-Managers"
    To: "'sunmanagers@sunmanagers.org'" <sunmanagers@sunmanagers.org>
    Date: Thu, 23 Jun 2005 17:24:00 -0600
    
    

    > I need a simple script to dump a server mirrored with solstice disksuite
    to
    > tape, then demonstrate how to recover it to a new disk.
    >
    > I'm dumping using this:
    >
    > ufsdump 0uf /dev/rmt/0hn /
    > ufsdump 0uf /dev/rmt/0hn /var
    > ufsdump 0uf /dev/rmt/0hn /opt
    > ufsdump 0uf /dev/rmt/0h /usr
    >
    > The tape successfully rewinds at the end.
    >
    > Then I tried this script to see what's on the tape:
    >
    > ufsrestore tvf /dev/rmt/0hn > /root.txt
    > ufsrestore tvsf /dev/rmt/0hn 2 > /var.txt
    > ufsrestore tvsf /dev/rmt/0hn 3 > /opt.txt
    > ufsrestore tvsf /dev/rmt/0h 4 > /usr.txt
    >
    > The script crashed saying:
    >
    > # ./fullrest.sh
    > ioctl MTFSF: I/O error
    > Mount volume 2
    > then enter volume name (default: /dev/rmt/0hn) ^Cufsrestore interrupted,
    > continue? [yn] n
    >
    > The root.txt file contains the contents of /var
    >
    > so obviously something's wrong.
    >
    > I've tried fiddling with mt commands to no effect. I've also tried
    leaving
    > off the "s" parameter and just trusting the order on the tape.
    >
    > What am I doing wrong?

    What I'm doing wrong is making things too complicated and using ufsrestore
    incorrectly.

    > ufsrestore tvsf /dev/rmt/0h 4 > /usr.txt

    Should read:

    ufsrestore tvfs /dev/rmt/0h 4 > /usr.txt

    ...but that's still too complicated. I broke it into two scripts.

    $ more fullback.sh
    #!/bin/sh
    echo "rewinding tape"
    mt -f /dev/rmt/0 rewind
    echo "backing up root"
    ufsdump 0uf /dev/rmt/0hn /
    echo "backing up var"
    ufsdump 0uf /dev/rmt/0hn /var
    echo "backing up opt"
    ufsdump 0uf /dev/rmt/0hn /opt
    echo "backing up usr"
    ufsdump 0uf /dev/rmt/0hn /usr
    echo "rewinding tape"
    mt -f /dev/rmt/0 rewind

    $ more fulltest.sh
    #!/bin/sh
    echo "moving tape to beginning"
    mt -f /dev/rmt/0 rewind
    echo "testing restoring root"
    ufsrestore tvf /dev/rmt/0hn > /root.txt
    echo "testing restoring var"
    ufsrestore tvf /dev/rmt/0hn > /var.txt
    echo "testing restoring opt"
    ufsrestore tvf /dev/rmt/0hn > /opt.txt
    echo "testing restoring usr
    ufsrestore tvf /dev/rmt/0hn > /usr.txt
    echo "rewinding"
    mt -f /dev/rmt/0 rewind

    Later on I can get fancy using "mt" with "afs" to position the tape.

    Thanks to:

    Darren Dunham, Alexandre Wanderley, Rich Kulawiec, Peter Stokes, Ric
    Anderson, Kevin Gallagher, John Benjamins, Ray Brownrigg (I think I got
    everybody)

    and

    Sal Serafino, who sent a long explanation (and sample scripts) of some of
    the finer points of the two commands

    and

    Cesare Tensi, who also pointed out that I could break my mirrors, back up
    the detached concat/slices, then reattach and resync.

    -- 
    This communication is intended for the use of the recipient to which it is
    addressed, and may contain confidential, personal and or privileged
    information. Please contact us immediately if you are not the intended
    recipient of this communication, and do not copy, distribute, or take action
    relying on it. Any communication received in error, or subsequent reply,
    should be deleted or destroyed.
    _______________________________________________
    sunmanagers mailing list
    sunmanagers@sunmanagers.org
    http://www.sunmanagers.org/mailman/listinfo/sunmanagers
    

  • Next message: John DiMarco: "IMPORTANT: Read this before posting to Sun-Managers"

    Relevant Pages

    • Ripping Tapes with Linux--How To
      ... the full script is located in the BASH ... My tape player is a portable style journalist's recorder from the ... The most irritating part of the recording process was setting the ... echo Starting de-noise procedure to file $TMP1 ...
      (comp.os.linux.misc)
    • Re: tape command for solaris 8
      ... >> Well to answer number one, how do you want to write to tape? ... > I do not want the tape to rewind after you write to it. ... # setenv each of these variables if the corresponding filesystem ...
      (comp.unix.solaris)
    • Re: tape command for solaris 8
      ... >> Well to answer number one, how do you want to write to tape? ... > I do not want the tape to rewind after you write to it. ... # setenv each of these variables if the corresponding filesystem ...
      (comp.sys.sun.admin)
    • Re: Legato question about tape redundancy
      ... Ok I decided to write a script just to rotate the tapes each ... time a backup runs- incremental or full, it stores the tape volume it ... echo "\nError..looks like a backup is running. ... Exit now.\n" ...
      (comp.unix.solaris)
    • Re: Backup program on FreeBSD for DLT drive
      ... I am using a FreeBSD server 7.0 as a Samba server and wanted to backup this ... server using Quantum DLT tape. ... #Rewind the tape ... echo "$$" ...
      (freebsd-questions)