You are not logged in.

#1 2008-12-03 18:38:51

chsims1
Member
From: Holderness, UK
Registered: 2008-11-25
Posts: 83

(Solved) Dual Boot, MBR and Grub Problems.

Partitions:              sda1    WinXP
                            sda2      /
                            sda3       /home
                            sda4       /swap

This morning I attempted to boot into Windows for the first time since I had installed Arch, and I was confronted with an error about a system file (ntoskrnl.exe) being corrupted or missing. I replaced the said file from Window's repair console, but with no effect.  A bit of Googling indicated that this can happen after installing an additional OS presumably as a result of the MBR being modified.  So, first dumb idea of the day was to let Windows console fix the MBR, which was fine for me booting into Windows, but of course I could no longer boot into Arch.

I have tried to sort Grub out with root (hd0,1) and setup (hd0) from within Grub, but on rebooting I get a error message along the lines of "kernel panic: unable to mount root fs on unknown-block (0,0).

Any suggestions please?

# Config file for GRUB - The GNU GRand Unified Bootloader

# /boot/grub/menu.lst


# DEVICE NAME CONVERSIONS 

#

#  Linux           Grub

# -------------------------

#  /dev/fd0        (fd0)

#  /dev/sda        (hd0)

#  /dev/sdb2       (hd1,1)

#  /dev/sda3       (hd0,2)

#


#  FRAMEBUFFER RESOLUTION SETTINGS

#     +-------------------------------------------------+

#          | 640x480    800x600    1024x768   1280x1024

#      ----+--------------------------------------------

#      256 | 0x301=769  0x303=771  0x305=773   0x307=775

#      32K | 0x310=784  0x313=787  0x316=790   0x319=793

#      64K | 0x311=785  0x314=788  0x317=791   0x31A=794

#      16M | 0x312=786  0x315=789  0x318=792   0x31B=795

#     +-------------------------------------------------+

#  for more details and different resolutions see

#  http://wiki.archlinux.org/index.php/GRUB
#Framebuffer_Resolution 


# general configuration:

timeout   5
default   0

color light-blue/black light-cyan/blue


# boot sections follow

# each is implicitly numbered from 0 in the order of appearance below

#

# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.

#

#-*


# (0) Arch Linux

title  Arch Linux

root   (hd0,1)

kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/29987f43-5fa9-4536-9d50-0b11d14d4bc0 ro

initrd /boot/kernel26.img


# (1) Arch Linux

title  Arch Linux Fallback

root   (hd0,1)

kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/29987f43-5fa9-4536-9d50-0b11d14d4bc0 ro

initrd /boot/kernel26-fallback.img


# (1) Windows

title Windows

rootnoverify (hd0,0)

makeactive

chainloader +1

Last edited by chsims1 (2008-12-06 09:40:24)

Offline

#2 2008-12-03 20:10:17

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: (Solved) Dual Boot, MBR and Grub Problems.

All I've ever done when my grub got messed up by windows or another linux that I've tried, is use the install cd to boot into my arch and then go to cli and as root do:

# grub-install /dev/sda

Or it might have been install-grub... etc. That's always worked for me  smile but, iirc, I had to edit the /boot/grub/menu.lst sometimes before rebooting.

It might also be something to do with UUID as recently I remember losing my swap because for some reason the uuid of my swap partition got a different number than what was in my /etc/fstab???


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#3 2008-12-03 20:43:24

hack.augusto
Member
From: Brazil
Registered: 2008-08-28
Posts: 124

Re: (Solved) Dual Boot, MBR and Grub Problems.

I think this would do it:

Boot to your arch CD,
Mount the arch partition "mount /dev/sda1 /mnt",
chroot to it "chroot /mnt",
I looked throuh your menu.lst and it seems perfect, then just re-install it, "grub-install /dev/sda"

Offline

#4 2008-12-04 06:20:23

chsims1
Member
From: Holderness, UK
Registered: 2008-11-25
Posts: 83

Re: (Solved) Dual Boot, MBR and Grub Problems.

Trying to chroot as described above gives the error: "chroot: cannot run command '/bin/bash': No such file or directory."

grub-install /dev/sda results in the error: "Could not find device for /boot: Not found or not a block device."

Offline

#5 2008-12-04 08:54:57

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: (Solved) Dual Boot, MBR and Grub Problems.

Exactly which drive/partition contains linux & which one contains your windows installation?  Where do you wish to install grub exactly (first partition of the Arch install or that drives MBR)?

