Backing Up to the /altroot Partition

You can lose most of your partitions and still hope to recover the rest of the system. If you lose your root filesystem, however, recovery becomes a much more difficult task. While you could back up critical files from /etc and use them to restore your system, OpenBSD provides the /altroot partition as an easy way to automatically duplicate the root partition on a second disk.

An emergency root partition on a second disk gives you an easier path to recovery in the event of a disk failure. Booting to the second disk lets you pull any data off that disk, and possibly even from undamaged partitions on the first disk, before replacing the failed disk. There’s no reason to back up your root partition to the same disk, however, as the whole disk will probably be unusable.

This backup requires a free disk partition the same size as your root partition, located on a different disk. The OpenBSD installer defaults assume that you have only one disk. If you have a second disk during installation, you need to use a custom install process to create the /altroot partition, as we did in the multiple disk installation in Chapter 3. While configuring partitions is easiest during the installation, you can add more disks later if needed, as discussed in Chapter 8.

Your /altroot partition needs an /etc/fstab entry. If you created the partition during the install process, that /etc/fstab entry already exists but has the wrong mount type. If you created this partition after installation, you’ll need to create an /etc/fstab entry yourself. The /altroot partition needs a mount type of xx, as shown here:

a914f9a264fa64e6.a /altroot ffs xx 0 0

You cannot mount this partition from its /etc/fstab entry, as xx is not a valid mount type. (You could run, say, mount /dev/sd1a /altroot if you want to manually mount this partition.) The daily system maintenance job /etc/daily uses this mount option to identify the root backup partition.

To enable the /altroot backup, add ROOTBACKUP=1 to your /etc/daily.local file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.129.90