# gentoo can't access hard disk

## tuclogicguy

I have been building PCs and installing various operating systems on them for years, and have quite a bit of experience with Linux, but this is my first experience with Gentoo.

I am trying to get Gentoo running on my trusty old test PC that is about 12  years old.

Motherboard: Intel D815EE2U

Processor: Pentium III, 866 MHz

80GB PATA hard disk

This machine already has Windows 98, OS/2 Warp 4, and FreeBSD running on it.

I created 3 new logical partitions for Gentoo:

/dev/sda5  ext2  boot

/dev/sda6  linux-swap

/dev/sda7  jfs    root

I tried to follow the installation instructions in the handbook carefully.  One thing that has me confused at this point is choosing the correct hard disk driver and associated options.  I looked at the /var/log/messages file when booted from the Gentoo Install CD and it appeared that it was using the ata_piix driver for accessing the disks.  I spent many hours going through menuconfig to select the options that applied to this machine.  For disk access, I selected these options:

Device Drivers --->

  < > ATA/ATAPI/MFM/RLL support (DEPRECATED) --->

  <*> Serial ATA and Parallel ATA drivers --->

         [*] ATA SFF support (for legacy IDE and PATA)

         [*] ATA BMDA support

         <*>   Intel ESB, ICH, PIIX3, PIIX4, PATA/SATA support

I checked /usr/src/linux/.config and saw that it had 

CONFIG_ATA_PIIX=y

and the other variables associated with other drivers are not set, so I think I have selected the right menuconfig option in order to get the ata_piix driver built into the kernel.

When I try to boot Gentoo, it appears that the kernel starts to load and starts accessing some of the hardware items and then crashes with a "Kernel panic".  Here are the messages that appear on the screen:

```
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input3

ata1.00: ATA-8: WDC WD800AAJB-00J3A0, 01.03E01, max UDMA/133

ata1.00: 156301488 sectors, multi 16: LBA48

ata1.00: configured for UDMA/100

scsi 0:0:0:0: Direct-Access     ATA      WDC WD800AAJB-00 01.0 PQ: 0 ANSI: 5

ata2.00: ATAPI: LITE-ON LTR-12101B, LS3G, max MWDMA2

ata2.01: ATAPI: IOMEGA  ZIP 100       ATAPI, 23.D, max PIO2, CDB intr

ata2.00: configured for MWDMA2

ata2.01: configured for PIO2

scsi 1:0:0:0: CD-ROM            LITE-ON  LTR-12101B       LS3G PQ: 0 ANSI: 5

scsi 1:0:1:0: Direct-Access     IOMEGA   ZIP 100          23.D PQ: 0 ANSI: 5

tsc: Refined TSC clocksource calibration: 861.936 MHz

Switching to clocksource tsc

input: GenPS/2 Genius Mouse as /devices/platform/i8042/serio1/input/input4

VFS: Cannot open root device "sda7" or unknown-block(0,0): error -6

Please append a correct "root=" boot option; here are the available partitions:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.17-gentoo #5

Hardware name:  /D815EE2U,   BIOS EA81520A.86A.0039.P21.0211061753  11/06/2002

  trace back dump
```

It appears that the driver has basic communication with the 3 IDE devices.  (I think it is sending an ID command and getting responses in order to retrieve the information displayed.)  But, it appears that the driver is unable to read the partition information from the disk.  Below the line "here are the available partitions:" nothing is listed.

I did select the ext2 and jfs file system options when compiling the kernel, but it looks like the problem is at a higher level than the root file system.  It can't even find the sda7 partition.

Something in the kernel is obviously not configured right.

Any suggestions?

----------

## Bones McCracker

Your kernel configuration appears to be correct.

I would double-check that I had the right filesystem support enabled in the kernel.

Then I would double-check my specification of both the boot and root devices in my bootloader configuration.

----------

## NeddySeagoon

tuclogicguy,

What you posted is correct but not sufficient because the Hard Disk Driver is in two parts.

You have the low level part.  You need the high level part too.

On the 

```
SCSI device support 
```

menu you need

```
  │ │        < > RAID Transport Class                                                      │ │  

  │ │        -*- SCSI device support                                                       │ │  

  │ │        < > SCSI target support                                                       │ │  

  │ │        [*] legacy /proc/scsi/ support                                                │ │  

  │ │            *** SCSI support type (disk, tape, CD-ROM) ***                            │ │  

  │ │        <*> SCSI disk support                                                         │ │  

  │ │        < > SCSI tape support                                                         │ │  

  │ │        < > SCSI OnStream SC-x0 tape support                                          │ │  

  │ │        <*> SCSI CDROM support                                                        │ │  

  │ │        [ ]   Enable vendor-specific extensions (for SCSI CDROM)                      │ │  

  │ │        <*> SCSI generic support 
```

