Page MenuHomeFreeBSD

Make fsck(8) default to "ufs".
ClosedPublic

Authored by trasz on Feb 15 2017, 4:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 22 2024, 8:40 PM
Unknown Object (File)
Mar 22 2024, 8:40 PM
Unknown Object (File)
Mar 22 2024, 8:40 PM
Unknown Object (File)
Mar 8 2024, 12:26 PM
Unknown Object (File)
Jan 4 2024, 5:32 AM
Unknown Object (File)
Jan 4 2024, 5:27 AM
Unknown Object (File)
Jan 4 2024, 5:27 AM
Unknown Object (File)
Jan 4 2024, 2:28 AM
Subscribers

Details

Summary

Make fsck(8) default to "ufs", like eg mount(8) does.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz retitled this revision from to Make fsck(8) default to "ufs"..
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)
sbin/fsck/fsck.c
218 ↗(On Diff #25234)

I would combine both old and new code. I.e. do set type to ufs, but also issue a warning.

Wouldn't that defeat the purpose of having the default? Other utilities don't issue warnings in this case, they just silently go with default.

In D9621#199001, @trasz wrote:

Wouldn't that defeat the purpose of having the default? Other utilities don't issue warnings in this case, they just silently go with default.

Which other utilities ?

After you asked the question, I started thinking that fall back to ufs might be in fact unsafe. UFS superblock might very well survive re-formatting of the volume into different file type. So for typical scenario where device is absent from fstab, where disk is moved into another machine, and you run fsck without specifying a type, fsck_ffs might start correcting non-UFS data. There are other safeties like '-y' switch, but I think that it would be stressful for a user to see the long error list from fsck.

imp added a reviewer: imp.

I think this is perfectly fine now that GPT doesn't provide this information (disklabel used to). But maybe we need to hack getfstype() to grok GPT labels like it used to grok disklabel().

mount silently falls back to ufs, though I'm not sure the mechanism it uses.

This revision is now accepted and ready to land.Feb 16 2017, 10:52 PM

Konstantin - _all_ the utilities. Namely newfs and mount. They all default to ufs. It's logical for fsck to do the same. Especially that other systems people are used to don't require one to specify the filesystem by hand either.

In D9621#199545, @trasz wrote:

Konstantin - _all_ the utilities. Namely newfs and mount. They all default to ufs. It's logical for fsck to do the same. Especially that other systems people are used to don't require one to specify the filesystem by hand either.

mount is (much) less destructive than fsck. My point is that fsck is used in situation where being too aggressive by default is not the best choice. I.e. even the presence of valid UFS superblock does not imply that fsck can safely write to the volume making 'fixes'.

newfs is the wrong example in the series, since whatever variant is used, volume is destroyed anyway.

I do not to block you hard, though.

This revision was automatically updated to reflect the committed changes.