[bug] fsck refuses to repair damaged UFS using backup superblock

Rick Macklem rmacklem at uoguelph.ca
Wed Nov 28 15:44:43 UTC 2018


Kirk McKusick wrote:
[stuff snipped]
I wrote:
>>
>> For booting, I think Warner is correct to suggest "print a warning
>> and soldier on..".  However, once the system has booted (maybe only
>> single user), I'd think it would be better to fail the mount at
>> least until an fsck is done on it than allow it to be mounted
>> read-only, unless there is no risk that doing this mount could cause
>> a crash/panic.
Oops, I realize I missed a key phrase in the above (run on) sentence.
The key phrase was "for file systems other than root".

I was basically trying to say what bde@ said.

>> Obviously, just my opinion given that I don't know UFS.
>>
>> rick
>
>Since the initial boot does a read-only mount, my proposal will have
>the effect that the boot will "print a warning and soldier on..".
>
>The root filesystem has to be intact enough to be able to read the
>boot code and one or more kernel and configuration files from it.
>If it is able to get that far, it will most likely be able to
>read-only mount it and get /sbin/init and /bin/sh off it to get to
>a single-user prompt.
>
>By setting the FS_NEEDSFSCK flag on the filesystem, a full fsck
>will be run as part of trying to come up and will fail to single
>user if the fsck is not successful.

Yep. Certainly sounds reasonable to me for the root fs.
I had intended the above to refer to other file systems than root.

rick



More information about the freebsd-fs mailing list