ufsdump ufsrestore with ssh to/from remote system's disk/tape drive

Posted on 2008-11-18
Last Modified: 2013-12-27
Have 3 questions :

I've done :
ufsdump 0uf - /  | ssh remote_user@remote_svr "cd /oradata/bk; cat > svr1.dmp; gzip svr1.dmp*"
If I would like to recovery my svr1 in the event the root partition is corrupted/damaged, what's
the steps command to do it to ufsrestore from remote_svr:/oradata/bk/svr1.dmp.gzip?
 Kindly include "installboot" command.

The local server does not have a tape drive & I would like to ufsdump to remote_svr's tape
drive via ssh.  Is the command :
ufsdump -u0f - /var | /path/to/ssh username@remotesys "dd bs=1024 of=/dev/rmt/0cn"
Is "bs=1024" applicable to tape drive & can I use a higher value, say "bs=1048576" be
used here to increase the speed of the backup (as I've seen in disk to disk "dd", a high
value of bs  is essential to speed up backup)
 This "ufsdump+ssh" should be the equivalent of "ufsdump 0uf /dev/rmt/0cn /var" so
that in the event I could find an external SCSI tape drive, I would like to be able to just
do "ufsrestore -ivf /dev/rmt/0c . "

What's the equivalent command to restore from the backup taken in point (2) above
(using ufsrestore + ssh)
Question by:sunhux
    LVL 21

    Accepted Solution


    For (2), there's an easier way to do this: use the syntax

    ufsdump -u0f remotesys:/dev/rmt/0cn

    You need to enable trust between the two machines, the name of the local system must be included in the /.rhosts file on the remote system.

    The reverse can simply be done as a ufsrestore -f remotesys:/dev/rmt/0cn

    For (1), you need to
    a)boot from cdrom
    b)perform a "newfs" on the root if needed
    c)mount the root slice on /a and cd /a
    d)ssh remote_user@remote_svr "cd /oradata/bk; cat  svr1.dmp.gz | gunzip -c" |  ufsrestore -r

    LVL 12

    Assisted Solution

    For (2), you're quite right, writing to tape with a block size of 1024 will slow things down. However, in my experience, anything over 32k won't make an appreciable difference, and I'd be wary about using anything over 256k as not all drives/drivers will support blocks this big. In fact, a lot of systems start behaving wierdly with anything over 64k (maximum value for an unsigned word integer) so I'd stick to a blocksize of 32768 (32k) or, at max, 65536 (64k)

    Author Comment

    I still need "ufsdump" with "ssh" as  .rhosts (rsh/rlogin etc) is not allowed in
    our environment.

    So is the command below & its syntax correct :
    ufsdump 0uf - /var | /path/to/ssh username@remotesys "dd bs=32768 of=/dev/rmt/0cn"
    LVL 40

    Assisted Solution

    if you need to recover a crashed , you can not boot from cd and use ssh (unless ssh is part of the boot cd rom).

    Possibly you need to boot from cd to interactive shell then format the disk (create partitions), create file systems, then use rsh which requires the remote system to allow it and trust your system then

    rsh remote_server "cd /oradata/bk ; gunzip svr1.dmp* ; cat svr1.dmp" | ufsrestore  -xf -

    ssh user@remoteserver "dd if=/dev/rmt/0cn ibs=1024" | (cd /var ; ufsrestore xf -)
    LVL 21

    Assisted Solution


    Note that you can save a lot of time if you pipe the archive through gzip instead of unzipping the archive on disk

    ssh remote_user@remote_svr "cd /oradata/bk; cat  svr1.dmp.gz " |  gunzip -c | ufsrestore -f -

    Same for creating the archive:

    ufsdump 0uf - / | gzip -c  | ssh remote_user@remote_svr "cd /oradata/bk; cat >srv1.dmp.gz"

    Author Comment

    Thanks guys, that would be all.

    I just found out the command for Linux doing dd to a Solaris' tape drive & for my own record :
    dd if=/dev/sda2 bs=15M conv=sync,noerror | ssh remoteusr@remotesvr "dd of=/dev/rmt/0c"
    LVL 12

    Assisted Solution

    A block size of 15 Mb is ridiculously large and if the data ever needs to be recovered (eg, if there's a bad block on the tape) will mean the guaranteed loss of at least 15Mb.

    I'd strongly advise reducing the block size down to 64k.

    Assisted Solution

    you can use the following

    Take vdump from server_without_tap root "/"  on server_having_tap:
    server_having_tap% ssh -l <user> server_without_tap ufsdump of server_having_tap:/dev/rmt/0mn /
    Take vdump from server_without_tap root "/<partition>"  on server_having_tap:            
    server_having_tap% ssh -l <user> server_without_tap ufsdump of server_having_tap:/dev/rmt/0mn /<partition>
    Take vdump from server_having_tap root "/" on server_having_tap:
    server_having_tap% ufsdump  of server_having_tap:/dev/rmt/0mn /
    Good luck                  


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
    I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    This tutorial goes over how to archive and restore FreeBSD jails that are managed by ezjail.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now