Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > Sun Solaris Administration

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 07:52 AM
Rav
 
Posts: n/a
Default restore Unix system

Hi all

We are using amanda to backup on of our unix systems which recently
had it's system disk failed...:-(

I am trying to restore the data from tape drive using ufsrestore.....

I have booted from cdrom in a single user mode and can see the tape.
I have partitoned the disk as it was on the old disk and have run
newfs on all slices......

I cannot make out what session is what part of the disk, as I need to
restore /, /opt, /usr, /home etc....is there any detailed
documentation on restoring without amanda....pls help..

have tried the following:
mt rew
mt fsf 1
dd if=/dev/rmt/0 bs=32k count=1


Any help will be much appreciated...thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 07:52 AM
Darren Dunham
 
Posts: n/a
Default Re: restore Unix system

In comp.unix.solaris Rav <ravcs@hotmail.com> wrote:
> Hi all


> We are using amanda to backup on of our unix systems which recently
> had it's system disk failed...:-(


> I am trying to restore the data from tape drive using ufsrestore.....


> I have booted from cdrom in a single user mode and can see the tape.
> I have partitoned the disk as it was on the old disk and have run
> newfs on all slices......


> I cannot make out what session is what part of the disk, as I need to
> restore /, /opt, /usr, /home etc....is there any detailed
> documentation on restoring without amanda....pls help..


> have tried the following:
> mt rew
> mt fsf 1
> dd if=/dev/rmt/0 bs=32k count=1


Why the dd if you're trying to ufsrestore?

Now that you've newfsed, mount the root slice.

# mount /dev/dsk/c0t0d0s0 /a
# cd /a
# ufsrestore rf /dev/rmt/0cbn
(wait for restore)

At this point you can examine the old /etc/vfstab (which you should keep
a copy of elsewhere to aid in "by hand" restores) to see which slices
had what other filesystems. Unless Amanda has given it to you, you'll
need to figure out which other filesystems are where on the tape. You
can use 'ufsrestore -i' and then give the "what" command to see which
filesystem is there. When you know, rewind to that file and do the
restore...

# mount /dev/dsk/c0t0d0s5 /a/usr (only an example)
# cd /a/usr
# ufsrestore rf /dev/rmt/0cbn

--
Darren Dunham ddunham@taos.com
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 07:52 AM
all mail refused
 
Posts: n/a
Default Re: restore Unix system

In article <d02bd82e.0409281453.255fe706@posting.google.com >, Rav wrote:

>I cannot make out what session is what part of the disk, as I need to
>restore /, /opt, /usr, /home etc....is there any detailed
>documentation on restoring without amanda....pls help..


Doesn't "ufsrestore tf" display anything helpful ?

This is restore on Linux; I have no Solaris here.

# restore tf testfile
Dump date: Wed Sep 29 00:03:00 2004
Dumped from: the epoch
Level 0 dump of /spare on notatla.org.uk:/dev/hda7

Actually I'm a firm believer in paper records for stuff like disk
layouts and what's on what tape.

--
Elvis Notargiacomo master AT barefaced DOT cheek
http://www.notatla.org.uk/goen/
7.031: OnACPower returned value( 0x1 ) which is Equal To 0x1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 07:52 AM
Mike Delaney
 
Posts: n/a
Default Re: restore Unix system

On Tue, 28 Sep 2004 23:01:26 GMT Darren Dunham said something similar to:
: In comp.unix.solaris Rav <ravcs@hotmail.com> wrote:
: > Hi all
:
: > We are using amanda to backup on of our unix systems which recently
: > had it's system disk failed...:-(
:
: > I am trying to restore the data from tape drive using ufsrestore.....
:
: > I have booted from cdrom in a single user mode and can see the tape.
: > I have partitoned the disk as it was on the old disk and have run
: > newfs on all slices......
:
: > I cannot make out what session is what part of the disk, as I need to
: > restore /, /opt, /usr, /home etc....is there any detailed
: > documentation on restoring without amanda....pls help..

