Header RSS Feed
 
If you only want to see the articles of a certain category, please click on the desired category below:
ALL Android Backup BSD Database Hacks Hardware Internet Linux Mail MySQL Monitoring Network Personal PHP Proxy Shell Solaris Unix Virtualization VMware Windows Wyse

FreeBSD Disaster Recovery with mfsBSD and ufs dumps
Thursday - Jan 24th 2013 - by - (0 comments)

This week wasn't calm - at least hardware crash isn't a big help to reach a certain point in meditation. But it's always a good opportunity to run disaster recovery procedures and learn new things.

The following steps explain how to do a disaster recovery on a crashed FreeBSD system by using ufs dumps. It is of course a requirement, that the file systems are ufs and that you have a ufs dump as backup lying around...

1) Install the same FreeBSD version as previously on the system (in this case it was FreeBSD 9.0). If this information is around, create the same partition sizes and names as on the original system.

2) Boot from mfsBSD (http://mfsbsd.vx.sk). root password is "mfsroot".

3) Configure the network interface, so you are able to mount the backup server via NFS:

ifconfig bce0 192.168.12.30 netmask 255.255.255.0
mount 192.168.12.50:/backups /mnt

4) Format the local partitions (created on step 1 at the installation). In my case I had separate partitions for root, var, usr and swap. The swap partition doesn't need to be formatted and restored of course...

newfs -U /dev/da0p2
newfs -U /dev/da0p4
newfs -U /dev/da0p5

5) Now for each file system to restore, you have to mount the partition and launch the restore from the ufs dump:

mkdir /mnt2
mount /dev/da0p2 /mnt2
cd /mnt2
restore -rf /mnt/myserver/ufs-dumps/root.dump-0
umount /mnt2

Proceed with the next file system to restore.

6 - might not be necessary)
This is it, but one thing needs to be verified: Is the restored fstab file correct? Does it match the new partition table? In my case, there was a difference as the old system was set up with so-called FreeBSD slices:

mount /dev/da0p2 /mnt2
cat /mnt2/etc/fstab

# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/da0s1b             none            swap    sw              0       0
/dev/da0s1a             /               ufs     rw              1       1
/dev/da0s1f             /usr            ufs     rw              2       2
/dev/da0s1d             /var            ufs     rw              2       2

This file needs to be changed to match the mount points with the new partition names:

cat /mnt2/etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/da0p3              none            swap    sw              0       0
/dev/da0p2              /               ufs     rw              1       1
/dev/da0p5              /usr            ufs     rw              2       2
/dev/da0p4              /var            ufs     rw              2       2


7) Now reboot and the original FreeBSD system should boot up.

 

Add a comment

Show form to leave a comment

Comments (newest first):

No comments yet.

Go to Homepage home
Linux Howtos how to's
Monitoring Plugins monitoring plugins
Links links

Valid HTML 4.01 Transitional
Valid CSS!
[Valid RSS]

6937 Days
until Death of Computers
Why?