You are not logged in.

#1 2009-10-16 08:01:31

rikardo
Member
Registered: 2006-09-03
Posts: 9

My PC skips GRUB?

I have one HD and created a NTSF partition with the size of the half HD, on that part I installed Windows XP.

On the rest I recently installed Archlinux, and on the install configured GRUB. But when I start my computer it does not start GRUB it uses Windows as default, what could be the problem here?

Offline

#2 2009-10-16 08:07:07

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: My PC skips GRUB?

Did you actually install grub onto the MBR? If you installed into onto the arch partition, then thanks to the default windows loader in MBR, it never gets to grub.

Offline

#3 2009-10-16 08:09:34

rikardo
Member
Registered: 2006-09-03
Posts: 9

Re: My PC skips GRUB?

Aha, no I did not... Windows is on sda1 and sda2 is the /boot so I think I put it there. Is there any workaround in XP I could use or what do I need to do?

Offline

#4 2009-10-16 08:18:12

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: My PC skips GRUB?

One other thing you can try is to change the "bootable" flag from the windows partition to the one where you installed grub (e.g. in fdisk or cfdisk). But it might be that once you boot windows, they automatically change the "bootable" flag back to itself - this you would have to try out.

Otherwise, there's no harm in installing grub to MBR (/dev/sda without any number), you just need to remember not to wipe the boot partition without restoring the original bootloader (otherwise when you turn on the computer, you just get an error message from grub and the comp freezes).

Offline

#5 2009-10-16 08:18:15

rikardo
Member
Registered: 2006-09-03
Posts: 9

Re: My PC skips GRUB?

Could you explain the last thing about what I should not do little more please?

Last edited by rikardo (2009-10-16 08:20:46)

Offline

#6 2009-10-16 08:24:16

rikardo
Member
Registered: 2006-09-03
Posts: 9

Re: My PC skips GRUB?

We make it more simple, if I install GRUB on the "/dev/sda" it will do it? But "dev" lies under "/"? or is it a own partition???

Offline

#7 2009-10-16 08:29:45

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: My PC skips GRUB?

Well the way computer starts is that first BIOS does some things and then it loads the MBR of the "first" harddrive and executes it. Usually this part of MBR is "a bootloader". Now the simple one shipped with windows is doing the following thing: it finds the first primary partition with the "bootable" flag on, and then loads its first sector (or whatever unit of data) and executes it.

In comparison, the bootloader is grub, then what it does is it remembers which partition is the one that contains its configuration files, reads some files from there and presents you with the menu based on those config files [it's the stuff you see in /boot/grub/*, notably the config file is /boot/grub/menu.lst]. So in fact grub has "two parts" - one of them is in MBR (or at the beginning of a partition if you installed it there; this has to be less than 512 bytes, so you can't to magic with it), and the second part is the "stuff in /boot/grub". Conclusion: if you wipe out the stuff in /boot/grub (e.g. wipe the boot partition), grub is incomplete and it fails to run. But since it's the first (and only) program to be run on boot, it failing means that the computer won't boot.

Offline

#8 2009-10-16 08:30:45

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: My PC skips GRUB?

rikardo wrote:

We make it more simple, if I install GRUB on the "/dev/sda" it will do it? But "dev" lies under "/"? or is it a own partition???

/dev/ has nothing to do with anything until the linux kernel boots. It is only a way to refer to physical devices in linux.

EDIT: by the way, it's usually dynamically created by udev and the kernel, so unless you boot linux, "it does not exist" smile

Last edited by bender02 (2009-10-16 08:32:32)

Offline

#9 2009-10-16 13:07:51

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: My PC skips GRUB?

grub doesn't care about /dev/sdX, or /dev for that matter. It gets its hard-drives from the bios and names them (hd0) for the first disk, (hd1) for the second, etc.
The partitions are named (hd0,0) for the first partition on the first disk, (hd0,1) for the 2nd partition etc etc

You can easily use the MBR as is, XP will usually leave it alone. Now vista is a different animal alltogether - whenever it updates itself, it will rewrite the MBR (and it will also change the active partition to be the one it resides on itself).

If I were you, I would just leave the mbr alone and use 'fdisk' to change the 'active' partition - ie the one with the 'boot' flag set (you need a live-cd to do this, cant be done from within windows as it doesn't recognize anything but itself)

Last edited by perbh (2009-10-16 13:09:15)

Offline

Board footer

Powered by FluxBB