# unable to open /dev/sda

## dannygentoo

Hi there,

I have been busy on this problem for a long time now - I need some help!

Got 1 IDE-HDD and 1 SATA-HDD. The IDE-HDD is fine. But Gentoo does not find the SATA-HDD. It has while installation from the live-CD. But now an fdisk /dev/sda gives me "unable to open /dev/sda".

There is nothing with "sd*" in my /dev-directory.

I have build my kernel with build in SCSI-disk Support as well as Serial ATA Support and VIA SATA Support.

Here´s some information about my system/configuration:

server dev # uname -a

 *Quote:*   

> Linux server 2.6.17-gentoo-r8 #1 Fri Sep 15 03:12:23 CEST 2006 i686 AMD Athlon(tm) GNU/Linux

 

grep "^CONFIG.*\(sata\|scsi\)" -i /usr/src/linux/.config

 *Quote:*   

> CONFIG_SCSI=y
> 
> CONFIG_SCSI_PROC_FS=y
> 
> CONFIG_SCSI_SPI_ATTRS=y
> ...

 

fdisk -l

 *Quote:*   

> Disk /dev/hda: 122.9 GB, 122942324736 bytes
> 
> 255 heads, 63 sectors/track, 14946 cylinders
> 
> Units = cylinders of 16065 * 512 = 8225280 bytes
> ...

 

lspci

 *Quote:*   

> 00:00.0 Host bridge: VIA Technologies, Inc. VT8377 [KT400/KT600 AGP] Host Bridge (rev 80)
> 
> 00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI Bridge
> 
> 00:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
> ...

 

dev # df

 *Quote:*   

> Filesystem           1K-blocks      Used Available Use% Mounted on
> 
> /dev/hda5             15365604   4078120  11287484  27% /
> 
> udev                    257536       208    257328   1% /dev
> ...

 

cat /proc/interrupts

 *Quote:*   

>            CPU0
> 
>   0:     109312    IO-APIC-edge  timer
> 
>   1:          9    IO-APIC-edge  i8042
> ...

 

If I boot from the live-CD i get the following:

/root % dmesg | grep sata

 *Quote:*   

> sata_via 0000:00:0f.0: version 1.1
> 
> sata_via 0000:00:0f.0: routed to hard irq line 10
> 
> scsi2 : sata_via
> ...

 

/root % dmesg | grep scsi

 *Quote:*   

> scsi: <fdomain> Detection failed (no card)
> 
> scsi2 : sata_via
> 
> scsi3 : sata_via
> ...

 

I´m getting mad with this thing. Can someone tell me where´s the problem?

----------

## NeddySeagoon

dannygentoo

Do you have the high level SCSI Disk driver in your kernel ?

CONFIG_BLK_DEV_SD=y

Everything else looks good.

----------

## dannygentoo

Hi NeddySeagoon,

thanks for the fast answer!!!

 *Quote:*   

> 
> 
> Do you have the high level SCSI Disk driver in your kernel ?
> 
> CONFIG_BLK_DEV_SD=y 

 

Yes, just took a look inside the .config file. It´s there in the section "SCSI Support Type".

I read a LOT of threads about this SATA-thing and believe to have set up everything all right. But it seems there´s some (little?) thing missing? Crazy because live-CD or Knoppix is working...

How can I find out the difference between the live-CD and my installed Gentoo concerning SATA?

----------

## dannygentoo

News here!!!

I just built the kernel again with only one change: I did not compile the sata_via driver into the kernel. Instead I made a module.

After reboot I did a "modprobe sata_via" and now an fdisk /dev/sda is possible  :Smile: 

Then I inserted "sata_via" into the file /etc/modules.autoload.d and everything is fine after the next reboot.

BUT why didn´t that work with the module compiled inside the kernel???

----------

## NeddySeagoon

dannygentoo,

I guess you didn't install the kernel correctly the first time. forgetting to mount /boot is popular, as is a typo in the kernel file name.

----------

## dannygentoo

 *Quote:*   

> I guess you didn't install the kernel correctly the first time. forgetting to mount /boot is popular, as is a typo in the kernel file name

 

I don´t think so. I did exactly the same as before - except for not compiling the driver inside the kernel. For now everthing´s OK. But if the SATA-disk would´ve been my boot-device i´d have a problem still (because the driver must be INSIDE the kernel for the boot-device).

I´m going on now installing the other stuff. Hope that this will be without such a big problem.

Anyway, thanks for the help!!

----------

## its1louder

Let me report a data point here.  

My mythtv machine is an nforce 2 based one that nonetheless uses that VIA VT6420 SATA RAID Controller (rev 50).  I was happilly running 2.6.17 kernel with the sata_via module compiled in and no scsi support compiled in, just a module that never got autoloaded.  It worked fine.  For myth support reasons I chose to upgrade to 2.6.19 and then my SATA disk (not boot disk, just a media storage disk) stopped working.  During kernel boot it would spend a really long time looking for the sata disk, then it would give up with failure.  

I looked in the gentoo forums and found a lot of posts where people might be experiencing similar situation but there was also a lot of bad information in there.  Then I found this post and set up my kernel similar - compiled in the scsi and moduled out the SATA_VIA module - and now it boots up quickly and works.  

The only way I am different from danny is that i dont have anything in modules.autoload - I just let udev sort it out.  All my modules get installed, this sata_via module, nvidia, ivtv (for frame grabber card) very early, earlier then modules.autoload would do it.  I speculate this means there is hope for those using the SATA as the boot device instead of just some peripherl that can get slapped on later, but I cannot (ie won't)  test this.

----------

## numeritos

It sounds stupid, but have you copied your /usr/src/linux/System.map and /usr/src/linux/arch/i386(or whatever arch you're using)/boot/bzImage into your /boot directory and after that changed your /boot/grub/grub.conf to point to your new kernel?[/topic]

----------

## its1louder

Hi,

yeah I just double checked and my system map and kernel image have the same time stamp.  I usually compile the kernel and follow with a make install after mounting boot, because I am lazy and it moves everything for me.  

Anyway there is some sort of race condition when udev sorts out modules.  It still very occasionally misses the sata drive but it usually works now, when it was compiled into the kernel it didn't work at all.  So improved, not super ideal.  I can live with it.

----------

