Date: Sat, 24 May 2014 21:50:01 GMT From: Benjamin Kaduk <bjk@freebsd.org> To: freebsd-doc@FreeBSD.org Subject: Re: docs/188214: Manpage for fsck(8) doesn't say what happens when no -t or -T Message-ID: <201405242150.s4OLo1kl057680@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR docs/188214; it has been noted by GNATS. From: Benjamin Kaduk <bjk@freebsd.org> To: Tom Rhodes <trhodes@freebsd.org> Cc: Allan Jude <allanjude@freebsd.org>, bug-followup@freebsd.org Subject: Re: docs/188214: Manpage for fsck(8) doesn't say what happens when no -t or -T Date: Sat, 24 May 2014 17:42:47 -0400 (EDT) On Sat, 24 May 2014, Tom Rhodes wrote: > So, in theory, an attempt to parse /etc/fstab would be > an attempt to detect the type; however, my quick glance > at the code showed no real parsing of fstab. But in > my case, I followed to both the T and t flags, and just > glanced at what was done would they not be specified. > That was really as far as I got, and I attempted to use > very generic language in case it only does one, or the > other, or both. :) When passed no device or path arguments, fsck just checks everything from the fstab; that's not very interesting for this question. Given a path argument and no type argument to use, fstab is parsed using getfsfile() or getfsspec() around line 204 of fsck.c. This will fail (well, barring special circumstances) if the argument is instead a device name. Given a device name argument and no type argument to use, after the fstab check above, fsck opens the device and uses ioctl() to get the disklabel and does some magic to grab the fstype from it. (See getfslab(), in fsck.c) So, I think there is a fair bit of autodetection that is attempted. -Ben
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405242150.s4OLo1kl057680>