Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Jan 2002 20:21:16 -0500
From:      John Grimes <jegjr@erols.com>
To:        freebsd-questions@FreeBSD.ORG
Subject:   My restore saga (long)
Message-ID:  <E16La5j-0005eY-00@smtp01.mrf.mail.rcn.net>

next in thread | raw e-mail | index | archive | help
Greetings:

	I recently screwed up my FreeBSD system, but I thought recovering from this 
wouldn't be a big hassel because just before I started fooling with the 
system, I made a Level 0 dump of the whole system.  I used "dump 0u -B 
4000000 -f /dev/nrsa0 <filesystem>" to do the dumps.  Also I concatenated the 
dumps together on tape and produced a multi volume set.  Now I use a seperate 
tape(s) for each filesystem because I encountered a problem which I will 
explain later.

	First I completely wiped out my disk, repartitioned and made new file 
systems on each partition with newfs using the FreeBSD install disk, I did 
not install any software at this time.  I downloaded the tools directory from 
the net and made kernel.flp, mfsroot.flp and fixit.flp floppies.  I booted up 
from the floppies and started to try restoring the system.  

	First I noticed that there were no partitions for the my particular disk 
partitions in dev.  I was trying to restore (ad2s1(a),(e),(f),(g).)   I 
mounted /dev/ad2s1 on /mnt.  Then, I tried using restore -i.  I added 
everting and tried to extract, restore countered with a request for next 
volume.  It kept on requesting the next volume, it did not matter if I 
entered a number or spelled out the number "two" it would not accept it.  
During this process I saw a message from restore that you should start with 
the last tape and work towards the first tape.  Before I stated the I had a 
two volume set, the /usr partition spanned both tapes.  

	I restarted restore -i, inserted the second tape and tried to extract /var.  
Restore responded with an error message which stated the it got a dump date 
which was different than the dump date it expected.  The difference was 
approximately 1 hour 45 minutes.  Which is correct, because I started the 
/var dump approximately that long after I did the /usr dump.  I think there 
should be some way which I can tell "restore -i" to use that dump file any 
way.  This is the reason why I will give each partition its own tape in the 
future.

	At this point I decided to use "restore -r -s <fileno> -f  /dev/nrsa0  to 
extract /var.  After I started restore, I got an error "/ wrie failed:  file 
system full" or something to effect.  It appeared that restore was writing 
the back up to the floppy instead of the hard drive.  Now to try a different 
approach.

	I thought I could get around my predictamnet by making a custom fixit floppy 
and restore from that.  I posted a message on the comp.unix.bsd.freebsd.misc 
newsgroup requesting instructions on how to make a custom fixit floppy.  The 
reply I recieved said that I should use the "Live CD" and chroot to its mount 
point.  Good idea I thought, should of thought of that myself.

	I booted with the 4.4 "Live CD" went into the fixit mode and listed /dev.  
None of the partitions I needed were there.  Then I did "chroot /dist," 
listed dev and discovered that none of the partitions I needed were there 
either.  What next?  I tried mounting ad2s1 via the cdrom and restoring.  
Again I got the "/ write failed: /file system full" again.  I figured that 
the system was triyng to write the data to the cdrom as opposed to its 
particular partition on the disk.

Still using the "Live CD" and after some more gnashing, reading and thinking. 
 I created a unix floppy.  On the floppy I used the following commands to 
make nodes for each of the partitions i wanted:

	mknod c ad2s1a 116 131088 root:operator
	mknod c ad2s1e 116 131092 root:operator
	mknod c ad2s1f 116 131093 root:operator
	mknod c ad2s1g 116 131094 root:operator

I mouted the floppy on /tmp.  Then mounted /tmp/ad2s1a on /mnt.  Changed 
directory, inserted the tape with the / dump file on it.  Executed the 
restore -rf /devnrsa0, and it worked !!!  Now I thought my problems were 
over, but that wasn't true.  When I tried to restore any of the other 
partitions (like /usr) instead of writing to the hard drive, it wrote to the 
floppy which contained the node files.

	Again, what next? I had restored / but could not restore any of the other 
partitions.  And then the idea hit me.  This what I did:

	Rebooted into single user mode with the hard drive.

	At the prompt:
		fsck -p
		mount -u /
		mount -a -t ufs
		swapon -a ( not sure if it was needed, but it couldn't hurt)

Now I could cd to the particular mount point and restore it.  My problems 
were over and I did fully recover the system.

	It may seem that this a long rant, its not, though I was a little 
frustrated.  After all it is free software.  Now the questions:

	With my situation is there a better way of doing this?
	(I figure that I made some mistakes here, comments will be appreciated)

	How and can you generate a custom "fixit.flp."

	Should the "Live CD" contain all of the partitions (a...h) for all slices of 
	all drives?

	
John

PS Just in case ther is a mistake in my header, my email is jegjr@erols.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E16La5j-0005eY-00>