Ufsrestore


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ufsrestore
# 1  
Old 12-04-2017
Ufsrestore

Good Afternoon,

I'm going to attempt a ufsrestore of a Solaris 9 machine from a connected NAS containing the ufsdumps. The idea is to be able to take ufsdumps of a failed machine (machine 1), and use them to set up a backup machine (machine 2). (I'm testing for disaster recovery)

Note that my backup machine (2) has already been imaged by doing a (RAID1) drive replacement on machine 1, then moving that drive to machine 2, then creating the RAID1 mirror drive on machine 2. In other words, the second machine is already a duplicate of the first, just a couple of months out of date.

Is this this what I will use or is there something simpler?:

Code:
/usr/sbin/ufsrestore i| r| R| t| x [abcdfhlmostvyLT] [archive_file] [factor] [dumpfile] [n] [label] [timeout] [ filename...]


Last edited by rbatte1; 12-05-2017 at 09:14 AM.. Reason: Changed some CODE tags to be ICODE tags to make for easier reading
# 2  
Old 12-05-2017
Normally when a disaster recovery (DR) is performed, there is nothing already installed on the system ie, bare metal. So starting with a mirror image already installed is unorthodox. Also, if the image is old there may be files on there which have now been deleted from the system, etc.

To avoid me having to repeat, read this from one of my post some time ago: (couldn't get a link to work for whatever reason so cut and paste used)

Quote:
Right then, I get the question; there could be many answers and every professional could have a different opinion. You asked for ideas to be shared so here goes.

The scenario I've faced many times is that I have a very big system with lots of non-root filesystems and tons of storage. Minimum down time is critical but suddenly the system won't boot. I just want to get the system on its feet so that I can take a look around.

Backup:
1. Create a NFS share on a remote system and mount it
2. Pick a fairly quiescent time and 'fssnap' the root filesystem (to freeze it temporarily) sending the journal ('backing_store' switch on fssnap) to one of your other local filesystems.
3. Run 'ufsdump' to backup the whole filesystem to the NFS storage.
4. Make a note of your ip interface name (eg, e1000g0 or whatever)
5. Make a note of all the VTOC's

Note that you need to gauge the frequency of doing the backup because, in the event of a recovery, new users, groups, security changes and patches will be mssing.

Recovery:
Suddenly the system won't boot so.....
1. Boot from CD into single user:
PRE { OVERFLOW: auto }

Code:
boot cdrom -s

2. Use 'format' to check disk visibility and check slicing of disks.
3. After confirming that local recovery (eg, fsck, etc) will not fix the issue, 'newfs' the root disk slice. Root filesystem is now empty.
4. Mount the new empty root filesystem under /a
5. Use 'ifconfig' to manually 'plumb', 'address' and 'up' your network interface.
6. Check that you can ping the NFS node holding your ufsdump(s)
7. Mount the remote NFS storage under /mnt
8. Change directory to the top of your hard disk (empty) root
9. 'ufsrestore' the backup from the NFS storage to the root hard disk
10. 'sync' and 'umount' the NFS storage and the root hard disk and do an orderly shutdown.
11. System should now boot.

Note that if your /usr filesystem is separate from the root filesystem you should consider backing up that for emergency recovery too since without being able to mount /usr the recovered system will probably go into maintenance if it cannot mount /usr

As I say, all professionals have their own opinion and you may well get a torrent of alternatives posted to this thread. You may also have further question about what I have written above. Feel free to ask.

You could, of course, use 'flarcreate' to create a flash of just your root disk filesystem and that is certainly a good option. The above is just the method that I have used on Solaris 10 with ufs. You can, of course, test your recovery procedure by using a dummy root slice elsewhere on the system (not the real one).

This was referring to Solaris 10 but equally applies to Solaris 9 with ufs.

If the hardware platform you are recovering to is not identical (processor type, disk controllers, network interfaces, etc) then some adjustment may need to be done after ufsrestore like modify /etc/vfstab, modify /etc/system, create new device nodes (/dev/dsk/xxxxx, for new filesystem locations), plumb in new network interfaces, etc.

NOTE: If your /usr filesystem is separate from root then you will need to restore that too otherwise the system will go into maintenance mode when it boots.

There's no substitute whatsoever for actually doing it yourself and asking the questions as you go. We're here to help.

Also, with DR planning, using flarcreate is the more supported means for DR.

Last edited by hicksd8; 12-05-2017 at 01:03 PM.. Reason: Fix non-working link
This User Gave Thanks to hicksd8 For This Post:
# 3  
Old 12-05-2017
Hi,

If the target machine is well, "up to date" or close to it.

I would be tempted to run the "ufsrestore" in interactive mode, something like;

Code:
#> ufsrestore -ivf {filename}

This will give you the option of selecting individual file or directory structures for restore.

As Hicksd8 states, you'd be better using a "FLAR" for the DR scenario or if possible SAN replication.

Regards

Gull04

Last edited by hicksd8; 12-05-2017 at 07:29 AM..
This User Gave Thanks to gull04 For This Post:
# 4  
Old 12-07-2017
Thanks..

There will be a point when I would like to be able to start from bare metal, but I'm thinking that I should first focus on this more likely (and presumably easier) scenario, since I literally have no idea how to do a ufs restore. I have verified that the clone I made can reach my NAS (via the switch), mount NAS directories, and I can remote into the clone from other machines.

My
Code:
ufsdump

s are of entire disk partitions.

I'm not sure I understand the syntax of
Code:
ufsrestore

.
Is it assumed that I will move to the destination machine's appropriate working directory and then execute the command and that the
Code:
ufsrestore {filename}

contains the files for that directory? Is it expecting an empty destination directory, should I wipe the existing files or will it overwrite?
# 5  
Old 12-07-2017
Not sure that I understand your exact question but let me elaborate.

(Assume we are restoring the main root (bootable) partition.)

Boot into single user from DVD:

Code:
ok> boot cdrom -s

At the # prompt, run format, if necessary label the disk and manipulate the VTOC (Virtual Table of Contents) to the required boundaries (that's partitions in MS talk). Write out the VTOC. Typically, use newfs to create a new ufs filesystem, and mount that new filesystem on /a mountpoint (always available on DVD's).

Change directory to the top of your new filesystem and all you can see is Lost+Found. Other than that, the filesystem is empty.

Now mount your (remote) dump file on /mnt.

Now take your previously created ufsdump file and tip the whole contents onto this new filesystem:

Code:
# ufsrestore rf /mnt/<dumpfile>

Hope that helps.
This User Gave Thanks to hicksd8 For This Post:
# 6  
Old 12-07-2017
Also do note that you will still need to write out a new bootblk to the disk if it hasn't already got one otherwise you cannot boot from that disk. The contents of the bootblk varies with machine architecture. Search this forum for how to do that. It's well documented here already.

Last edited by hicksd8; 12-07-2017 at 03:41 PM..
# 7  
Old 12-12-2017
Quote:
Originally Posted by hicksd8
[/CODE]At the # prompt, run format, if necessary label the disk and manipulate the VTOC (Virtual Table of Contents) to the required boundaries (that's partitions in MS talk). Write out the VTOC.
OK I'm at this stage. Format and label seemed to have worked fine (though I imagined it would ask me what to label it but it didn't)

