Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ufsrestore all the dump file in order to restore the system fully ?

Status
Not open for further replies.

SimonPeh

MIS
Sep 11, 2002
96
SG
Hi,

I'm trying to restore a whole system from a V440 to E450 to use it as a recovery server or DR server.

Would be very grateful if my queries can be answered.

1. Does all the dump files using ufsdump such as /opt, /oracle and etc need to be restore totall before the server can be boot up ? or just need to restore the root / and /usr ? I was trying to just restore only root and /usr and then reboot but somehow when rebooting it doesnt works at all. (Well, restoring only / and /usr works for digital unix). I need to edit the /etc/vfstab too as it is an entirely different server.

2. Accidentally, did a newfs on the swap partition \dev\dsk\c0t0d0s1 ? ... any way to make the partition for the swap partition to be raw again ? Do a format again and re-label it ?

3. Can I do a raid0 (stripe/concatenate) on 2 different type of hard disks such as on a 9.1 GB and a 4.2 or a 18.2 GB.

Thanks for any advise.
 
1. You will need the / /etc /var /opt and /usr. Keep in mind, this restore may not work. Since you are moving the your files from one server to a totally different server type, the disk device paths may give you problems. Not sure if a reconfiguration boot will fix it because the OS may not be able to find the boot partition to start the boot process.

2. I don't think it matters. But, I could be wrong.

3. Yes.
 
IMHO you might be as well re-installing a basic config using the original CDs then ufsrestore the parts of the system you need.
 
Hi, I have done this successfully, but it's quite complicated - here are my notes, based on root and var partitions only.
Some of this may be more detailed than you need.

Regards, Mike

· Boot from the Solaris8 cd.
· Configure and restore root and var file systems
· Boot from the recovered Unix system.
· Configure the remaining disks and restore all remaining data.
· Boot to normal running in multi-user mode.


Select a boot disk. Usually c0t0d0. Set up slices on this disk for root, var and swap, and any other file systems. See ‘df –k’ from the source machine for sizes. swap is 2 or 3 time RAM – exact figure is not critical.
EG root slice 0 3Gb
swap slice 1 9 Gb
var slice 3 500 Mb
Note slice 2 is normally left as a ‘backup’ slice. (Not used )

On the remaining disks, allocate disk partitions to disks, depending on the disk sizes.

Check these figures against the ‘df –k’ listing from the source machine.

Boot from cd (into Single user )
insert Solaris8 Software (1 of 2) cd
boot cdrom -s
Select option ‘Exit to single user shell’
“Do you want to format disk……”
Select ‘No, exit to single user shell’

Set up root, var, swap

List available disks (not tested when booted from cd)
iostat –En

These notes assume that the root disk is c0t0d0.

Format the root disk.
Use the format command. Use the partition sizes from the df –k (or prtvtoc output) listing to create root, swap and var partitions. The root partition should be c0t0d0s0, c0t0d0s1 should be a swap partition and c0t0d0s3 should be the var partition.


Build ufs file-systems on root and var partition, not on the swap slice.

newfs /dev/dsk/c0t0d0s0
newfs /dev/dsk/c0t0d0s3

Install boot block on root partition.
cd /usr/platform/sun4u/lib/fs/ufs
installboot bootblk /dev/rdsk/c0t0d0s0

mount root on /mnt
mount var on /mnt/var

restore root and /var
It is not possible to give precise commands to do this. Use a combination of these for ufs restore.
mt -f /dev/rmt/0 rewind rewinds the tape
dd if=/dev/rmt/0 Check tape contents – reads file 0 on tape, so this should follow a rewind.
cd /mnt NB ufsrestore command will restore
into current directory.
mt -f /dev/rmt/0n fsf 1 Wind tape forward by 1 file.
mt -f /dev/rmt/0n asf N Wind tape forward to absolute file
position N.

ufsrestore rf /dev/rmt/0cbn restore root current file into current directory
Note that restore is very slow when system is booted from cd - root restore up to 2.5 hours.

cd /mnt/var
ufsrestore rf /dev/rmt/0cbn restore var (having set tape to
correct position)

ufsrestore if /dev/rmt/0cbn Interactive restore.

EG You are restoring root (file 1 on tape) into /mnt (the newly created file-system)
cd /mnt
Load tape
mt -f /dev/rmt/0 rewind To start at the beginning.
dd if=/dev/rmt/0 To Print an index. Tells you that
root (/) is tape file 1, and /var is tape file 2.
mt -f /dev/rmt/0n asf 1 Go to tape file 1
ufsrestore if /dev/rmt/0cbn See “man ufsrestore” for details.
ls Shows files on tape.
add . Tapes to be restored have to be selected first, with the
add command. “add .” adds everything, “del abc”
removes abc from the list. The files to be restored are marked with “*” characters. In this case, add everything, then remove lost+found from the list.
add .
del lost+found
ls to check

