# Server does not boot - how can I find the error? [SOLVED]

## Cruel

Hello guys.

Today, I installed gentoo hardened on my rootserver with RAID 1. 

It was the first time I did this so I followed every step that was mentioned in the documentation: http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml

Except the LVM and the RAID 0 I did everything that was mentioned.

After finishing my installation, I rebooted the server but even after one hour the server didn't answered my ping-requests nor ssh-requests.

I think the problem is 1. the kernel or 2. I did something wrong with the raid.

My problem now is that I can't find the error because there are zero logs and I can't watch on the screen because the server is 

hosted far away from me.

Below are some more information:

cat /proc/partitions

 *Quote:*   

> 
> 
> major minor  #blocks  name
> 
>    7        0    1572864 loop0
> ...

 

/etc/fstab

 *Quote:*   

> 
> 
> /dev/md1                /boot           ext2            noauto,noatime  1 2
> 
> /dev/md3                /               ext4            noatime         0 1
> ...

 

.conf

 *Quote:*   

> 
> 
> Multi-device support (RAID and LVM)  --->
> 
> [*] Multiple devices driver support (RAID and LVM)
> ...

 

grub.conf

 *Quote:*   

> 
> 
> default 0
> 
> timeout 5
> ...

 

grub

 *Quote:*   

> 
> 
> grub> root (hd0,0)
> 
>  Filesystem type is ext2fs, partition type 0x83
> ...

 Last edited by Cruel on Thu Aug 15, 2013 5:53 pm; edited 1 time in total

----------

## NeddySeagoon

Cruel,

Post your kernel .config file and your 

```
ls -l /boot
```

output.

Also the content of your  ls /etc/runlevels/default, ls /etc/runlevels/boot  ls /etc/runlevels/sysinit

Who is your provider?

How did you assign the IP addess and to what interface name?

New udev assigns seemingly random names - not eth0.

You should have installed grub twice since you have raid1, once on each half of the raid.

This lets the system boot with one dead drive, regardless of which drive it is.

Exactly what command did you use to make the raid set for root.?

How is the root raid set being assembled before you attempt to mount root?

Your Raid Support kernel menu is missing  

```
[ ]     Autodetect RAID arrays during kernel boot
```

which works for some raid sets.

I expect your provider will let you netboot the box, so you can poke around, get into your chroot and answer the above.

You will fined wgetpaste a great help.

----------

## Cruel

My provider is hetzner.de (a german hosting company). They have a special section for installing gentoo

and there is declared that dhcp is allowed. (dhcpcd recommended)

So I didn't assign any address I just installed dhcpcd and added it to rc-update.

Well, I'm pretty sure that I've installed grub on both partitions with

root (hd0,0) && setup (hd0) / root (hd1,0) && setup (hd1)

 *Quote:*   

> Exactly what command did you use to make the raid set for root.?

 

Hmm. I just added a line to the /etc/fstab file. And, of course, in the grub config I've set "root=/dev/md3".

Actually, nothing else. Did I miss something?

 *Quote:*   

> 
> 
> How is the root raid set being assembled before you attempt to mount root?
> 
> Your Raid Support kernel menu is missing  
> ...

 

Uh yeah sorry. I forgot to copy this but it's definitely enabled in the kernel config. 

 *Quote:*   

> Post your kernel .config file

 

http://pastebin.com/Z4YZRLFJ

2. ls -l /boot 

 *Quote:*   

> 
> 
> -rw------- 1 root root   68608 14. Aug 16:21 System.map
> 
> lrwxrwxrwx 1 root root       1 14. Aug 20:18 boot -> .
> ...

 

3. ls /etc/runlevels/default

 *Quote:*   

> 
> 
> lrwxrwxrwx 1 root root 18 14. Aug 15:24 dhcpcd -> /etc/init.d/dhcpcd
> 
> lrwxrwxrwx 1 root root 17 14. Aug 11:12 local -> /etc/init.d/local
> ...

 

4. ls -l /etc/runlevels/boot

 *Quote:*   