In the amanda source distribution, there are a number of text format
documents in the docs subdirectory. One of these is named RESTORE,
and it covers several cases, including no amanda binaries avalible.

: > have tried the following:
: > mt rew
: > mt fsf 1
: > dd if=/dev/rmt/0 bs=32k count=1
:
: Why the dd if you're trying to ufsrestore?

The first block is the amanda header for the dump, which you need to
skip past as ufsrestore won't know what to do with it. However, it
is useful to us humans as well as amanda.

The following script (slightly modified from the RESTORE doc) will provide
a quick-n-dirty index of the tape:

#!/bin/sh
TAPEDEV=/dev/rmt/0cbn
a=1
while mt -f $TAPEDEV fsf 1 ; do
echo -n "$a "
dd if=$TAPEDEV bs=32k count=1 | head -1
sleep 1
a=`expr $a + 1`
done

Example output:
1 AMANDA: FILE 19971220 uri /root-sun4 lev 1 comp .gz program DUMP
2 AMANDA: FILE 19971220 uri /misc lev 1 comp .gz program DUMP
3 AMANDA: FILE 19971220 uri / lev 0 comp .gz program DUMP

Armed with that, you can then find the relavent backups on tape and
restore.

: Now that you've newfsed, mount the root slice.
:
: # mount /dev/dsk/c0t0d0s0 /a
: # cd /a
: # ufsrestore rf /dev/rmt/0cbn
: (wait for restore)

This works for a standard dump (assuming the tape is already positioned).
For an amanda dump, using our example tape index above,

# mount /dev/dsk/c0t0d0s0 /a
# cd /a
# mt -f /dev/rmt/0cbn rew
# mt -f /dev/rmt/0cbn fsf 3
# dd if=/dev/rmt/0cbn bs=32k skip=1 | gzip -d | ufsrestore rf -

will restore uri's root filesystem.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-16-2008, 07:52 AM
phn@icke-reklam.ipsec.nu
 
Posts: n/a
Default Re: restore Unix system

In comp.unix.admin Rav <ravcs@hotmail.com> wrote:
> Hi all


> We are using amanda to backup on of our unix systems which recently
> had it's system disk failed...:-(


> I am trying to restore the data from tape drive using ufsrestore.....


> I have booted from cdrom in a single user mode and can see the tape.
> I have partitoned the disk as it was on the old disk and have run
> newfs on all slices......


> I cannot make out what session is what part of the disk, as I need to
> restore /, /opt, /usr, /home etc....is there any detailed
> documentation on restoring without amanda....pls help..


> have tried the following:
> mt rew
> mt fsf 1
> dd if=/dev/rmt/0 bs=32k count=1



> Any help will be much appreciated...thanks in advance


I would recommend that you rebuild your base-system, install amanda and from
that point restores USING amanda tools :
There is a document : "/usr/local/share/amanda/RESTORE" in FreeBSD
This document was originally written by Daniel Moore
<dmoore@jeffco.k12.co.us>, on Jan 12, 1998. Substantially rewritten by
Alexandre Oliva <oliva@dcc.unicamp.br>. Additional corrections and
additions from Murf <jam@philabs.research.philips.com> and Ralf Fassel
<ralf@atg.venture.de>. It describes how to restore files backed up with
amanda either with or without amanda tools.

All these cases assume you're trying to restore a complete disk, that
is, you've replaced the lost disk with a new one, or created a new
filesystem on it. Tweaking with the arguments to restore (not
amrestore), you will be able to restore individual files.

