LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   2.6.x kernel reading HDD info incorrectly - missing partitions (https://www.linuxquestions.org/questions/linux-hardware-18/2-6-x-kernel-reading-hdd-info-incorrectly-missing-partitions-225050/)

bulliver 08-31-2004 08:57 PM

2.6.x kernel reading HDD info incorrectly - missing partitions
 
Hello all,

First of all, this is going to be something of an open-ended post, so please forgive my rambling and lack of any direct question. A light finally came on in my head today, and I realize that what I thought are a few separate problems is actually all related.

Here is my disk layout, I triple boot Gentoo, Arch, and FreeBSD:
Code:

/dev/hda = MAXTOR 6L040J2, ATA DISK drive 40GB
 hda1 = shared '/boot' partition
 hda2 = gentoo '/' partition
 hda3 = gentoo '/usr/' partition
 hda4 = gentoo '/home' partition
 /dev/hdb = SAMSUNG SP0802N, ATA DISK drive 80GB
 hdb1 = shared music partition mounted as /home/music on both Gentoo and Arch
 hdb2 = shared swap partition
 hdb3 = FreeBSD partition
 hdb4 = logical Partition
 hdb5 = archlinux '/' partition
 hdb6 = shared video partition mounted as /home/music/video on both Gentoo and Arch

I cannot boot a 2.6 kernel that mounts '/' on /dev/hda. I started a thread about it a while a go here:
http://www.linuxquestions.org/questi...hreadid=191284

Because of this, I installed Arch Linux on some empty space on hdb, and successfully built and booted a 2.6.7 kernel. However, I could not mount any partition except for hda1 using a 2.6 kernel from Arch...this led me to place this thread on the arch forums:
http://bbs.archlinux.org/viewtopic.php?t=6234

After building but failing to boot yet another 2.6 kernel on gentoo today, I had the bright idea of changing "root=/dev/hda2" to "root=/dev/hdb5" and wouldn't you know, it booted up Arch just fine...but didn't see the partitions on hda correctly.

Finally I realized the problems are related. Here is the output from dmesg and fdisk about /dev/hda detected when using a 2.4.x kernel:
Code:

# dmesg | grep hda
<snip>
hda: MAXTOR 6L040J2, ATA DISK drive
hda: attached ide-disk driver.
hda: host protected area => 1
hda: 78177792 sectors (40027 MB) w/1819KiB Cache, CHS=4866/255/63, UDMA(100)
# dmesg | grep /dev/ide/
 /dev/ide/host0/bus0/target0/lun0: [EZD] [remap 0->1] [4866/255/63] p1 p2 p3 p4
 <snip>
# fdisk -l /dev/hda
Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1          24      192748+  83  Linux
/dev/hda2              25        1240    9767520  83  Linux
/dev/hda3            1241        3710    19840275  83  Linux
/dev/hda4            3711        4866    9285570  83  Linux

And here is the output when running Arch with the 2.6 kernel:
Code:

# dmesg | grep hda
<snip>
hda: 78177792 sectors (40027 MB) w/1819KiB Cache, CHS=65535/16/63, UDMA(100)
# dmesg | grep /dev/ide/
 /dev/ide/host0/bus0/target0/lun0: p1[EZD]
<snip>
# fdisk -l /dev/hda
Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1        4111    33021576  55  EZ-Drive

As you can see from these results, 2.4 and 2.6 kernels clearly disagree about the partition structure of /dev/hda. Notice that the disk geometry is reported differently ("CHS=4866/255/63" vs. "CHS=65535/16/63"). Especially telling is the difference between these two lines (2.4 first):
Code:

/dev/ide/host0/bus0/target0/lun0: [EZD] [remap 0->1] [4866/255/63] p1 p2 p3 p4
/dev/ide/host0/bus0/target0/lun0: p1[EZD]

So it seems that the system id for hda is "EZ-Drive" but the 2.4 kernel does some sort of remapping ("remap 0->1") to make it work. I assure you that when I installed gentoo I created all 4 partitions on /dev/hda manually and gave them id 83 (linux). I don't know what "EZ-Drive" is, how it got here, or what it's doing. I don't know why a 2.4 kernel can see past it to the correct partition layout and a 2.6 kernel cannot.

So if your still reading this at this point, and you have any idea about what's going on please enlighten. If you need more info on something just ask...

Thanks.

bulliver 09-01-2004 06:23 AM

Well, I fixed my own problem. Adding "hda=remap" to the kernel command line cleared it up, and I have finally, after about 100 attempts gotten a 2.6 kernel to boot my gentoo install.

I just don't know what to do now... :)


All times are GMT -5. The time now is 03:50 AM.