LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 01-11-2016, 09:00 PM   #1
monojeffrey
Member
 
Registered: May 2012
Posts: 85
Blog Entries: 1

Rep: Reputation: Disabled
How to Install GRUB which can detect three Linux Distro


Hi ,

Recently i installed three linux Distro in my laptop.
1.opensuse 42
2.Kali 2.0
3.Arch Linux

Disk details
/dev/sda1 - consists of opensuse(primary partition)
/dev/sda4 - kali (primary)
/dev/sda5 - Arch (extended) under /dev/sda3
/dev/sda2 - swap (primary)
/dev/sda3 - Extended (disk)

after installing all three only two opensuse and kali is detectable
i think following may be the reason

opensuse and Kali has grub2 with it
and arch with grub

i need arch to be listed in the boot screen
tried many times of reinstalling the grub on to /dev/sda
but unable to display arch

please correct or suggest a solution for this
 
Old 01-12-2016, 01:56 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
arch usually uses grub2.


2 possible reasons:

1)
do you have os-prober installed on the system that is doing update-grub?
what is the output of
Code:
sudo os-prober
2)
your arch install went wrong.
https://wiki.archlinux.org/index.php/Beginners'_guide
 
Old 01-12-2016, 02:00 AM   #3
monojeffrey
Member
 
Registered: May 2012
Posts: 85

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
arch usually uses grub2.


2 possible reasons:

1)
do you have os-prober installed on the system that is doing update-grub?
what is the output of
Code:
sudo os-prober
2)
your arch install went wrong.
https://wiki.archlinux.org/index.php/Beginners'_guide

i think kali linux has this utility
tried it but no use
arch system was working fine , earlier in /dev/sda1 there was opensuse13.2 , i replaced it with opensuse42
so earlier the /boot was under /dev/sda1 now arch is not having the entry
 
Old 01-12-2016, 02:02 AM   #4
monojeffrey
Member
 
Registered: May 2012
Posts: 85

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
so is there any possibility now to reinstall the grub
which will detect all three linux distri
 
Old 01-12-2016, 02:02 AM   #5
translator1111
Member
 
Registered: Jun 2010
Location: Slovakia
Distribution: Debian 8, Ubuntu 10.04 and 12.04; SLAX 6.0; ConnochaetOS 0.9.; LFS; Natty chip: VT1708S
Posts: 108
Blog Entries: 2

Rep: Reputation: 7
Dear Monojeffrey,
I remember to have a similar problem.
You probably know that If you are using grub you can use menu.lst that is a text file you can edit and add lines to it.

if you are using grub2 you need to add a file in grub folder that is called something like custom...40 where you write the information of the third distribution in your /etc/grub (look for the exact instructions in internet "how to grub2")
and you probalby know already that with grub2 whenever you run update-grub should find automatically all distributions and wtite them to grub.cfg

One of the reasons for not finding arch could be that one of the distributions is using an ext filesystem different.
For instance, grub will not know how to treat ext4, because it was developed when only ext, ext2 and ext3 were used.

Can you explain how did you installed grub2
did you make something like?
(as root or using sudo)
Code:
grub-install /dev/sda
Regards,
M.
 
Old 01-12-2016, 03:26 AM   #6
monojeffrey
Member
 
Registered: May 2012
Posts: 85

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Yes , installed using the below command
grub2-install /dev/sda as root


Thanks,
Manu
 
Old 01-12-2016, 06:36 AM   #7
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Which distro's grub is controlling the boot process? If you're not sure, write your /etc/grub.d/40/_custom file to both the Kali and the Opensuse partitions and run the following:
Code:
grub-mkconfig -o /boot/grub/grub.cfg
 
Old 01-12-2016, 07:05 AM   #8
monojeffrey
Member
 
Registered: May 2012
Posts: 85

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
i ran os-prober inside opensuse which is in /dev/sda1
and which now has the control of grub
the output is shown below

linux-ertm:~ # os-prober
/dev/sda4:Kali GNU/Linux 2.0 (2.0):Kali:linux
^C^Z
[1]+ Stopped os-prober
linux-ertm:~ #


since it took much time to complete
i manually stopped it and i don't see any track of Arch entry
so how to place an entry to /etc/grub.d/40_custom file
 
Old 01-12-2016, 07:08 AM   #9
monojeffrey
Member
 
Registered: May 2012
Posts: 85

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
please find the attached
/boot/grub2/grub.cfg file