I'm unfamiliar with VTOC. Using
Code:
prtvtoc /dev/rdsk/c0t0d0s2

(and on other slices) I can see the differences between my new machine and the machine that is the source of the
Code:
ufsdump

s

How do I manipulate it? Everything I read seems to point to a pipe into
Code:
fmthard

but I suspect that is skipping a step.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Ufsrestore on Solaris 9

Good Morning, I'm running through a Solaris 9 ufsrestore process on a Sunblade 2500 that folks here helped me write a year ago. Here: https://www.unix.com/303011447-post11.html Hicksd8 tells me to # rm restoresymtable. I see this file in the other slices as well. Do I remove it from... (8 Replies)
Discussion started by: Stellaman1977
8 Replies

2. Solaris

ufsrestore T5240

Hi Friends we have sun T5240 server, we have taken ufsdump of this server remotely with scsi tapedrive, If we need to do ufsrestore means what we have to do, since T5240 has not having scsi port, any procedure is there? Regards Rajasekar (5 Replies)
Discussion started by: rajasekg
5 Replies

3. Solaris

How do you ufsrestore the fast way?

hi, on my sol9 box i create my backup using the below command: /usr/sbin/ufsdump 0uf /dev/rmt/0n /u1 /usr/sbin/ufsdump 0uf /dev/rmt/0n /u2 /usr/sbin/ufsdump 0uf /dev/rmt/0n /u3 /usr/sbin/ufsdump 0uf /dev/rmt/0n /u4 now on the new sol10 box, to restore i use this commands: cd /u1... (3 Replies)
Discussion started by: pinoy43v3r
3 Replies

4. Solaris

ufsrestore will not boot

hey all, i did a ufsdump/restore from a mirrored system and i'm not able to get the new system to boot off of the dump. system 1 is a v245 mirrored with disk suite. metadb's are in place d3 -m d23 d13 d33 1 d23 1 1 c1t1d0s3 d13 1 1 c1t0d0s3 d33 1 1 c1t2d0s3 d0 -m d20 d10 d30 1 d20 1... (3 Replies)
Discussion started by: em23
3 Replies

5. Solaris

What is volume in ufsrestore

Hi Gurus, Can you guys please explain what is volume in ufsrestore? Thanks (2 Replies)
Discussion started by: kumarmani
2 Replies

6. Solaris

ufsrestore

Hi , I accidentally deleted crontab entries and I need to restore back urgently ! we use a ufsdump with 0cfu option. I like to know how to restrore / retrieve to different location for crontab file only from the backup. Thanks. (4 Replies)
Discussion started by: skully
4 Replies

7. Solaris

Using ufsdump and ufsrestore

HI Gurus, I have a sunfire V445 server running SAP ECC 6.0 with an Oracle database on Solaris 9 (SunOS 5.9). I recently completed a ufsdump to tape of the following files:- /, /usr, /oracle, /export, /sapr3, I want to restore these files from tape onto a different server of the same... (5 Replies)
Discussion started by: charleywasharo
5 Replies

8. Solaris

ufsrestore?

I'm trying to restore a server from a backup tape. I've partitioned my drive, and I've run into a problem; After extracting everything from the tape, It seems as if only the directory structure is intact. Here are my steps: 1. booted from cdrom to single user mode boot cdrom -s 2. used... (3 Replies)
Discussion started by: ECBROWN
3 Replies

9. Solaris

ufsrestore

on sparc solaris 2.8 hosts, HOSTB, after changing to /dir1 need to: connect to tape drive on HostA. change directory to /dir0/dir1 on tape and restore everything under that path to /dir1 directory. could i get help?. (1 Reply)
Discussion started by: S26+
1 Replies

10. UNIX for Dummies Questions & Answers

ufsrestore -i

Hi there, I have a problem at the moment trying to restore a directory from a Super DLT tape with about 3 weeks worth of backups on it. I need to be able to get the last backup performed on this tape but using ufsrestore -i it only restores the first backup which is no good to me. There is... (4 Replies)
Discussion started by: gerwhelan
4 Replies
Login or Register to Ask a Question