I have a USB disk listed in /etc/fstab on a Raspberry Pi 4 system; the USB disk is not root. When booting 13.1-BETA1, the system startup fails because fsck cannot open the disk device; the disk then configures shortly thereafter. I discovered that this setup worked in 13.0-RELEASE because fsck failed to open the disk, but then exited with status 3, causing /etc/rc.d/fsck to invoke root_hold_wait() from /etc/rc.subr. Once the USB bus and disk configured, fsck was re-run successfully. In 13.1-BETA1, fsck exits with a status of 8 after failing to open the disk, aborting the startup. I verified that the relevant change was in fsck by copying fsck* from 13.0 onto the 13.1 system; that combination works.
I have worked with Mike Karels to find a fix which will be committed shortly.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=2983ec0a87a18943564548c5c00c879c8db83edf commit 2983ec0a87a18943564548c5c00c879c8db83edf Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2022-03-16 18:37:15 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2022-03-16 18:37:15 +0000 Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices. The fsck_ffs(8) utility uses its internal function openfilesys() when opening a disk to be checked. This change avoids the use of pfatal() in openfilesys() which always exits with failure (exit value 8) so that the caller can choose the correct exit value. In the case of a non-existent device it should exit with value 3 which allows the startup system to wait for drives (such as those attached by USB) to come online. Reported by: karels Tested by: karels PR: 262580 MFC after: 3 days sbin/fsck_ffs/setup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=934ba51bc929ee23248353a081a4cc4327a4ec54 commit 934ba51bc929ee23248353a081a4cc4327a4ec54 Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2022-03-16 18:37:15 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2022-03-16 22:56:52 +0000 Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices. PR: 262580 Approved by: re (gjb, early MFC) (cherry picked from commit 2983ec0a87a18943564548c5c00c879c8db83edf) sbin/fsck_ffs/setup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
A commit in branch releng/13.1 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=47b50c23185bed6759e5ce1345dba45e5ca703a3 commit 47b50c23185bed6759e5ce1345dba45e5ca703a3 Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2022-03-16 18:37:15 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2022-03-16 23:14:57 +0000 Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices. PR: 262580 Approved by: re (gjb, early MFC) (cherry picked from commit 2983ec0a87a18943564548c5c00c879c8db83edf) (cherry picked from commit 934ba51bc929ee23248353a081a4cc4327a4ec54) sbin/fsck_ffs/setup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Fix has been MFC'ed to 13-stable and releng-13.1