dump/restore over ssh question

Xian ian at codepad.net
Fri May 6 08:28:44 PDT 2005


On Friday 06 May 2005 15:34, Andy Firman wrote:
> I am following this guide:
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/backup-basics.htm
>l and successfully dumped /, /usr, and /var over ssh to another box and
> called them root-back.gz, usr-back.gz, and var-back.gz.
>
> But I can't figure out the restore part.  Let's say I replace the
> harddrive and need to restore the 3 dumped filesystems.
>
> How do I go about this for my 4.11 box?
>
> What I have done so far is:
> 1. Replace the hard drive
> 2. Minimal install of 4.11 so the drive is partitioned the same as before
> 3. Copied the 3 dumped/gzipped files over ssh to the system w/new drive
> 4. Then I booted into fixit mode, and am stuck here...
>
> How do I restore the 3 filesystems?
>
> Thanks,
> Andy
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at freebsd.org"

To restore the filesystems:
Boot from a rescue disk and create the partitions of on the disk. I've never 
smashed anything badly enough to need to work out how to do this. At least 
the partitions were still there.
Then newfs the partitions. Assuming you are putting back /tmp as well. You 
will need some temp space for restore to work.
	newfs -O2 -U /dev/ad0s1a
	newfs -O2 -U /dev/ad0s1d
	newfs -O2 -U /dev/ad0s1e
	newfs -O2 -U /dev/ad0s1f

Then mount the filesystems.
	cd /mnt
	mkdir root var usr tmp
	mount /dev/ad0s1a root
	.
	.
	.
	mount /dev/ad0s1f usr

Set the temp dir so restore can use all the temp space it wants
	setenv TMPDIR /mnt/tmp

Then for each file system to be restored, cd into the right place, fetch the 
backup and restore it.
	cd /mnt/usr
	ssh BoxWithBackupsOn cat /path/to/backup | zcat | restore -rf -

It would be a wise idea to test this on another box if you can because it is 
much nicer to attempt a restore knowing it has been done before.
-- 
/Xian

"When the going gets tough, the tough take a coffee break"
unknown author


More information about the freebsd-questions mailing list