freebsd-nq/tools
Pawel Jakub Dawidek 1ae7ff8ba6 Because ZFS boot code was very fragile in the past and real PITA to debug,
introduce zfsboottest.sh script that will verify if it will be possible to boot
from the given pool.

	# zfsboottest.sh system

Where "system" is pool name of the pool we want to boot from.

What is being verified by the script:
- Does the pool exist?
- Does it have bootfs property configured?
- Is mountpoint property of the boot dataset set to 'legacy'?

Dataset configured in bootfs property has to be mounted to perform more
checks:
- Does the /boot directory in boot dataset exist?
- Is this dataset configured as root file system in /etc/fstab or set
  in vfs.root.mountfrom variable in /boot/loader.conf?

By using zfsboottest tool the script will read all the files in /boot
directory using ZFS boot code and calculate their checksums.
Then, it will walk /boot directory using find(1) though regular file sytem
and also read all the files in /boot directory and calculate their checksums.
If any of the files cannot be looked up, read or checksum is invalid it will
be reported and booting off of this pool is probably not possible.

Some additional checks may be interesting as well. For example if the disks
contain proper pmbr and gptzfsboot code or if all expected files in /boot/
are present.

When upgrading FreeBSD, one should snapshot datasets that contain operating
system, upgrade (install new world and kernel) and use zfsboottest.sh to verify
if it will be possible to boot from new configuration. If all is good one
should upgrade boot blocks, by eg.:

	# gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1

If something is wrong, one should rollback datasets and report the problems.

MFC after:	3 days
2011-10-21 13:44:26 +00:00
..
build Add WITHOUT_UTMPX switch to the build system. 2011-06-17 21:30:21 +00:00
debugscripts Fix a couple of typos. 2010-07-30 11:58:18 +00:00
diag
kerneldoc - Update config to doxygen 1.5.2 (I use this with 1.5.9). 2009-08-24 13:10:55 +00:00
KSE
LibraryReport
regression Add regression tests for modf{,f,l}(). 2011-10-21 06:36:40 +00:00
sched
test Fix warnings and style(9) issues. 2011-03-11 17:33:31 +00:00
tools Because ZFS boot code was very fragile in the past and real PITA to debug, 2011-10-21 13:44:26 +00:00
install.sh Teach tools/install.sh the -d directory mode. 2011-02-22 08:07:17 +00:00
make_libdeps.sh - Add missing interdependencies to kerberos libraries. Some of the 2011-09-27 07:14:12 +00:00
README

$FreeBSD$

This directory tree contains tools used for the maintenance and
testing of FreeBSD.  There is no toplevel Makefile structure since
these tools are not meant to be built as part of the standard system,
though there may be individual Makefiles in some of the subdirs.

Please read the README files in the subdirs for further information.