> 
> 
> lrwxrwxrwx 1 root root 20 14. Aug 11:12 bootmisc -> /etc/init.d/bootmisc
> 
> lrwxrwxrwx 1 root root 16 14. Aug 11:12 fsck -> /etc/init.d/fsck
> ...

 

5. ls -l /etc/runlevels/sysinit

 *Quote:*   

> 
> 
> lrwxrwxrwx 1 root root 17 14. Aug 11:12 devfs -> /etc/init.d/devfs
> 
> lrwxrwxrwx 1 root root 17 14. Aug 11:12 dmesg -> /etc/init.d/dmesg
> ...

 

----------

## NeddySeagoon

Cruel,

To make your raid set for root, you will have used a command like

```
mdadm --create /dev/md3 --level=raid1 --metadata=0.90 --raid-devices=2 /dev/sda3 /dev/sdb3
```

The metadata option id key here as the kernel will only autoassemble raid sets made with metadata version 0.90.  This is not the defualt.

Run 

```
mdadm -E /dev/sda3
```

You should get something like

```
 $ sudo mdadm -E /dev/sda5

/dev/sda5:

          Magic : a92b4efc

        Version : 0.90.00
```

at the top. Any other version means you need an initrd to assemble the raid before you can mount root.

Raid autodetect requires that the partitions are of type fd, as below

```
   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *          63       80324       40131   fd  Linux raid autodetect

/dev/sda2           80325     1124549      522112+  82  Linux swap / Solaris

/dev/sda4         1124550  1953520064   976197757+   5  Extended

/dev/sda5         1124613    11631059     5253223+  fd  Linux raid autodetect
```

Check out the above.

```
lrwxrwxrwx 1 root root 20 14. Aug 14:47 net.eth0 -> /etc/init.d/net.eth0 
```

probably isn't right unless you have taken special steps to cripple udevs interface renaming.

One way to do this is to add 

```
net.ifnames=0
```

 to the kernel line in grub.conf.

dhcpcd should not be needed in the default runlevel as attempting to bring up the interface will start it anyway.  It should be harmless. 

You must have 

```
# CONFIG_DEVTMPFS is not set
```

on in your kernel.  It populates /dev for you.

When you turn that on in menuconfig, you will se another option to automount /dev as DEVTMPFS at boot.  Choose that too. 

You are probably not going to boot your server over NFS so turn off 

```
CONFIG_ROOT_NFS=y
```

There are two issues to address there. A few kernel settings and a kernel command line parameter.

The kernel settings will stop your system booting, the kernel command line parameter will stop eth0 getting renamed which is required for sshd to start.

sshd will take several minutes to start the first time as it needs to make new host keys, which require data from /dev/random.  /dev/random depends on the kernel entropy pool and will block when its empty.  Entropy is derived from random events, of which there are very few on a server. 

I cannot check your kernel hardware settings. I need your lspci output for that. 

I'm aware of  hetzner.de - at least one dev has a box there and I've looked at their Dutch auction.

----------

## Cruel

 *NeddySeagoon wrote:*   

> Cruel,
> 
> To make your raid set for root, you will have used a command like
> 
> ```
> ...

 

First of all - big thanks. I didn't know that you have to make your partition raid automount. That was not mentioned in the documentation (really wired).

The server now boots correctly and I see logs!  :Smile: 

I just have one problem left. My system does not recognize eth0. This is what comes up in the logs:

 *Quote:*   

> 
> 
> * Checking your configfile (/etc/syslog-ng/syslog-ng.conf) ...
> 
>  [ ok ]
> ...

 

This is my lspci output:

 *Quote:*   

> 
> 
> 00:00.0 Host bridge: Intel Corporation Haswell DRAM Controller (rev 06)
> 
> 00:02.0 VGA compatible controller: Intel Corporation Haswell Integrated Graphics Controller (rev 06)
> ...

 

----------

## NeddySeagoon

Cruel,

```
# CONFIG_R8169 is not set
```

is the kernel option for your 

```
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 06) 
```

You may as well make it built in as you will always need it.

----------

## Cruel

Thank you very much. I already compiled the driver into the kernel.

The problem was that I had net.eth0 in my runlevel and that prevented sshd to start.  :Wink: 

However, thank you very much!

----------

