Date: Tue, 19 Mar 2024 03:43:56 +0100 From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@FreeBSD.org> To: Jim Pazarena <fquest@paz.bz> Cc: freebsd-questions@freebsd.org Subject: Re: reboot forcing a fsck Message-ID: <86il1jgcur.fsf@ltc.des.dev> In-Reply-To: <d166ee08-3ae5-41c3-b137-b645cdac73a5@paz.bz> (Jim Pazarena's message of "Mon, 18 Mar 2024 14:08:08 -0700") References: <d166ee08-3ae5-41c3-b137-b645cdac73a5@paz.bz>
next in thread | previous in thread | raw e-mail | index | archive | help
Jim Pazarena <fquest@paz.bz> writes: > I have a server which seems to have a fs issue for my exim folder. > an "ls -l" hangs. anything going near the exim folder hangs - for > whatever reason. You say that `ls -l <path>` hangs. In addition to reading the directory itself, `ls -l` reads the metadata of every directory entry and sorts them by name. This can take a long time if there is a large number of entries. To avoid this, and make sure you're only running ls itself and not an alias or an alternate implementation, use `/bin/ls -a <path>` to get a plain listing. If that works and no entries appear to be corrupted, try `ktrace -f /tmp/ktrace.out /bin/ls -al <path>`. If that hangs, running `kdump -f /tmp/ktrace.out -tcn | tail` in another terminal will tell you where it's stuck. > If I trigger a 'reboot', I assume the boot process will automatically > enter a fsck as per the documentation. > > What is unclear is if the system will eventually g et to multi-user > mode, or hang at a CLI question from the fsck? Assuming UFS with soft updates (`sysctl -n kern.features.softupdates` should print 1), you can run `fsck_ffs -B <mountpoint>` to perform limited checks on a mounted filesystem without rebooting. You can also add the following to /etc/rc.conf to force a more thorough fsck on reboot: background_fsck_enable=3D"no" fsck_flags=3D"-fy" Beware that this can take a long time. You will want to revert these changes (especially fsck_flags) once the situation is resolved. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86il1jgcur.fsf>