# Hard disks missing. Ethernet is messed up.

## dr4cul4

Everything was working fine until yesterday... I had an I/O error, so I typed:

```
shutdown -rF now
```

Well id ended badly, but disks are alive, because system boots. The thing is that my /dev/hd* are missing and there is no /dev/ide/. So I went investigating:

```
~ # dmesg | grep hd

Kernel command line: rw root=/dev/hda3 noatime

hda: ST380011A, ATA DISK drive

hda: host max PIO5 wanted PIO255(auto-tune) selected PIO4

hda: host side 80-wire cable detection failed, limiting max speed to UDMA33

hda: UDMA/33 mode selected

hdc: ST3160023A, ATA DISK drive

hdc: host max PIO5 wanted PIO255(auto-tune) selected PIO4

hdc: UDMA/100 mode selected

hda: max request size: 512KiB

hda: 156301488 sectors (80026 MB) w/2048KiB Cache, CHS=16383/255/63

hda: cache flushes supported

 hda: hda1 hda2 hda3 hda4 < hda5 >

hdc: max request size: 512KiB

hdc: 312581808 sectors (160041 MB) w/8192KiB Cache, CHS=19457/255/63

hdc: cache flushes supported

 hdc: hdc1

EXT3 FS on hda3, internal journal

```

Nice we have a disks.  :Very Happy:  Now let see the system:

```

~ # la /sys/bus/ide/drivers/ide-gd/

total 0

--w------- 1 root root 4.0K Feb  4 10:21 bind

--w------- 1 root root 4.0K Feb  4 10:21 uevent

--w------- 1 root root 4.0K Feb  4 10:21 unbind

drwxr-xr-x 2 root root    0 Feb  4 09:38 .

drwxr-xr-x 4 root root    0 Feb  4 09:38 ..

lrwxrwxrwx 1 root root    0 Feb  4 10:21 0.0 -> ../../../../devices/pci0000:00/0000:00:11.1/ide0/0.0

lrwxrwxrwx 1 root root    0 Feb  4 10:21 1.0 -> ../../../../devices/pci0000:00/0000:00:11.1/ide1/1.0

~ # la /sys/block/hd*

/sys/block/hda:

total 0

-r--r--r--  1 root root 4.0K Feb  4 09:38 alignment_offset

lrwxrwxrwx  1 root root    0 Feb  4 09:38 bdi -> ../../class/bdi/3:0

-r--r--r--  1 root root 4.0K Feb  4 09:38 capability

-r--r--r--  1 root root 4.0K Feb  4 09:38 dev

lrwxrwxrwx  1 root root    0 Feb  4 09:38 device -> ../../devices/pci0000:00/0000:00:11.1/ide0/0.0

-r--r--r--  1 root root 4.0K Feb  4 09:38 ext_range

drwxr-xr-x  5 root root    0 Feb  4 09:38 hda1

drwxr-xr-x  5 root root    0 Feb  4 09:38 hda2

drwxr-xr-x  5 root root    0 Feb  4 09:38 hda3

drwxr-xr-x  5 root root    0 Feb  4 09:38 hda4

drwxr-xr-x  5 root root    0 Feb  4 09:38 hda5

drwxr-xr-x  2 root root    0 Feb  4 09:38 holders

drwxr-xr-x  2 root root    0 Feb  4 09:38 power

drwxr-xr-x  3 root root    0 Feb  4 09:38 queue

-r--r--r--  1 root root 4.0K Feb  4 09:38 range

-r--r--r--  1 root root 4.0K Feb  4 09:38 removable

-r--r--r--  1 root root 4.0K Feb  4 09:38 ro

-r--r--r--  1 root root 4.0K Feb  4 09:38 size

drwxr-xr-x  2 root root    0 Feb  4 09:38 slaves

-r--r--r--  1 root root 4.0K Feb  4 09:38 stat

lrwxrwxrwx  1 root root    0 Feb  4 09:38 subsystem -> ../../block

drwxr-xr-x  2 root root    0 Feb  4 09:38 trace

-rw-r--r--  1 root root 4.0K Feb  4 09:38 uevent

drwxr-xr-x 12 root root    0 Feb  4 09:38 .

drwxr-xr-x 20 root root    0 Feb  4 09:38 ..

/sys/block/hdc:

total 0

-r--r--r--  1 root root 4.0K Feb  4 09:38 alignment_offset

lrwxrwxrwx  1 root root    0 Feb  4 09:38 bdi -> ../../class/bdi/22:0

-r--r--r--  1 root root 4.0K Feb  4 09:38 capability

-r--r--r--  1 root root 4.0K Feb  4 09:38 dev

lrwxrwxrwx  1 root root    0 Feb  4 09:38 device -> ../../devices/pci0000:00/0000:00:11.1/ide1/1.0

-r--r--r--  1 root root 4.0K Feb  4 09:38 ext_range

drwxr-xr-x  5 root root    0 Feb  4 09:38 hdc1

drwxr-xr-x  2 root root    0 Feb  4 09:38 holders

drwxr-xr-x  2 root root    0 Feb  4 09:38 power

drwxr-xr-x  3 root root    0 Feb  4 09:38 queue

-r--r--r--  1 root root 4.0K Feb  4 09:38 range

-r--r--r--  1 root root 4.0K Feb  4 09:38 removable

-r--r--r--  1 root root 4.0K Feb  4 09:38 ro

-r--r--r--  1 root root 4.0K Feb  4 09:38 size

drwxr-xr-x  2 root root    0 Feb  4 09:38 slaves

-r--r--r--  1 root root 4.0K Feb  4 09:38 stat

lrwxrwxrwx  1 root root    0 Feb  4 09:38 subsystem -> ../../block

drwxr-xr-x  2 root root    0 Feb  4 09:38 trace

-rw-r--r--  1 root root 4.0K Feb  4 09:38 uevent

drwxr-xr-x  8 root root    0 Feb  4 09:38 .

drwxr-xr-x 20 root root    0 Feb  4 09:38 ..

```