Also, this text does not cover amrecover, a program that provides a
text user interface similar to interactive restore (restore -i), but
it allows you to select individual files to recover and automatically
determines the tapes where they were stored. The backups must be
performed with the `index' option enabled for this to work.

I considered 6 cases.
1) Client machine fails, non-system critical.
2) Client machine fails, system critical disk.
3) Server machine fails, non-system critical, non-amanda disk.
4) Server machine fails, system critical, non-amanda disk.
5) Server machine fails, non-system critical, amanda disk, with db.
6) Server machine fails, non-system critical, amanda disk, with binaries.

The server machine (machine Aaron) is solaris, the client machine
(machine Barney) is sunos.

Cases:

1) Client machine fails, non-system critical.
Example: /home fails on Barney.

First, use amadmin to find the tapes most recently used to backup the
partition.

amadmin <config> info Barney '/home$'

Current info for Barney /home:
Stats: dump rates (kps), Full: 41.1, 33.1, 38.8
Incremental: 9.5, 2.1, 24.7
compressed size, Full: 63.1%, 54.0%, 52.9%
Incremental: 43.7%, 15.5%, 47.8%
Dumps: lev datestmp tape file origK compK secs
0 19971223 Barney01 16 329947 208032 5060
1 19980108 Barney16 8 1977 864 91
2 19971222 Barney06 7 1874 672 83
3 19970926 Barney03 11 12273 3040 211

This tells us that we will need two tapes to do a full restore
(Barney01, Barney16). Note that, even if Barney06 and Barney03 are
listed, they are actually older than the full backup, so they should
not be used to restore any data.

Log into Barney. Cd to the /home directory. Insert the tape with the
level 0 dump on it into the tape drive of Aaron.

Become super-user in the client host and run (replace <amanda> with
the username under which amanda runs):

rsh -n -l <amanda> Aaron amrestore -p /dev/rmt/0cn Barney '/home\$' |
restore -ivbf 2 -

This requires client root to have login access to <amanda>@Aaron, with
a .rhosts entry (.amandahosts won't do). If you use ssh, you may be
able to type a password in order to be authenticated. Another
alternative is to start the operation in the server, and rsh to the
client. You should be the amanda user or root in the tape server and run:

amrestore -p /dev/rmt/0cn Barney '/home$' |
rsh Barney -l root /usr/etc/restore -ivbf 2 -

If you don't want to use rsh at all, you may run:

amrestore /dev/rmt/0cn Barney '/home$'

This should create a file whose name contains the hostname, directory
name, dump level and dump date of the backup. Now you have to move
this file to the client somehow: you may use NFS, rcp, ftp, floppy
disks :-), whatever. Suppose you rename that file to `home.0'. Then,
on the client, you should become root and run:

restore -ivbf 2 home.0

Repeat one of these steps, incrementing the level of the dump, until
there are no more available backups.


2) Client machine fails, system critical disk.
Example: / fails on Barney.

First of all, boot off the CD, and reinstall the system critical
partition, restoring it to vendor supplied state. Then, go through all of
Scenario 1.


3) Server machine fails, non-system critical, non-amanda disk.

Proceed just as described in Scenario 1. However, you won't have to go
through the rsh process, because you can just use amrestore to
replace the lost data directly.


4) Server machine fails, system critical, non-amanda disk.
Example: / on Aaron

First of all, boot off the CD, and reinstall the system critical
partition, restoring it to vendor supplied state.

Then, follow steps in Scenario 3.


5) Server machine fails, non-system critical, amanda disk, with db.
An example: /opt on Aaron

If the disk that the amanda database is toast, then you need to rebuild
the database. The easiest way to do it is to take the text file that you
had mailed to you via the 'amadmin export' command, and import via the
'amadmin import' command. Then you should be able to follow the steps
outlined in Scenario 4.

Note that amanda does not mail the exported database automatically;
you may add this to the crontab entry that runs amanda.

Maybe it's a good idea to print out the text files as well and store the
last 2 dumpcycles worth of paper (the disc text files might have got
toasted as well). From the paper you still are able to reconstruct where
your discs are.


6) Server machine fails, non-system critical, amanda disk, with binaries.
Example: /usr/local on Aaron

This is where things get hairy. If the disk with the amanda binaries on
it is toast, you have three options.

i) reinstall the amanda binaries from another tape, on which you have
conveniently backed up the binaries within the last couple of weeks (not
using amanda).

ii) recompile amanda, making sure not to overwrite your db files.

iii) use dd to read amanda formatted tapes. This is the option I am
going to explore most fully, because this seems the most likely to occur.