and below is fdisk -l

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 232284159 232282112 110.8G 83 Linux
/dev/sda2 232284160 248815615 16531456 7.9G 82 Linux swap / Solaris
/dev/sda3 248817662 438814719 189997058 90.6G 5 Extended
/dev/sda4 438814720 511977471 73162752 34.9G 83 Linux
/dev/sda5 248819712 438814719 189995008 90.6G 83 Linux
Attached Files
File Type: txt grub.cfg.txt (9.0 KB, 31 views)

Last edited by monojeffrey; 01-12-2016 at 07:09 AM.
 
Old 01-12-2016, 08:02 AM   #10
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,502

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Run the "grub-mkconfig" command posted above by RockDoctor. Obviously, there is no entry for Arch in the grub.cfg from Opensuse so this is the simplest way to add it. You could put a standard chainload entry for Arch such as the one below in the Opensuse grub.cfg file to test it, if it works add it to the 40_custom file. If it doesn't, download and run the bootinfoscript and post the output here.

Code:
menuentry 'Arch' {
insmod ext2
set root=(hd0,5)
chainloader +1
}

Last edited by yancek; 01-12-2016 at 03:44 PM.
 
Old 01-12-2016, 08:11 AM   #11
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
The entry for Arch that needs to go in boot/grub.cfg will look something like what is shown below. Back up your grub.cfg file before trying anything like this and make sure you've got rescue media handy - I don't always get it right the first time when I'm messing around with my PC's boot config, and I don't use Arch, Kali, or Opensuse. When I'm doing things like this, I just place the new menuentry in the 10_linux block. If you're unsure of yourself, don't do this!
Code:
menuentry 'Arch Linux on /dev/sda3' --class gnu-linux --class gnu --class os {
    insmod part_msdos 
    insmod ext2
    set root='hd0,msdos5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5  --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'   uuid_of_arch_partition_goes_here
    else
      search --no-floppy --fs-uuid --set=root uuid_of_arch_partition_goes_here
    fi
    linux /boot/arch kernel goes here root=UUID=uuid_of_arch_partition_goes_here ro 
    initrd /boot/Arch initrd goes here
}
 
Old 01-12-2016, 08:51 AM   #12
monojeffrey
Member
 
Registered: May 2012
Posts: 85

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
i just remembered that all the files of Arch under /boot partition are formatted, since while installing arch /boot partition was /dev/sda1(which is formatted recently)

so is there any solution to reconstruct the /boot partition for Arch
mounted Arch(/dev/sda5) and able to see nothing except grub

linux-ertm:~ # mount /dev/sda5 /mnt
linux-ertm:~ # cd /mnt
linux-ertm:/mnt # cd boot/
linux-ertm:/mnt/boot # ls
grub
linux-ertm:/mnt/boot #
 
Old 01-12-2016, 01:49 PM   #13
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
OpenSUSE will AUTO!!!! set up grub to add other OS's at the time of install
read the install instructions !

or
after install
open yast and click on the boot manager ( boot loader)

then click on the "bootloader options" tab
and place a check mark in the "probe for other OS's "

and reboot

now
suse needs to be the default
then all the OS's installed will be on the suse bootloader
 
1 members found this post helpful.
Old 01-12-2016, 05:50 PM   #14
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Now the truth comes out... Not to worry, we've all messed up our systems at some point.
You'll need to first populate Arch's /boot with at least the Arch kernel, initramfs, and System.map. Then regenerate openSUSE's grub.cfg (see John VV's post above or by executing openSUSE's version of update-grub) and you'll have a bootable Arch.
 
1 members found this post helpful.
Old 01-13-2016, 05:39 AM   #15
monojeffrey
Member
 
Registered: May 2012
Posts: 85

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Followed the Steps as per the below link to reconstruct the kernel
From Mount your partitions - section

https://wiki.archlinux.org/index.php/Kernel_Panics

and instructions from John VV in Opensuse

am marking this thread solved using my arch system
 
  


Reply

Tags
arch, desktop, grub, kali, opensuse



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Install grub to MBR, NO config files in linux distro partition rexineffect Linux - Newbie 4 02-20-2014 09:20 AM
can you install a linux distro from grub rescue with out using a live cd dragongraphen Linux - Newbie 12 05-01-2013 12:43 AM
Install Redhat but GRUB not able to boot my intitial slackware distro vitalstrike82 Red Hat 1 11-18-2012 07:44 AM
[SOLVED] Debian Squeeze grub doesn't detect windows partition on install Cultist Debian 3 05-17-2011 04:26 PM
How to use GRUB to detect the other linux partition just.srad Linux - General 13 04-23-2008 12:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 03:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration