You are not logged in.

#1 2012-08-12 12:15:28

jhello
Member
Registered: 2012-08-10
Posts: 35

[SOLVED]grub boot problem

I have my ubuntu on sda7 with grub working normally.
Now I wanna install arch on sda9,so I install grub on sda for a second time.But in arch the

grub-mkconfig -o /boot/grub/grub.cfg

can't find other os(ubuntu and xp) on my harddisk.Then I repair my grub in ubuntu and login it and run

update-grub

,it can find xp but can't find arch,either!why?They can find each other before(this year)!Are they angry with each other?What should I do?
Thanks a lot!

Last edited by jhello (2012-08-13 00:06:30)


人道待人

Offline

#2 2012-08-12 16:58:20

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]grub boot problem

If you have one copy of grub installed to /dev/sda, that means it is installed to your Master Boot Record of the drive itself.  You only have one central MBR per drive (there is also a partition MBR, but that is not what you are using).  If you want to find other operating systems under Arch you need os-prober, I believe it is in the extra repository, but I am not certain.  Install that and update grub under Arch.

I cannot speak as to why Ubuntu is not recognizing windows, but I do know that you should not be updating Grub from two different systems.  I think what you actually may need to do is wipe the MBR (but NOT the partition table!) with dd and then reinstall from one or the other.  But I am not entirely sure if this is necessary as I have never tried to install from two places at once.

If someone else more knowledgeable about Grub could speak to whether or not updating from multiple partitions can be achieved, that would be great.

Offline

#3 2012-08-12 18:49:36

Lennie
Member
From: Sweden
Registered: 2011-10-12
Posts: 146

Re: [SOLVED]grub boot problem

The distro that has its Grub installed in mbr is in charge for booting. There is no need to wipe mbr, whatever was there before is overwritten. It doesn't matter if one runs 'update-grub' (or equivalent) in different distros. It will change that distros grub-file, but that file is not used when that distros Grub is not in mbr (or if one doesn't use chainloading).

Ubuntu's Grub is not so good at recognizing Arch. Some say it works if they mount Arch before they run 'update-grub' in Ubuntu.

I prefer to have a separate partition for Grub which is not connected to any installed distro, and I add new entries manually even for Grub2. When I created it for Grub2 I temporarily mounted the Grub-partition as /boot before installing Grub in mbr.  (First copy the Grub folder there.)

https://wiki.archlinux.org/index.php/Gr … g_grub.cfg

Offline

#4 2012-08-13 00:06:06

jhello
Member
Registered: 2012-08-10
Posts: 35

Re: [SOLVED]grub boot problem

Thanks for both the replies.
But the problem disappeared by itself after I update my ubuntu this morning!
Thanks again!:)


人道待人

Offline

#5 2012-08-13 10:33:58

jhello
Member
Registered: 2012-08-10
Posts: 35

Re: [SOLVED]grub boot problem

I want to add sth...
I have no idea why but after I

$ update-grub2

under ubuntu,arch disappears again from grub...
So I

$ mount /dev/sda9 /mnt
$ update-grub2

Arch appears....
The /dev/sda9 is my arch.


人道待人

Offline

#6 2012-08-14 02:09:50

drobole
Member
From: Norway
Registered: 2012-07-23
Posts: 125

Re: [SOLVED]grub boot problem

I'm using grub in Ubunty myself and I had the same problem until I added this to /etc/grub.d/40_custom



#!/bin/sh
exec tail -n +3 $0
menuentry "Arch linux" {
set root=(hd0,7)
    linux    /boot/vmlinuz-linux root=UUID=0bad9039-8369-433e-836f-e309c1304260
    initrd    /boot/initramfs-linux.img
}



The trick for me was to get the UUID right, which I got using the blkid tool.

Last edited by drobole (2012-08-14 02:10:08)

Offline

Board footer

Powered by FluxBB