# system freeze



## shaqan (Jun 18, 2013)

Hello. I am stumped with an issue where system with console login freezes up on me in about 10-20 seconds after boot. Sometimes I manage to login, sometimes not. When using single user mode, there is no problem but once I boot into multi-user, it always happens. I dug around in the forum and found one similar case where the culprit was NTPD but for me, it still didn't make a difference if I installed NTPD or not. The system still keeps freezing.

I have tried by now FreeBSD 8.2, 8.3, 8.4, 9.1 and even 10-CURRENT, all AMD64 variants (system has 8 GB RAM, no interest in using i386)

I tried other BSD's (FireflyBSD, OpenBSD, NetBSD) and OpenIndiana console installs and those seemed to function without a hitch. The issue seems to crop up with FreeBSD only.

System itself has AMD PhenomII quad CPU with MSI 770-C45 motherboard, 2 SATA harddrives (one for Windows, other fully meant for FreeBSD (during installs I tried both "Auto Defaults" and manually set up file system based on UFS2). The partition table uses MBR.

I would be glad if someone would be able to give me some insight. It's one machine I want to use for studying FreeBSD


----------



## dave (Jun 19, 2013)

Make sure your hardware is compatible with FreeBSD.  If it is, boot a diagnostics CD such as UBCD and run memory, CPU and HDD tests.


----------



## jozze (Jun 19, 2013)

Do you get a kernel panic or something? Post the kernel message or some other interesting things. Are you booting from an installed system, or a LiveCD? Pehaps a USB stick?


----------



## shaqan (Jun 21, 2013)

No kernel panic. I installed the system in multiuser mode. It just kept freezing up right after it finished booting. Sometimes before I entered login/password, sometimes in the middle of entering it, sometimes a few seconds after logging into shell. The system stopped responding to keystrokes.

The LiveDVD/USB stick worked just fine. Also, the installed system worked fine IF I used single user mode.

I finally reached the conclusion it had something to do with the UFS2 file system itself but had no real idea what exactly. Based on the fact that the medium that the Live/installed system was using appeared to be the only major difference.

I tried about half a dozen different hard drives from 40 GB PATA-s to terabyte sized SATA-s with always identical results.

After toying with PC-BSD it appears that I can use ZFS and the system stays up even in multiuser mode.


----------



## dave (Jun 21, 2013)

Did you check your hardware?  Because this type of unpredictable behavior is symptomatic of bad memory, dying hard drives, and the like.  Don't claim a victory and "move in" until you know you are on stable ground.


----------



## jozze (Jun 21, 2013)

dave said:
			
		

> Did you check your hardware?  Because this type of unpredictable behavior is symptomatic of bad memory, dying hard drives, and the like.  Don't claim a victory and "move in" until you know you are on stable ground.



As @dave suggests it could be bad memory. In my experience, UFS is quite strict with reboots and whatnot. If the partitions are not unmounted in a clean way, the system might refuse to start, especially if it was compiling something beforehand. Boot into single user mode and run fsck on all your partitions. Try `# fsck -t ufs -fy /dev/adaXpY` where you have to replace X and Y with your hard drive, and partition number (in some cases you might also see /dev/adaXsY, see what works for you). After that reboot your computer and see what happens.

If this step didn't help, we can try to look for a hardware error (unsupported hardware). Try rebooting into single user mode, and show us the contents of the /var/log/messages.0.bz2. Boot information should be there. It would also be nice, if you could provide /var/log/dmesg.yesterday. Hopefully the error will pop out there.

Just to make sure (to rule out another possibility), allow me to ask you this as well: you are using the GENERIC kernel, yes?


----------



## Terry_Kennedy (Jun 21, 2013)

shaqan said:
			
		

> I would be glad if someone would be able to give me some insight. It's one machine I want to use for studying FreeBSD


First, you should clarify "freezes". In no particular order:

Terminal sessions appear to work, but anything causing a disk access hangs
Alt-Fn doesn't switch consoles (if enabled)
Characters echo, but nothing else happens
Characters don't echo at all
The first is usually a hardware (disk) or filesystem/driver problem. The second and third indicate that interrupt processing is working, but non-interrupt tasks aren't working. The last indicates that the system is completely hung, with interrupts off.

In addition to running memory test, you could try booting with ACPI disabled (option in the boot menu). Also, you could try disabling all optional services in /etc/rc.conf by setting _whatever__enable="NO" (instead of "YES") and if that works, re-enable things one by one.


----------



## shaqan (Jul 15, 2013)

Please read the term _freeze_ as whole system becoming unresponsive in about 10-20 seconds after getting to the login prompt on the console. After boot that is. The system does not respond to anything short of rebooting the computer from the button. I did notice that the _freeze_ happens gradually although fast. I tried to type during the freeze and it took about five seconds from the moment I noticed the system responding more sluggishly to total stop of all feedback. Including all keyboard buttons and character echo. 

What I have tried or tested today:

I tried running Memtest from an OpenSUSE DVD for a couple of hours. No errors were reported.
I disabled both PATA and SATA controllers in the motherboard BIOS. Then I installed a 3WARE hardware RAID card and configured it to use two strictly identical SATA HDD's in RAID 0 mode. The issue reappeared immediately. Just to eliminate as many possibilities as I could, I used their brand new SATA cables as well.
The UFS2 file system appears to work fine from inside the ZFS volume on the hard drive, using the MBR partitioning scheme.
The GPT partitioning scheme and purely ZFS volume on hard disk works splendidly, regardless of single/multi user working mode. I forgot to test it with both ACPI Off/On.
Multi-user On, a GPT partitioning scheme and a UFS2 file system on the drive gave a system freeze.
Multi-user On, an MBR partitioning scheme and a UFS2 file system on the drive gave a freeze.
ACPI Off, Single User On resulted in a kernel panic.
ACPI Off, Multi-User On also gave a fast kernel panic.
ACPI On, Single User mode. The system stayed up until I rebooted it myself about a quarter of an hour later, looked stable even after I mounted file UFS2 root manually in r/w mode.
Safe Mode On, Single User On resulted in a kernel panic.
No problems running FreeBSD off the live media, like a USB pen drive or CD/DVD.

Looks like on-board SATA/PATA chipsets and/or cables are no longer prime suspects. The 3WARE card was borrowed from a working-order 1U rack mount server. The memory should be okay as well if `memtest` did not turn up anything.

I also swapped off the graphics card, from Nvidia GTX470 to 9600GT which has much lower power requirements. I removed the Creative PCI sound card, disabled on-board sound,  disabled also the serial port and IrDA in BIOS.

What else might help pinning the problem down?


----------



## wblock@ (Jul 15, 2013)

That motherboard has some overclocking features.  Are they all disabled?  For UFS, I would also recommend disabling SUJ from single user mode with `tunefs -j disable`.


----------



## shaqan (Jul 17, 2013)

Yes. All disabled. Eventually I gave up, probably upgrading the hardware would be easier than chasing the cause of this odd issue.Thanks for trying to help.

NB! One thing is becoming off-putting regarding this forum. There are rules. Well and nice. Rules are necessary but picking on every post like a certain Mr. Monk on TV, trying to achieve utter perfection feels like the same syndrome mister Monk is suffering from. I got only a very basic instinctual grasp of English. I never had a chance to learn it in school. It's self taught. And to pick on it like an English teacher might in school is overdoing the "good thing" in my humble opinion. Actually one might take it as dissing. The only reason I created the account here was for getting help in trouble. But when I am forced to spend up to several hours getting the post just right by the rules, and then still get a notice about missing articles - it's getting ridiculous. I might as well spend the same time chasing after issues on my own. From now on. It was nice to experience that you guys tried to help but posting in here is just too much trouble. Over and out.


----------



## DutchDaemon (Jul 17, 2013)

http://forums.freebsd.org/showthread.php?t=18043



> Opening remark: try not to take any of this personally, even when a moderator sends you to this page. These rules exist to make the forums an enjoyable experience, and to help you make a good impression on other forum members. This will mean they will be more willing to help you. Invest some time in a good post, and fellow forum members will invest some time in helping you. It is that simple.



That's all you're asked to do, and your posts weren't bad at all... No one needs to be a perfect master of English, and no one is 'picking on you'. That's why the guidelines are full of _examples_ and _suggestions_ to help you improve. We do expect improvement. If you don't take it as such (as a way to improve), then you simply misunderstand the intention of the rules and guidelines, or you don't want to invest the time and energy to improve. Either way, it's your choice what to do with that.

Over and out.


----------

