# boot partition problem: grub doesn't boot anymore.

## NullDevice

Hi,

I have a big problem now    :Shocked:   :Shocked: 

I unintentionally deleted all files and directories in my /boot directory.

I did a backup 10 mins before that happend.  But it seems the symbolic links in the boot directory are missing.

The pc doesn't boot anymore.

Im using grub and the config file and everything is there now again. But if i boot, grub doesn't load anything but the grubshell (??). 

I have to specify and then boot the kernel manually in the grub shell.

Then i get a kernel panic:

```
VFS: Cannot open root device "<NULL>" or unknown block (3,3)

Please append the correct "root=" option
```

But in my grub.conf file it is still specified as before, i did not change anything there.

Here is my grub.conf:

```

default 0

timeout 30

title=Gentoo 2.6.12-rc4 15Aug05

root (hd0,1)

kernel (hd0,1)/2.6.12_Gr4_0.15Aug05 root=/dev/hdc3 video=vesafb

title=Gentoo 2.6.12-rc4 26Jul05

root (hd0,1)

kernel (hd0,1)/2.6.12_Gr4_0.26Jul05 root=/dev/hdc3 video=vesafb

title=WinXP

rootnoverify (hd0,0)

makeactive

chainloader +1

```

Any suggestions?

I dont wanna reinstall the whole OS   ;(

----------

## davidgurvich

You will need to provide more information.  Post the contents of /etc/fstab, the contents of /boot and /boot/grub, the actual partition map with the fs on each.

----------

## NullDevice

```
root@tty3[hdc2]# ls -laR

.:

insgesamt 9062

drwxr-xr-x  4 root root    1024 2006-02-26 15:00 .

drwxr-xr-x  8 root root    1024 2006-02-26 16:57 ..

-rwx------  1 root root 1921859 2006-02-25 19:47 2.6.12_Gr4_0.15Aug05

-rwx------  1 root root 2099072 2006-02-25 19:47 2.6.12_Gr4_0.17Jul05

-rwx------  1 root root 1941205 2006-02-25 19:47 2.6.12_Gr4_0.26Jul05

lrwxrwxrwx  1 root root       1 2006-02-26 14:59 boot -> .

drwx------  2 root root    1024 2006-02-26 16:50 grub

drwx------  2 root root    1024 2006-02-25 19:47 lost+found

lrwxrwxrwx  1 root root      24 2006-02-25 19:50 System.map -> /boot/System.map.15Aug05

-rwx------  1 root root 1055197 2006-02-25 19:47 System.map.15Aug05

-rwx------  1 root root 1142420 2006-02-25 19:47 System.map.17Jul05

-rwx------  1 root root 1068932 2006-02-25 19:47 System.map.26Jul05

./grub:

insgesamt 308

drwx------  2 root root   1024 2006-02-26 16:50 .

drwxr-xr-x  4 root root   1024 2006-02-26 15:00 ..

-rwx------  1 root root    197 2006-02-25 19:47 default

-rwx------  1 root root     45 2006-02-25 19:47 device.map

-rw-r--r--  1 root root   7776 2006-02-26 15:17 e2fs_stage1_5

-rw-r--r--  1 root root   7504 2006-02-26 15:17 fat_stage1_5

-rwx------  1 root root    403 2006-02-25 19:47 grub.conf

-rwx------  1 root root   1624 2006-02-25 19:47 grub.conf.sample

-rw-r--r--  1 root root   8320 2006-02-26 15:17 jfs_stage1_5

-rw-r--r--  1 root root   7008 2006-02-26 15:17 minix_stage1_5

-rw-r--r--  1 root root   9216 2006-02-26 15:17 reiserfs_stage1_5

-rwx------  1 root root  33856 2006-02-25 19:47 splash.xpm.gz

-rw-r--r--  1 root root    512 2006-02-26 15:17 stage1

-rw-r--r--  1 root root 108168 2006-02-26 15:17 stage2

-rwx------  1 root root 108296 2006-02-25 19:47 stage2_eltorito

-rw-r--r--  1 root root   9288 2006-02-26 15:17 xfs_stage1_5

./lost+found:

insgesamt 2

drwx------  2 root root 1024 2006-02-25 19:47 .

drwxr-xr-x  4 root root 1024 2006-02-26 15:00 ..

```

```

cat etc/fstab

# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>

/dev/hdc1               /mnt/c          ntfs            nouser,ro,utf8,uid=1000,gid=0,umask=077,iocharset=iso8859-1     0 0

/dev/hdc2               /boot           ext2            defaults,noatime        1 2

/dev/hdc3               /               ext3            noatime                 0 1

/dev/hdc6               /home           ext3            noatime                 0 1

/dev/hdc5               none            swap            sw                      0 0

/dev/cdroms/cdrom0      /mnt/cdrom      auto            noauto,ro               0 0

/dev/fd0                /mnt/floppy     auto            noauto                  0 0

/dev/sda1               /mnt/stick       auto           defaults,rw,noauto,users,sync 0 0

none                    /proc           proc            defaults                0 0

none                    /dev/shm        tmpfs           nodev,nosuid,noexec     0 0

```

```

root@tty2[hdc3]# fdisk -l

Platte /dev/hdc: 60.0 GByte, 60022480896 Byte

255 KÃ¶pfe, 63 Sektoren/Spuren, 7297 Zylinder

Einheiten = Zylinder von 

    GerÃ¤t  boot.     Anfang        Ende     BlÃ¶cke   Id  System

    /dev/hdc1   *           1        3842    30860833+   7  HPFS/NTFS

    /dev/hdc2            3843        3848       48195   83  Linux

    /dev/hdc3            3849        5064     9767520   83  Linux

    /dev/hdc4            5065        7297    17936572+   5  Erweiterte

    /dev/hdc5            5065        5216     1220908+  82  Linux Swap / Solaris

    /dev/hdc6            5217        7297    16715601   83  Linux

    

    Platte /dev/sda: 132 MByte, 132120576 Byte

    16 KÃ¶pfe, 32 Sektoren/Spuren, 504 Zylinder

    Einheiten = Zylinder von 512 root@tty2[hdc3]# fdisk -l

    

    Platte /dev/hdc: 60.0 GByte, 60022480896 Byte

    255 KÃ¶pfe, 63 Sektoren/Spuren, 7297 Zylinder

    Einheiten = Zylinder von 16065 

    

        GerÃ¤t  boot.     Anfang        Ende     BlÃ¶cke   Id  System

   /dev/sda1   *           1         503      128752    6  FAT16

```

----------

## NullDevice

ok.... i can specify the root partition in the grub-shell in the beginning, then it boots.

....root=/dev/hdc3

But why do i have to? Its already in the grub.conf file, as it was all the time...  -> ?

 :Rolling Eyes: 

----------

## FcukThisGame

EDIT: Whoops, posted on the wrong page.

----------

## davidgurvich

In your grub.conf root is (hd0,1).  That usually refers to /dev/hda2, but you have /dev/hdc2 as your boot partition.  If so, I believe you need to use (hd2,1).  Try going to edit mode during grub boot and see if changing that to root (hd2,1) does anything.  Use tab completion to have grub help you out.  

I don't know if that's the problem as you seem to have been booting with no trouble as of July with this setup.

----------

## NullDevice

No, thats not the problem.

I dont know why though... i always booted with this conf, and using hd(2,1) was wrong for some reason and didnt boot.

I tried thinking and googleing about it with no results.

But i think the reason is, that grub maybe uses hd(0,1) for the first HARDDISK, not the first DEVICE. Could that be?

Because there is no hda now, but a hdb (a dvdrom) , then the first harddisk hdc !

----------