When the list is correct, “extract” will start the restore. To the question “Specify next volume £: “, answer “1”.
When the restore is complete, ufsrestore asks “set owner/mode for '.'? [yn]”. Answer “n”. (or “y” – it doesn’t seem to matter much)

quit.
cd to the next file-system, and wind the tape to the next tape file you want to restore, and run ufsrestore again.


Set up devices for the ‘new’ hardware.

Backup /mnt/devices/pseudo
cd /mnt/device
mv pseudo pseudo.today
Remove all directories (everything) in /mnt/devices except pseudo.today
Remove entries in /mnt/dev/dsk,
/mnt/dev/rdsk,
/mnt/dev/rmt.
Remove /mnt/etc/path_to_inst
Recreate config info
drvconfig –p /mnt/etc/path_to_inst
Double check for missing devices
cd /devices
find . –print|cpio –pdum /mnt/devices
Replace new pseudo with original
cd /mnt/devices
mv pseudo.today pseudo
Recreate /dev entries
disks –r /mnt
devlinks –r /mnt
ports –r /mnt
tapes –r /mnt
Edit inittab
cd /mnt/etc
vi inittab – change default run level to 2
Edit vfstab
cd /mnt/etc
comment out entries for data file systems
Change root and var entries to match partitions created earlier.
Unmount root and var
cd /
umount /mnt/var
umount /mnt
Check file systems are clean
fsck /dev/dsk/c0t0d0s0
fsck /dev/dsk/c0t0d0s3

Load system from recovered root file systems.

uadmin 2 0 drop out to prom
Check devalias
printenv should show correct boot device (probably c0t0d0s0)
Recovery reboot to single user (from c0t0d0s0)
boot -rs

Note – There is a known Solaris bug whereby sometimes- but not always – solaris will change the root disk entry in /etc/vfstab. If the system will not boot ( error messages relate to a read-only root disk, and derived write errors ), boot from the cd and correct the entries in vfstab. (This does not always happen)

Note – You are now running on the recovered root file system

Set up remaining file systems
Check your current df –k listing from the source machine.

format disks
Use ‘format’ command
Create file systems.
use newfs
restore file systems
Use these commands.
Rewind the tape: mt –f /dev/rmt/0
Move tape forward to file1 mt –f /dev/rmt/0n fsf 1
Recover current tape file into current directory:
ufsrestore rvf /dev/rmt/0cbn
Rewind and offline tape: mt –f /dev/rmt/0 rewoffl


When all required file system are created and recovered,
Edit /etc/vfstab – change the disks and slices to the correct values, and uncomment the required lines,

Mount filesystems as detailed in /etc/vfstab:
mountall

 
Thanks Mikejordan for taking so much time to write such a long detail writeup on how to go about doing it. Will definitely try it out. I hope the raido(stripe) can be done in single user mode too as the harddisks are those older type in 4.2, 9.1 and 18 GB. Well, it;s a challenge !

Have to change the boot-device from OK prompt to boot from c0t0d0s0.

I need to restore using ufsrestore instead of the CD because the system is running Oracle and which i believe is very sensitive to the time stamps in the system else Oracle cant startup at all.

Die die have to ufsrestore somehow. I believe AIX will be much simpler. =)

Thank you very much guys. Will keep you guys post on how it turns out.
 
You will have to install the boot block on the device. The command will be something like:

cd /usr/platform/<your server platform>/lib/fs/ufs
installboot ./bootblk /dev/rdsk/c0t0d0s0

From the ok> prompt, you can enter the following:

setenv boot-device disk0:a
 
As far as Oracle is concerned, all it cares about is whether all it's datafiles, control files etc are in synch, not really anything to do with the underlying OS.
 
Actuall the E450 function as a Disaster Recovery server. So to protect the data integrity, there a requirement to restore everything from the backup tape.

root /usr and /opt was restored but somehow while booting to single user mode. There's an error messenge which prevent it to go to single user mode.

mount: /dev/dsk/c0t0d0s4 or /usr, no such file or directory

This is my vfstab. Anything wrong with it ? ..

$ more /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s1 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no
-
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /usr ufs 1 no
-
/dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /opt ufs 2 yes
-
swap - /tmp tmpfs - yes -



Any advise ? Thanks.
 
Hi,
there must be something wrong with either the disk slice, or the mount point. Can you boot from the cd and mount that slice on mnt? If not, a fsck might help.

I've got oracle too - as long as you are restoring from a cold backup it should be fine once the server is ok.
Good luck.
 
yes. had tried boot from cdrom -s and mount

mount /dev/dsk/c0t0d0s0 /mnt
mount /dev/dsk/c0t0d0s4 /mnt/usr

All seem to be working. I can access the data in there /usr too.

I though there was something wrong with the disk slice and fsck the root and /usr slice lot of time but it doesnt help at all.

fsck /dev/rdsk/c0t0d0s0
fsck /dev/rdsk/c0t0d0s4

It it still showing the mount error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top