Offline

#6 2008-12-04 09:28:00

chsims1
Member
From: Holderness, UK
Registered: 2008-11-25
Posts: 83

Re: (Solved) Dual Boot, MBR and Grub Problems.

MoonSwan wrote:

Exactly which drive/partition contains linux & which one contains your windows installation?  Where do you wish to install grub exactly (first partition of the Arch install or that drives MBR)?

As I said in the original post, sda2 is the root partition, sda3 is home and sda4 is a swap. Windows in on sda1.  Grub is installed in the MBR of the disk.

Anyhow, I need to apologize for the results of "mount /dev/sda1" stated 2 posts up.  I didn't realise that I had a pendrive plugged in, & this was turning up as sda1.

(Edit: I have since repeated grub-install /dev/sda with the pendrive removed and I still get the same error message)

So, the current state of play is that I have reinstalled grub through:

root (hd0,1)
setup (hd0)

which seems to go OK, and produce a reasonable menu.lst.

The system boots into windows fine from the grub startup menu, but Arch fails to load terminating in:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block (0,0)

The grub startup menu option to boot linux is definitely looking at root(hd0,1), so why does the above error message refer to "unknown-block (0,0)?" The (0,0) is not referring to drive & partition??

All ideas appreciated, as I'm getting close to re-installing as I have work to do.  It seems a shame though, since everything is obviously still there.

Last edited by chsims1 (2008-12-04 10:30:46)

Offline

#7 2008-12-04 11:38:31

chsims1
Member
From: Holderness, UK
Registered: 2008-11-25
Posts: 83

Re: (Solved) Dual Boot, MBR and Grub Problems.

Having a look at the contents of my grub directory turned up a backup of menu.lst from a few days ago.  I overwrote menu.lst with the original file, and lo and behold it all works again.  I can happily boot into both Arch and Windows big_smile.

The difference between the two files is:

Non-working: 

root (hd0,1)
 kernel /boot/vmlinuz26 root=/dev/sda2 ro vga=normal

Working:

root(hd0,1)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/29987f43-5fa9-4536-9d50-0b11d14d4bc0 ro
initrd /boot/kernel26.img

Could someone kindly give an explanation of these differences for the sake of completeness of the thread?

I still don't know what caused the original problem with Windows not booting, but I'm keeping quiet about that one unless it happens again.  Now, what did I do with that work ....... smile

Offline

#8 2008-12-04 17:58:26

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: (Solved) Dual Boot, MBR and Grub Problems.

Well, the big difference that makes a difference is that the first grub instance has no initrd and the second has one so that is why it works.  See the following for what your initrd (ie. kernel26.img in arch) actually does: http://wiki.archlinux.org/index.php/Initrd


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#9 2008-12-05 08:25:33

chsims1
Member
From: Holderness, UK
Registered: 2008-11-25
Posts: 83

Re: (Solved) Dual Boot, MBR and Grub Problems.

Thank you for that, but it raises a couple of more questions.  Why didn't the process of reinstalling grub generate the initrd line?  Secondly, the wiki entry about initrd says that the Arch installation no longers uses initrd, but initramfs instead.  How come I have ended up with initrd after a new installation, and how do I go about changing to initramfs? (doesn't say in wiki, and no links).

Offline

#10 2008-12-05 16:53:34

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: (Solved) Dual Boot, MBR and Grub Problems.

Sorry, that link may be kind of misleading but you do have an initramfs.  Grub still uses the initrd nomenclature--gee I like that word--for the boot process but you do indeed have an initramfs, and grub doesn't generate an initramfs.  Next time you do a pacman -Syu and there is a kernel upgrade, take note of the cli screen when the kernel is upgrading and you will notice that your initramfs is created with mkinitcpio automatically with your kernel upgrade.


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#11 2008-12-06 03:50:06

kanonmat
Member
From: Linköping, Sweden
Registered: 2008-10-30
Posts: 31

Re: (Solved) Dual Boot, MBR and Grub Problems.

Oh, you managed to boot with the "disk/by-uuid" method. I couldn't do that on Arch, had to use the /dev/sda method. Useful to know that it can be done.
solved?


hp 6910p laptop // phenomII965, gigabyte GA-MA790XT-UD4P mobo, 8600gt desktop.
Sometimes I play xonotic, sometimes I sleep.

Offline

Board footer

Powered by FluxBB