freebsd-dev/tools
Kirk McKusick e688661642 Move the ability to search for alternate UFS superblocks from fsck_ffs(8)
into ffs_sbsearch() to allow use by other parts of the system.

Historically only fsck_ffs(8), the UFS filesystem checker, had code
to track down and use alternate UFS superblocks. Since fsdb(8) used
much of the fsck_ffs(8) implementation it had some ability to track
down alternate superblocks.

This change extracts the code to track down alternate superblocks
from fsck_ffs(8) and puts it into a new function ffs_sbsearch() in
sys/ufs/ffs/ffs_subr.c. Like ffs_sbget() and ffs_sbput() also found
in ffs_subr.c, these functions can be used directly by the kernel
subsystems. Additionally they are exported to the UFS library,
libufs(8) so that they can be used by user-level programs. The new
functions added to libufs(8) are sbfind(3) that is an alternative
to sbread(3) and sbsearch(3) that is an alternative to sbget(3).
See their manual pages for further details.

The utilities that have been changed to search for superblocks are
dumpfs(8), fsdb(8), ffsinfo(8), and fsck_ffs(8). Also, the prtblknos(8)
tool found in tools/diag/prtblknos searches for superblocks.

The UFS specific mount code uses the superblock search interface
when mounting the root filesystem and when the administrator doing
a mount(8) command specifies the force flag (-f). The standalone UFS
boot code (found in stand/libsa/ufs.c) uses the superblock search
code in the hope of being able to get the system up and running so
that fsck_ffs(8) can be used to get the filesystem cleaned up.

The following utilities have not been changed to search for
superblocks: clri(8), tunefs(8), snapinfo(8), fstyp(8), quot(8),
dump(8), fsirand(8), growfs(8), quotacheck(8), gjournal(8), and
glabel(8). When these utilities fail, they do report the cause of
the failure. The one exception is the tasting code used to try and
figure what a given disk contains. The tasting code will remain
silent so as not to put out a slew of messages as it trying to taste
every new mass storage device that shows up.

Reviewed by: kib
Reviewed by: Warner Losh
Tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D36053
Sponsored by: The FreeBSD Foundation
2022-08-13 12:43:40 -07:00
..
boot tools/boot: Fix universe.sh's ZFS exclusion test 2022-07-24 16:53:34 -06:00
bsdbox ncurses: only keep the version with widechar support 2021-01-05 14:01:32 +01:00
build libc: iconv: add mb_cur_min for encoder traits 2022-08-11 11:42:17 -05:00
bus_space Add support for Python 3 and make it the default. 2019-06-30 02:29:12 +00:00
coccinelle copystr(9): Move to deprecate (attempt #2) 2020-05-25 16:40:48 +00:00
debugscripts since kld_deb.py was removed a while back, this script isn't useful 2020-08-11 22:33:56 +00:00
diag Move the ability to search for alternate UFS superblocks from fsck_ffs(8) 2022-08-13 12:43:40 -07:00
ifnet
kerneldoc twa: Remove 2021-11-25 00:45:13 -07:00
LibraryReport
lua Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
pkgbase pkgbase: Fix a typo in a source code comment 2022-03-28 19:33:25 +02:00
regression Apply some style(9) to pthread tests 2022-03-31 21:37:57 -04:00
sched schedgraph.py: port to Python 3 2022-01-11 15:32:39 +02:00
test tools: test: iconv: fix open_2 to not segfault 2022-08-11 11:33:28 -05:00
tools Fix wrong capitalization in man page references. 2022-08-13 20:46:59 +02:00
uma/smrstress tools/uma/smrstress: fix kthread exit 2022-07-31 00:40:12 +03:00
install.sh
make_libdeps.sh
README
tinder.sh

$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.