[UPDATED - 09/27/2016] Install Grub2 in Salix

Post Reply
pnbalaji
Posts: 99
Joined: 23. Apr 2013, 21:02

[UPDATED - 09/27/2016] Install Grub2 in Salix

Post by pnbalaji »

Hi,

I have installed the latest Salix 14.2 in my laptop and the LILO installation failed. The laptop had SolusOS and Windows 10 on it. Due to the failure of LILO install, but laptop failed to boot. Unfortunately, the documentation on Salix Forums seem to be outdated. I looked at the post viewtopic.php?p=16546. By adding the parameters "huge.s root=/dev/sda6 rdinit= ro" was able to get me to the login prompt, but my keyboard and mouse was not working and hence I could not install grub. After doing several google searches, I finally found a method that worked for me and I am listing the procedure below.

1. Install Salix using a DVD or USB and during the boot loader prompt, select the option "Do not install LILO".
2. I have used an Xubuntu 14.04 live USB to install grub. Any live USB should work. Boot from Xubuntu 14.04 live USB. Once logged in, connect to the internet.
3. Open up a terminal and enter the following commands.

Code: Select all

sudo mount /dev/sda6 /mnt                    ==> Replace /dev/sda6 with the partition where Salix is installed.
cd /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
4. At this point, we are already in Salix.
5. Check to see if we have internet connection by typing the below command. Usually chrooted environments will not have network connection.

Code: Select all

ping yahoo.com
6. If you get an error message saying "host not available", copy the contents of /etc/resolv.conf of the Xubuntu system into the chrooted system. In my case, I had to add "nameserver 192.168.43.1" in the /etc/resolv.conf of the chrooted salix system.
7. Try "ping yahoo.com" and make sure you are able to see the replies. The output should be something like the one shown below.

Code: Select all

Pinging yahoo.com [98.138.253.109] with 32 bytes of data:
Reply from 98.138.253.109: bytes=32 time=238ms TTL=45
Reply from 98.138.253.109: bytes=32 time=238ms TTL=45

Ping statistics for 98.138.253.109:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 238ms, Maximum = 238ms, Average = 238ms
8. From the chrooted salix terminal, type the below command and choose the nearest mirror to your country. Once the repo is selected, it will be updated automatically.

Code: Select all

/usr/sbin/reposetup
9. From the chrooted salix terminal, type the below commands one after the other.

Code: Select all

/usr/sbin/slapt-get --install grub                    ==> If grub is not available, this command will install grub.
/usr/sbin/grub-install /dev/sda
/usr/sbin/grub-install --recheck /dev/sda
/usr/sbin/update-grub
10. At this point, a new grub configuration file is generated and grub installed into the MBR of /dev/sda. Reboot and enjoy the Multiboot with grub2.

Thanks,
Balaji.
User avatar
gapan
Salix Wizard
Posts: 6236
Joined: 6. Jun 2009, 17:40

Re: [UPDATED - 09/27/2016] Install Grub2 in Salix

Post by gapan »

Hi Balaji, thanks for taking the time to write this up!
pnbalaji wrote:6. If you get an error message saying "host not available", copy the contents of /etc/resolv.conf of the Xubuntu system into the chrooted system. In my case, I had to add "nameserver 192.168.43.1" in the /etc/resolv.conf of the chrooted salix system.
Using the google dns would work on all systems:

Code: Select all

nameserver 8.8.8.8
It would be interesting to see what caused the LILO failure in your case.
Image
Image
pnbalaji
Posts: 99
Joined: 23. Apr 2013, 21:02

Re: [UPDATED - 09/27/2016] Install Grub2 in Salix

Post by pnbalaji »

After re-installing grub, my Windows 10 is having problems during startup. So, after fixing this, I will try to re-install Salix. During the Salix install, I only got a generic error message like "Boot loader failed to install" or something like that.

Is it possible to capture logs for the lilo install failure?

Thanks,
Balaji.
pnbalaji
Posts: 99
Joined: 23. Apr 2013, 21:02

Re: [UPDATED - 09/27/2016] Install Grub2 in Salix

Post by pnbalaji »

gapan wrote:Hi Balaji, thanks for taking the time to write this up!
pnbalaji wrote:6. If you get an error message saying "host not available", copy the contents of /etc/resolv.conf of the Xubuntu system into the chrooted system. In my case, I had to add "nameserver 192.168.43.1" in the /etc/resolv.conf of the chrooted salix system.
Using the google dns would work on all systems:

Code: Select all

nameserver 8.8.8.8
It would be interesting to see what caused the LILO failure in your case.
I guess if "ping yahoo.com" doesn't work, the chrooted environment cannot find google dns also (8.8.8.8). We need to provide the DNS what ever is currently accessible, which is the one supplied by ISP or Hotspot. I used my mobile's hotspot to create a wifi. I haven't tested google dns though.

Thanks,
Balaji.
Post Reply