# slow system boot, module loading with SATA hard drives



## kantor (Dec 17, 2008)

I have two hard drives a 160 GB SATA and a 80 GB ATA. In the past FreeBSD was installed on the 80 GB ATA hard drive, and all went fine. Now I changed my operating system hard drive to that 160 GB SATA hdd, and installed FreeBSD there.
The installation and configuration all went fine, but FreeBSD is very slow at boot time. My sound driver module and the atapicam driver loads very slow. When FreeBSD was on the 80 GB ATA hdd the module loading were very fast. I configured the new FreeBSD installation on this 160 GB SATA drive exactly as it was on that 80 GB ATA hdd. I even tried with two FreeBSD version (6.4 and 7.0) but the problem is the same. If I switch back to my 80 GB hdd (as I had initially) FreeBSD loads normally (much faster compared to the 160 GB SATA installation)
What could be the problem ??


----------



## BSDKaffee (Dec 19, 2008)

Could you provide a dmesg output with the SATA drive installed?  What is the brand and model of your motherboard, SATA controller, and hard drive?

It could be that your SATA controller is not being recognized and the driver is using a fallback option which would cause the drive to run at a slow speed.


----------



## kantor (Dec 19, 2008)

BSDKaffee said:
			
		

> It could be that your SATA controller is not being recognized and the driver is using a fallback option which would cause the drive to run at a slow speed.



Yes I think you are right, because I can't see any other explanation.
And here are the related infos:
the 160 GB SATA drive: MAXTOR STM3160211AS
mainboard: gigabyte, model: 7VT600P-RZ

and here is the dmesg: http://pastebin.com/m7996c921
and here is the /var/log/messages output too: http://pastebin.com/m65391f6d


----------



## BSDKaffee (Dec 20, 2008)

It looks like the drive is being detected as SATA150 and the SATA controller is being detected.

I would suggest first trying to set the jumper on the drive limiting it to SATA150 since that is all your motherboard can support.  Since it appears that you have an optical drive connected to the SATA bus, I would try disconnecting that to see if it is causing trouble.

I would also disable the hptrr driver since it seems to be getting loaded when no such device exists.  It is enabled in the GENERIC kernel, so you would have to comment it out and rebuild the kernel.


----------



## kantor (Dec 21, 2008)

I recompiled the kernel, and removed any unnecessarily module, so I ended up with a 3.2 MB kernel, (the GENERIC is 7.4) but the problem is the same. And I noticed something, the problem is not in/with the kernel or with a module . . . because this problem starts right at the start of the boot sequence, when the bootstrap is started and when the kernel is not even loaded, So I the problem is after the bootstrap starts and before the kernel is loaded . . . is there a way to debug that ?


----------



## BSDKaffee (Dec 23, 2008)

Is this SATA drive only a problem at boot time or is it slow during normal system usage as well?


----------



## kantor (Dec 23, 2008)

BSDKaffee said:
			
		

> Is this SATA drive only a problem at boot time or is it slow during normal system usage as well?



Only at boot time, for instance when gnome and related programs are loaded (hal, dbus . . .) the loading process is normal.
And when I'm in gnome, and I open programs, copy from/to that hard disk the times are normal (it is not so slow like at boot time) as I see . . .


----------



## Nobber (Feb 7, 2009)

Did you ever find the cause of this problem?

I have the same problem at the moment. I had FreeBSD installed on my laptop, and the kernel would load and boot normally. Then I installed Fedora 10 in the free space on my hard disk, and since then the FreeBSD kernel loads very slowly. That is, the bit where you see:

|/-\|/-\|

(one after the other in the same character square at the left of the screen) just before the FreeBSD ASCII logo appears proceeds VERY slowly; it now takes well over 10 seconds, whereas before it would take about one second.

Very strange. I've tried replacing the GRUB that Fedora installed with the FreeBSD bootloader, but it made no difference.


----------



## Nobber (Feb 11, 2009)

I've just replaced Fedora 10 with OpenSolaris 2008.11, and now FreeBSD boots quickly again.

So I'm happy, but puzzled. Anybody got any idea why the mere presence of Fedora 10 on the same disk would cause the FreeBSD kernel to load slowly?


----------



## comfortableodo (Mar 24, 2011)

Hi,

I have a very similar problem with FreeBSD 8.2. The process of loading kernel modules at boot time takes a very long time (in the range of minutes). After all modules and the kernel have been loaded, the rest of the boot process continues at normal speed. I have ubuntu 10.10 and windows XP installed in parallel. I also tried FreeBSD 9 current, which didn't make any change. Unfortunately, the settings in the BIOS are very limited.

/var/log/messages -> http://pastebin.com/DHuhy2PN
*dmesg* -> http://pastebin.com/AyCe3Pb9

Any help would be great! If any further log files are needed, just let me know.


----------



## Nobber (Apr 28, 2011)

I don't know if it's a coincidence, but I have noticed that FreeBSD boots unusually slowly if I have logical partitions (inside an extended partition) anywhere else on the same disk. For example, when I replaced Fedora 10 (which was installed in a logical partition) with OpenSolaris 2008.11 (in a primary partition), FreeBSD booted at normal speed.

Does FreeBSD find logical partitions distasteful, and protest by booting slowly if any are present on the same disk?


----------

