FreeBSD Disaster Recovery with mfsBSD and ufs dumps

Written by - 0 comments

Published on - Listed in BSD Unix Backup


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.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Icingaweb   Icingaweb2   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder   


Update cookies preferences