freebsd-dev/sys/geom
Kirk McKusick fb14e73cb4 Normally when an attempt is made to mount a UFS/FFS filesystem whose
superblock has a check-hash error, an error message noting the
superblock check-hash failure is printed and the mount fails. The
administrator then runs fsck to repair the filesystem and when
successful, the filesystem can once again be mounted.

This approach fails if the filesystem in question is a root filesystem
from which you are trying to boot. Here, the loader fails when trying
to access the filesystem to get the kernel to boot. So it is necessary
to allow the loader to ignore the superblock check-hash error and make
a best effort to read the kernel. The filesystem may be suffiently
corrupted that the read attempt fails, but there is no harm in trying
since the loader makes no attempt to write to the filesystem.

Once the kernel is loaded and starts to run, it attempts to mount its
root filesystem. Once again, failure means that it breaks to its prompt
to ask where to get its root filesystem. Unless you have an alternate
root filesystem, you are stuck.

Since the root filesystem is initially mounted read-only, it is
safe to make an attempt to mount the root filesystem with the failed
superblock check-hash. Thus, when asked to mount a root filesystem
with a failed superblock check-hash, the kernel prints a warning
message that the root filesystem superblock check-hash needs repair,
but notes that it is ignoring the error and proceeding. It does
mark the filesystem as needing an fsck which prevents it from being
enabled for writing until fsck has been run on it. The net effect
is that the reboot fails to single user, but at least at that point
the administrator has the tools at hand to fix the problem.

Reported by:    Rick Macklem (rmacklem@)
Discussed with: Warner Losh (imp@)
Sponsored by:   Netflix
2018-12-06 00:09:39 +00:00
..
bde Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
cache Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
concat Have gconcat advertise delete support if one of its disks does. 2018-10-30 00:22:14 +00:00
eli Restore backward compatibility for "attach" verb. 2018-10-27 03:37:14 +00:00
gate geom_gate: enable resize 2018-07-13 07:08:06 +00:00
journal Normally when an attempt is made to mount a UFS/FFS filesystem whose 2018-12-06 00:09:39 +00:00
label Normally when an attempt is made to mount a UFS/FFS filesystem whose 2018-12-06 00:09:39 +00:00
linux_lvm Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
mirror Remove a redundant assertion. 2018-05-06 00:05:03 +00:00
mountver Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
multipath Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
nop Extend stripeoffset and stripesize of GEOMs from u_int to off_t 2018-10-27 16:14:42 +00:00
part Add a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr 2018-11-27 14:58:19 +00:00
raid Extend stripeoffset and stripesize of GEOMs from u_int to off_t 2018-10-27 16:14:42 +00:00
raid3 Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
sched sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
shsec Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
stripe Extend stripeoffset and stripesize of GEOMs from u_int to off_t 2018-10-27 16:14:42 +00:00
uzip Extend stripeoffset and stripesize of GEOMs from u_int to off_t 2018-10-27 16:14:42 +00:00
vinum Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
virstor Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
zero Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
geom_bsd_enc.c sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_bsd.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
geom_ccd.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
geom_ctl.c sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_ctl.h sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_dev.c Another attempt to fix issue with the DIOCGDELETE ioctl(2) not 2018-12-04 21:48:56 +00:00
geom_disk.c geom_disk / scsi_da: deny opening write-protected disks for writing 2018-01-15 11:20:00 +00:00
geom_disk.h Extend stripeoffset and stripesize of GEOMs from u_int to off_t 2018-10-27 16:14:42 +00:00
geom_dump.c Extend stripeoffset and stripesize of GEOMs from u_int to off_t 2018-10-27 16:14:42 +00:00
geom_event.c Instrument "boot holds" for the benefit of the TSLOG framework. These 2017-12-31 09:23:52 +00:00
geom_flashmap.c sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_fox.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
geom_int.h sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_io.c Revert r340187, it breaks EOD (end-of-device) detection logic. Turns out, 2018-11-07 16:28:09 +00:00
geom_kern.c sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_map.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
geom_mbr_enc.c sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_mbr.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
geom_redboot.c Extend stripeoffset and stripesize of GEOMs from u_int to off_t 2018-10-27 16:14:42 +00:00
geom_slice.c sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_slice.h sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_subr.c Extend stripeoffset and stripesize of GEOMs from u_int to off_t 2018-10-27 16:14:42 +00:00
geom_sunlabel_enc.c sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_sunlabel.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
geom_vfs.c sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_vfs.h sys/geom: adoption of SPDX licensing ID tags. 2017-11-27 15:17:37 +00:00
geom_vol_ffs.c Annotate geom modules with MODULE_VERSION 2018-04-10 19:18:16 +00:00
geom.h Extend stripeoffset and stripesize of GEOMs from u_int to off_t 2018-10-27 16:14:42 +00:00
notes