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

Posted on 2008-11-18
Medium Priority
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
  • 2
  • 2
  • 2
  • +2
LVL 22

Accepted Solution

robocat earned 800 total points
ID: 22984311

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

TapeDude earned 520 total points
ID: 22984405
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

ID: 22984472
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"
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 40

Assisted Solution

omarfarid earned 400 total points
ID: 22984484
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 22

Assisted Solution

robocat earned 800 total points
ID: 22985813

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

ID: 22991032
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

TapeDude earned 520 total points
ID: 22993511
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

nilehawk earned 280 total points
ID: 23003000
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                  


Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month15 days, 20 hours left to enroll

850 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