# /dev/hda missing [SOLVED]

## ZeLegolas

Hi 

I have something very strange

When my computer boot at the boot time it's detect everything, but when I check:

```
# ls -l /dev/h*

ls: cannot access /dev/h*: No such file or directory
```

I'm not able to mount my boot partition:

```
# mount /boot

mount: special device /dev/hda1 does not exist
```

I have a disk on /dev/hda but I don't see it!

And if I check:

```
# ls -l /sys/block/hda/

total 0

-r--r--r-- 1 root root 4096 Mar 20 01:56 alignment_offset

lrwxrwxrwx 1 root root    0 Mar 20 01:56 bdi -> ../../class/bdi/3:0

-r--r--r-- 1 root root 4096 Mar 20 01:56 capability

-r--r--r-- 1 root root 4096 Mar 20 01:56 dev

lrwxrwxrwx 1 root root    0 Mar 20 01:56 device -> ../../devices/pci0000:00/0000:00:0f.1/ide0/0.0

-r--r--r-- 1 root root 4096 Mar 20 01:56 ext_range

drwxr-xr-x 4 root root    0 Mar 20 01:56 hda1

drwxr-xr-x 4 root root    0 Mar 20 01:56 hda2

drwxr-xr-x 4 root root    0 Mar 20 01:56 hda3

drwxr-xr-x 2 root root    0 Mar 20 01:56 holders

-r--r--r-- 1 root root 4096 Mar 20 01:56 inflight

drwxr-xr-x 2 root root    0 Mar 20 01:56 power

drwxr-xr-x 3 root root    0 Mar 20 01:56 queue

-r--r--r-- 1 root root 4096 Mar 20 01:56 range

-r--r--r-- 1 root root 4096 Mar 20 01:56 removable

-r--r--r-- 1 root root 4096 Mar 20 01:56 ro

-r--r--r-- 1 root root 4096 Mar 20 01:56 size

drwxr-xr-x 2 root root    0 Mar 20 01:56 slaves

-r--r--r-- 1 root root 4096 Mar 20 01:56 stat

lrwxrwxrwx 1 root root    0 Mar 20 01:56 subsystem -> ../../block

-rw-r--r-- 1 root root 4096 Mar 20 01:56 uevent
```

The disk exist! For sure Linux is running on it!   :Smile: 

When I rebuild udev it's told me to disable CONFIG_IDE but I cannot mount my boot partition how I can rebuild the kernel???   :Confused: Last edited by ZeLegolas on Sun Apr 04, 2010 2:54 pm; edited 1 time in total

----------

## cz0

Tru http://www.sysresccd.org/Main_Page.

It's a Gentoo based life CD/USB.

----------

## Rexilion

Try placing the kernel in a boot directory on your current root partition, make sure that grub.conf points to it. That way you can build a kernel that can access /boot again. However, I think something more is going on. Can you post the output of:

dmesg

please?

----------

## aderesch

 *ZeLegolas wrote:*   

> The disk exist! For sure Linux is running on it!  :) 
> 
> When I rebuild udev it's told me to disable CONFIG_IDE but I cannot mount my boot partition how I can rebuild the kernel???  :?

 

Sounds like you are only missing the device nodes.

```
mknod /dev/hda b 3 0; for i in 1 2 3;do mknod /dev/hda${i} b 3 ${i};done
```

should take care of that (if your shell is bash).

Then mount and build a kernel using the libata drivers -- before booting that, you should replace references to hd? by sd?, at least in all boot-critical places.

ad

----------

## d2_racing

What happen when you run this :

```

# fdisk -l

```

----------

## ZeLegolas

 *d2_racing wrote:*   

> What happen when you run this :
> 
> ```
> 
> # fdisk -l
> ...

 

I just see my other disk not the hda

```
 # fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes

255 heads, 63 sectors/track, 9729 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x005423cb

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1               1        1245    10000431   83  Linux

/dev/sda2            1246        9729    68147730   83  Linux
```

----------

## ZeLegolas

 *Rexilion wrote:*   

> Try placing the kernel in a boot directory on your current root partition, make sure that grub.conf points to it.

 

Difficult for that I have to have access to the boot partition!

----------

## Rexilion

 *ZeLegolas wrote:*   

>  *Rexilion wrote:*   Try placing the kernel in a boot directory on your current root partition, make sure that grub.conf points to it. 
> 
> Difficult for that I have to have access to the boot partition!

 

Okay, and temporarily install grub on it   :Razz: 

----------

## ZeLegolas

 *aderesch wrote:*   

> 
> 
> Sounds like you are only missing the device nodes.
> 
> ```
> ...

 

I'm using bash

 :Smile:  thanks for i will try

----------

## ZeLegolas

Thanks for your advice.

For the moment I can not do anything on the server

When it will be possible I will try to create the node manually like aderesch told me and build the kernel without CONFIG_IDE.

I will let you know the result...

----------

## ZeLegolas

First good news with the command of aderesh I was abled to access to my boot partition (and my other partition too)

The bad new it's If I remove CONFIG_IDE like it's asked udev at the boot time I have this message:

 *Quote:*   

> Block device /dev/sda1 is not valid root device
> 
> Could not find the root block device in

 

For now I put back my old kernel but if someone have any ideas...  :Crying or Very sad: 

----------

## VoidMage

If you drop CONFIG_IDE (as you probably should),

you need to select correct drivers under CONFIG_ATA.

----------

## d2_racing

Also your HDD will become /dev/sd* instead of /dev/hd*

----------

## ZeLegolas

 *VoidMage wrote:*   

> If you drop CONFIG_IDE (as you probably should),
> 
> you need to select correct drivers under CONFIG_ATA.

 

It's what I have done

----------

## ZeLegolas

 *d2_racing wrote:*   

> Also your HDD will become /dev/sd* instead of /dev/hd*

 

No it just missing

----------

## ZeLegolas

Ok it's fine now. I build ATA section (just module that I need) in static mode not like a module.

I just don't understand why the module are not working   :Question: 

Thanks for your support

----------

## VoidMage

Well, that's rather simple - to load the module, kernel needs to read the disk,

without this module, it can't see it. You'd need an initramfs with that module,

if you'd want to have it outside kernel.

----------

## d2_racing

It's a good thing that you can boot your box  :Razz: 

----------