Now the other thing is that I have Ethernet cards swapped, but I have it correctly defined in udev rules.

```

~ # cat /etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules

# program, probably run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single line.

# PCI device 0x1106:0x3065 (via-rhine)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x10ec:0x8139 (8139too)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

```

It seams that it's a udev issue, but it might be configuration only. I was updating my system once every week, but it kept running for about last two months. So I don't know precisely which version of which packet did that mess.

Kernel 2.6.31-gentoo-r4

Udev 151

----------

## dr4cul4

One more thing... How to mount a drive using /sys/bus/... ?

----------

## dr4cul4

Well I managed to mount drive with portage and boot data using mknode and reemerge udev.

When compiling it printed something like this:

```
 *   CONFIG_SYSFS_DEPRECATED:    should not be set. But it is.

 *   CONFIG_SYSFS_DEPRECATED_V2:         should not be set. But it is.

 *   CONFIG_IDE:         should not be set. But it is.
```

I've edited kernel config and rebuild it, configured new kernel and rebooted.... and silence (remote machine). I will check it when I get home (7h from now).

There are 2 options.

 1. It couldn't boot because of missing modules.

 2. It booted correctly which made my eth interfaces swap to their correct names, that would break networking.

----------

## NeddySeagoon

dr4cul4,

CONFIG_IDE is depreciated. If you turned this off and did nothing else, your kernel has no HDD chipset drivers.

That's well known to not work very well.

You should have turned on SCSI DISK Support and selected the correct PATA drivers under SATA too.

This gives all your drives SCSI names, which means you need to fix /etc/fstab and grub.conf too.

I have done this update on remote systems but only after messing up once or twice locally.

----------

## dr4cul4

Well it ended up  with kernel panic... I have quite old hardware, so I don't know if that trick with PATA drivers will work, but I will try. Right now I'm recompiling kernel and udev without old-hd-rules.

Disks seams to be fine except one bad block on one of them, but I already have a replacement.

----------

## VoidMage

You may need to change 'root' parameter of grub (or whatever you're using).

----------

## NeddySeagoon

dr4cul4,

It works on my k6-2 server box

----------

## dr4cul4

As it turn out it was all udev's fault... it seams that they abandoned old drives naming.

After removing use flag "old-hd-rules" and kernel flag CONFIG_SYSFS_DEPRECATED and CONFIG_SYSFS_DEPRECATED_V2, all got back to normal, except ethernet cards.

So I did it like NeddySeagoon wrote and removed also CONFIG_IDE and enabled necessary PATA drivers. All works fine.

Thanks guys.

----------