a) Find out the device name used by amanda, by looking in amanda.conf.
Turns out to be /dev/rmt/0cn for this system.

If amanda.conf isn't at hand: this must be a non-rewinding tape device
specifier (which I believe the trailing `n' stands for).

b) Look over the copy of the output of 'amadmin <config> export', and find
out which tapes /usr/local was backed up on.

c) Grab the tapes that /opt was backed up on, and stick the level 0 into
the drive. cd to /usr/local.

d) Skip the first record, which is just the tape header, by using the
appropriate tape command.

mt -f /dev/rmt/0cn fsf 1

e) Now you want to start looking for /usr/local on this tape.

dd if=/dev/rmt/0cn bs=32k skip=1 | gzip -d | /usr/sbin/ufsrestore -ivf -
This command gives us an interactive restore of this record, including
telling us what partition, what host, and what level the backup was. The
gzip -d portion of the pipe can be omitted if there was no compression.

f) If you don't find /usr/local on the first try, quit ufsrestore, and move
forward one record.
mt -f /dev/rmt/0cn fsf 1
and try the dd/restore command shown above. Do this until you find /opt
on the disk.

Another possibility: quick and dirty tape index in case you don't know
which partition /usr/local was on: (from ralf@atg.venture.de)

#!/bin/sh
TAPEDEV=</dev/nrtape>
while mt -f $TAPEDEV fsf 1 ; do
dd if=$TAPEDEV bs=32k count=1 | head -1
sleep 1
done

Example output:
AMANDA: FILE 19971220 uri /root-sun4 lev 1 comp .gz program DUMP
AMANDA: FILE 19971220 uri /misc lev 1 comp .gz program DUMP
AMANDA: FILE 19971220 uri / lev 1 comp .gz program DUMP

g) Restore the amanda binaries (what else do you need??), and then bail
out of ufsrestore. You can use amrestore, as in Scenario 3.

(end document)

I have a swedish document describing the priocedures for
a few om "my" systems, but i think the above covers ahats needed.







--
Peter Håkanson
IPSec Sverige ( At Gothenburg Riverside )
Sorry about my e-mail address, but i'm trying to keep spam out,
remove "icke-reklam" if you feel for mailing me. Thanx.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-16-2008, 07:52 AM
jimleong
 
Posts: n/a
Default Re: restore Unix system

In article <d02bd82e.0409281453.255fe706@posting.google.com >, Rav wrote:
>
> Any help will be much appreciated...thanks in advance



Don't forget to the bootblock - man installboot .

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-16-2008, 07:52 AM
Michael Paoli
 
Posts: n/a
Default Re: restore Unix system

elvis@notatla.org.uk (all mail refused) wrote in message news:<slrncljrp1.2el.elvis@notatla.org.uk>...
> Actually I'm a firm believer in paper records for stuff like disk
> layouts and what's on what tape.


I'm a firm believer in writing that data to the backup media in
a manner where it's easily utilized in most any minimal recovery
environment (no operating system installed, just system hardware,
recovery/boot media, and backup media), and on the backup media
where it's reasonably conveniently accessed (e.g. start of
first media volume in a set, or tail end of a set with
sufficiently fast seekable media).

I tend to include data such as disk layout, sizes, relative
fullness, volume management configuration, relevant hardware
details/specifications, etc. I prefer to make the recording and
inclusion of that information as automated as reasonably feasible.
I also like plopping information on the backup media that fully
describes exactly how the backups were made, and in a location
where it's conveniently readable and accessible before need to
restore the backup data proper.

Duplicate paper records and/or information recorded on backup media,
and kept in multiple distinct locations to track offsites and their
rotations is also a very good thing.

Human readable labeling of backup media is a good thing, ...
that, and/or, if the environment is large enough, enough redundancy
in distinct locations of machine readability and the necessary
equipment and such.

So, ... cover the data, and don't forget to cover the appropriate
meta-data, offsites, ... and test at least once in a while, to be
sure the over-all procedures work and there are no gaping or
largely time-consuming holes when time to restore may be important
to quite critical.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:03 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729