Even your PATA drive is under the SCSI stack with the drivers on the 

```
<*> Serial ATA and Parallel ATA drivers  ---> 
```

menu.

----------

## lexflex

You did set your root= option in grub ?

Maybe post your grub.conf ( or at least the relevant section) ?

----------

## i92guboj

After the ata stuff, you should see the disk being detected as sda (or sdb, or whatever), and the list of partitions inside of it. This happens before you have to care about the fs, so that's not the problem. As you say, something's missing before that.

Note that nowadays most of this stuff needs the scsi layer to work. It's been at least a couple of years since I've had to deal with that part of the kernel configuration for last time, though.

```
scsi 0:0:0:0: Direct-Access     ATA      WDC WD800AAJB-00 01.0 PQ: 0 ANSI: 5 
```

This line is strange ("strange" means I am unfamiliar with it). I happen to have one machine with piix, and this is what I get:

```

[    0.516125] ata_piix 0000:00:1f.1: version 2.13

[    0.516365] ata_piix 0000:00:1f.1: setting latency timer to 64

[    0.517181] scsi0 : ata_piix

[    0.517401] scsi1 : ata_piix

[    0.517564] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x3c40 irq 14

[    0.517569] ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x3c48 irq 15

[    0.517636] ata2: port disabled--ignoring

[    0.690491] ata1.00: HPA detected: current 219538272, native 234441648

[    0.690500] ata1.00: ATA-7: FUJITSU MHV2120AH PL, 004200A0, max UDMA/100

[    0.690505] ata1.00: 219538272 sectors, multi 16: LBA48 

[    0.690513] ata1.01: ATAPI: TSSTcorpCD/DVDW TS-L532L, HP12, max MWDMA2

[    0.712370] ata1.00: configured for UDMA/100

[    0.734307] ata1.01: configured for MWDMA2

[    0.735276] scsi 0:0:0:0: Direct-Access     ATA      FUJITSU MHV2120A 0042 PQ: 0 ANSI: 5

[    0.735642] sd 0:0:0:0: [sda] 219538272 512-byte logical blocks: (112 GB/104 GiB)

[    0.735796] sd 0:0:0:0: [sda] Write Protect is off

[    0.735804] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00

[    0.735871] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

[    0.735880] sd 0:0:0:0: Attached scsi generic sg0 type 0

[    0.742932] scsi 0:0:1:0: CD-ROM            TSSTcorp CD/DVDW TS-L532L HP12 PQ: 0 ANSI: 5

[    0.759731]  sda: sda1 sda2

```

I suspect you either have an unusual SCSI setup and has to pass some parameter to the kernel or there's some strange setting in the kernel preventing your kernel from correctly naming the device nodes for your partitions. My brain can't give much more right now, maybe tomorrow it will be in better shape   :Rolling Eyes: 

----------

## krinn

If your kernel can see your disk, but not partitions, you might just lack partitions support for your system. check CONFIG_MSDOS_PARTITION=y

or the sd block device handler (NeddySeagoon already gave you how to enable it)

----------

## NeddySeagoon

tuclogicguy,

krinns post has made me look again

```
[    0.759731]  sda: sda1 sda2 
```

The kernel sees two partitions on /dev/sda

That also means your high level SCSI menu settings are correct.

That may mean you have several block devices attached and /dev/sda is not the one you want.

Maybe its the ZIP drive that appears as sda ?

----------

## Anon-E-moose

 *NeddySeagoon wrote:*   

> tuclogicguy,
> 
> krinns post has made me look again
> 
> ```
> ...

 

On mine (several partitions on sda) I see

```
[    1.301510]  sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 >
```

What does "ls /dev/sd*" show?

----------

## tuclogicguy

Thanks, NeddySeagoon, for the quick reply.  That was exactly what I was missing.  Gentoo boots now!

----------

## tuclogicguy

I mean that adding the SCSI device support options you listed was what I needed to get the ata_piix driver to work.

----------

## krinn

 *NeddySeagoon wrote:*   

> 
> 
> krinns post has made me look again
> 
> ```
> ...

 

I think i92guboj will be happy to know that  :Razz: 

It's from his dmesg, not from tuclogicguy's one

----------

## i92guboj

I am indeed happy that it has been working all this time   :Laughing: 

Hehe, that happens to me all the time  :Wink: 

I am glad the OP found his answer, that's the important thing  :Smile: 

----------

## Bones McCracker

I think you probably do not need the 

```
[*] legacy /proc/scsi/ support
```

----------

## NeddySeagoon

BoneKracker,

You are probably right about that.

----------

