Solved On every boot "UNEXPECTED SOFT UPDATE INCONSISTENCY"

Hi everyone. I installed FreeBSD 10.1 in an old laptop with the purpose to learn it. So far I like what I see but I have a problem that makes me concerned about UFS stability. Every time I reboot, during boot I get the message
Code:
"UNEXPECTED SOFT UPDATE INCONSISTENCY; RUN fsck MANUALLY"
and it drops me in single user mode.

I have ran fsck -y /dev/ada0p2 many times with the system's single user mode.
I also booted with the installation USB stick and ran fsck -py -t ufs /dev/ada0p2.
I disabled the soft updates tunefs -j disable /dev/ada0p2 and then ran again fsck. Every time the filesystem is marked as clean. Heck, I even used the -f option to check it anyway.

Still I get
Code:
"UNEXPECTED SOFT UPDATE INCONSISTENCY; RUN fsck MANUALLY"
The strange thing is that once I get dropped in single user mode and accept the default shell, I can simply press Ctrl+D to proceed to multiuser mode and everything seems to work fine.

How can I fix this?
 
Is every shutdown a clean shutdown? I've generally only seen that when the system dies because of a power failure. That shouldn't be an issue on a laptop since it has a battery. If you are doing clean shutdowns than installing systuils/smartmontools and checking on the integrity of the hard drive via the smartctl -a /dev/ada0 command for that drive and each hard drive may be in order.
 
What is your disk (what type of disk, what model)? What is your disk controller?

You say this happens on every single boot. Try the following: Completely quiesce the system (take down any Xwindows or user interface processes, take it down to a single login, and then kill all the daemons). Let it sit quietly for a minute or two, to make sure all dirty buffers have been flushed out to disk (and maybe within the disk to real persistent storage). Then do a clean shutdown with shutdown -h. At this point, there were no recent IOs, so maybe the problem will go away.

In my (limited) experience, this error only occurs if a disk (or RAID controller) lies to the file system, claiming that some IOs were done, but in reality they haven't been done *YET*. The file system then runs IOs that logically depend on those pending IOs, and those newer IOs make it to disk. But then, on power down, the first IO gets silently abandoned by the disk.

Really hard to see how this could happen on an old laptop though. If you have a crappy cheap RAID controller with bad firmware, I could see it happening, but on a single disk without NVRAM cache, this is hard to imagine.

Could it be that the old laptop has a really new hybrid disk (the ones that have some flash and lots of spinning rust), and the disk controller chip in the laptop doesn't know how to deal with that? Seems implausible.

If the problem can't be fixed, you can just disable soft updates on the file system with tunefs(8). It will cost you a tiny bit of performance, but on an old laptop, performance is the least of your worries.
 
The first time I shut it down it was a hard, brutal shutdown with the power button. And that was because I issued a reboot from command line but it seemed to hang. From that it recovered gracefully without any complains.

Every other shutdown is done either with reboot(8) or poweroff(8).

The laptop is an old IBM R50 and the disk type is ATA. It's capacity is 30GB and I think it's make is WD. I don't think the motherboard supports S.M.A.R.T.

Code:
#smartctl -a /dev/ada0 -d ata -T permissive                                                              
smartctl 6.3 2014-07-26 r3976 [FreeBSD 10.1-RELEASE i386] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: Inappropriate ioctl for device

=== START OF INFORMATION SECTION ===
Device Model:     [No Information Found]
Serial Number:    [No Information Found]
Firmware Version: [No Information Found]
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   [No Information Found]
Local Time is:    Sun Jan  4 14:23:29 2015 EET
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 82-83 don't show if SMART supported.
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled.
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

The intended use is as a web server. I wan't to play with it so I can host my web development learning exercises. So no X in this box. Just FAMP and deluge_web. I think I have already disabled soft updates with tunefs -j disable /dev/ada0p2
 
Hello,

Did you by any chance set a kern.securelevel=2 or greater in /etc/sysctl.conf? That triggers what you are experiencing. If that is the case, remove that line and instead add this into /etc/rc.conf:
Code:
kern_securelevel_enable="YES"
kern_securelevel="2"
Just a wild guess.

Regards,
Guillaume
 
Hello,

Did you by any chance set a kern.securelevel=2 or greater in /etc/sysctl.conf? That triggers what you are experiencing. If that is the case, remove that line and instead add this into /etc/rc.conf:
Code:
kern_securelevel_enable="YES"
kern_securelevel="2"
Just a wild guess.

Regards,
Guillaume

Thanks. That was it. I was looking through tutorials how to harden the installation and I added this line. Now it reboots without a problem.
 
Back
Top