How to install Salix with Grub2 instead of LILO.

User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

How to install Salix with Grub2 instead of LILO.

Post by globetrotterdk »

I have noticed that there are some people coming from other distros, interested in trying out Salix, that find it difficult to get Grub2 installed on their system. Here is a little HowTo.
1) Boot from the install CD
2) Install system step by step rather than automatic, to avoid installing LILO.
3) Make a note of your root partition.
4) Reboot leaving the install CD in the drive.
5) At boot add the following (remember the space before "ro"):

Code: Select all

hugesmp.s root=/dev/partition rdinit= ro
6) When logged into your new system, run the following as root in a terminal:

Code: Select all

slapt-get --update && slapt-get --install grub2
7) Run the following as root in a terminal to install Grub to your MBR:

Code: Select all

grub-install /dev/<yourdev>
(<yourdev> = e.g. usually /dev/sda)

8) Run the following as root in a terminal to update Grub:

Code: Select all

update-grub
9) You should be able to boot into your new system with Grub at restart. Remember to take the install CD out of your drive.
10) Enjoy Salix :)

EDIT (26/5-2013)

Please notice that the name of the kernel in Salix 14.0 has cchanged to "huge.s", so you should add the following at the boot prompt::

Code: Select all

huge.s root=/dev/partition rdinit= ro
I am not sure if the name will change in the future, but the helpfull message before the boot prompt on the install CD, will reflect kernel name changes.

I also added Shador's corrected syntax.
Last edited by globetrotterdk on 26. May 2013, 16:44, edited 5 times in total.
Military justice is to justice what military music is to music. - Groucho Marx
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: How to install Salix with Grub2 instead of LILO.

Post by Shador »

Thanks for these instructions. Some annotations:
globetrotterdk wrote: 7) Run the following as root in a terminal to install Grub to your MBR:

Code: Select all

grub-install

Code: Select all

grub-install /dev/<yourdev>
<yourdev> = e.g. usually /dev/sda


You can edit many defaults by opening the file /etc/default/grub with a text editor. When changing that file, upgrading the kernel or adding a new kernel/OS you always need to run update-grub (as root) afterwards to actually reflect the changes in your menu.
This is because (usually) at boot time all settings are read from /boot/grub/grub.cfg by grub2 at boot time. Creating that file manually can be quite daunting so update-grub provides a facility to easily create grub.cfg for a common scenario.
Image
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: How to install Salix with Grub2 instead of LILO.

Post by globetrotterdk »

Shador wrote:Thanks for these instructions. Some annotations:
globetrotterdk wrote: 7) Run the following as root in a terminal to install Grub to your MBR:

Code: Select all

grub-install

Code: Select all

grub-install /dev/<yourdev>
<yourdev> = e.g. usually /dev/sda
Ooops, but of course. Thanks :)
Military justice is to justice what military music is to music. - Groucho Marx
User avatar
pawn
Posts: 5
Joined: 19. Aug 2011, 12:57

Re: How to install Salix with Grub2 instead of LILO.

Post by pawn »

Many thanks !!

Kind regards
pawn
Freco
Posts: 8
Joined: 17. May 2012, 13:45

Re: How to install Salix with Grub2 instead of LILO.

Post by Freco »

Shador wrote:

Code: Select all

grub-install /dev/<yourdev>
<yourdev> = e.g. usually /dev/sda
Hello, I have written in terminal after the grub installation:

Code: Select all

grub-install /dev/sda 
But I've got an error message telling me several times:

Code: Select all

erreur : cannot read from '/dev/fd0' 
I don't understand why is looking in the floppy disk.
I have installed salix on sda2, and I would like to install grub on the MBR.

Cheers,

Freco.
.Pentium III ; 800MHz, 512 Mo RAM
Salix-FluxBox / Swift Linux / Crunchbang / Puppy Linux
.Amd Athlon 64 4400+ 2,3 GHz, 1Go RAM
Crunchbang / LMDE 64 Cinnamon / Ubuntu
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: How to install Salix with Grub2 instead of LILO.

Post by Shador »

Does it still say?

Code: Select all

Installation finished. No error reported.
Otherwise try running this:

Code: Select all

grub-install --no-floppy /dev/sda
Image
Freco
Posts: 8
Joined: 17. May 2012, 13:45

Re: How to install Salix with Grub2 instead of LILO.

Post by Freco »

Shador wrote:Does it still say?

Code: Select all

Installation finished. No error reported.
No, it doesn't say that. Long seconds before saying again and again:

Code: Select all

 erreur : cannot read from '/dev/fd0'
Shador wrote: Otherwise try running this:

Code: Select all

grub-install --no-floppy /dev/sda
There is no difference, the same error message.
.Pentium III ; 800MHz, 512 Mo RAM
Salix-FluxBox / Swift Linux / Crunchbang / Puppy Linux
.Amd Athlon 64 4400+ 2,3 GHz, 1Go RAM
Crunchbang / LMDE 64 Cinnamon / Ubuntu
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: How to install Salix with Grub2 instead of LILO.

Post by Shador »

Freco wrote:
Shador wrote: Otherwise try running this:

Code: Select all

grub-install --no-floppy /dev/sda
There is no difference, the same error message.
Then try this:

Code: Select all

grub-install --no-floppy --recheck /dev/sda
And be sure to leave the command run to termination!
Image
Freco
Posts: 8
Joined: 17. May 2012, 13:45

Re: How to install Salix with Grub2 instead of LILO.

Post by Freco »

Shador wrote: Then try this:

Code: Select all

grub-install --no-floppy --recheck /dev/sda
And be sure to leave the command run to termination!
This line works! Thanks!

But the problems aren't finished...
I've done then :

Code: Select all

update-grub
and I have this:

Code: Select all

Generating grub.cfg ...
Found background / /boot/grub/salix.jpg
Found linux image: /boot/vmlinuz-huge-smp-2.6.37.6-smp
   No volume groups found
Found Linux Mint Debian Edition (1) on /dev/sda1
done
When I reboot, I just have a quick "grub" written, but I have no menu... just a black screen...

I don't know if this will help:
/etc/default/grub:

Code: Select all

 

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

# If you want to dynamically change the default entry booted using
# `grub-set-default' or `grub-reboot', set this to "saved".
# Placing a number here will always boot that entry and the previously
# mentioned two tools won't have any effect.
# For savedefault functionality
GRUB_DEFAULT=saved

GRUB_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_DISTRIBUTOR="Salix $(sed -e 's/^Slackware //' /etc/slackware-version)"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="vt.default_utf8=1"

# Uncomment this to enable savedefault support (i.e. the last chosen
# menuentry is booted the next time).
# Note: This depends on "GRUB_DEFAULT=saved"
#GRUB_SAVEDEFAULT=true

# The background image which should be used for the graphical terminal.
GRUB_BACKGROUND="/boot/grub/salix.jpg"

# The theme which should be used for the graphical terminal.
# This makes the background option obsolete.
#GRUB_THEME="/boot/grub/mytheme"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_LINUX_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to disable the detection of other installed operating
# systems using os-prober
#GRUB_DISABLE_OS_PROBER="true"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
or this one: /boot/grub/grub.cfg:

Code: Select all

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="${saved_entry}"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root 82ce47b6-3c0f-440d-ada1-b50696b3bc8c
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos2)'
  search --no-floppy --fs-uuid --set=root 82ce47b6-3c0f-440d-ada1-b50696b3bc8c
  set locale_dir=($root)/boot/grub/locale
  set lang=fr_FR
  insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root 82ce47b6-3c0f-440d-ada1-b50696b3bc8c
insmod jpeg
background_image -m stretch /boot/grub/salix.jpg
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Salix 13.37.0 GNU/Linux, avec Linux 2.6.37.6-smp' --class salix --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos2)'
	search --no-floppy --fs-uuid --set=root 82ce47b6-3c0f-440d-ada1-b50696b3bc8c
	echo	'Chargement de Linux 2.6.37.6-smp ...'
	linux	/boot/vmlinuz-huge-smp-2.6.37.6-smp root=/dev/sda2 ro vt.default_utf8=1 quiet
}
menuentry 'Salix 13.37.0 GNU/Linux, avec Linux 2.6.37.6-smp (mode de dépannage)' --class salix --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos2)'
	search --no-floppy --fs-uuid --set=root 82ce47b6-3c0f-440d-ada1-b50696b3bc8c
	echo	'Chargement de Linux 2.6.37.6-smp ...'
	linux	/boot/vmlinuz-huge-smp-2.6.37.6-smp root=/dev/sda2 ro single vt.default_utf8=1
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "LinuxMint GNU/Linux, avec Linux 3.2.0-2-486 (on /dev/sda1)" --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root ec8b0a41-fb09-4e2c-a85e-f2165515294b
	linux /boot/vmlinuz-3.2.0-2-486 root=UUID=ec8b0a41-fb09-4e2c-a85e-f2165515294b ro quiet
	initrd /boot/initrd.img-3.2.0-2-486
}
menuentry "LinuxMint GNU/Linux, avec Linux 3.2.0-2-486 (mode de dépannage) (on /dev/sda1)" --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root ec8b0a41-fb09-4e2c-a85e-f2165515294b
	linux /boot/vmlinuz-3.2.0-2-486 root=UUID=ec8b0a41-fb09-4e2c-a85e-f2165515294b ro single
	initrd /boot/initrd.img-3.2.0-2-486
}
menuentry "LinuxMint GNU/Linux, avec Linux 2.6.39-2-486 (on /dev/sda1)" --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root ec8b0a41-fb09-4e2c-a85e-f2165515294b
	linux /boot/vmlinuz-2.6.39-2-486 root=UUID=ec8b0a41-fb09-4e2c-a85e-f2165515294b ro quiet
	initrd /boot/initrd.img-2.6.39-2-486
}
menuentry "LinuxMint GNU/Linux, avec Linux 2.6.39-2-486 (mode de dépannage) (on /dev/sda1)" --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root ec8b0a41-fb09-4e2c-a85e-f2165515294b
	linux /boot/vmlinuz-2.6.39-2-486 root=UUID=ec8b0a41-fb09-4e2c-a85e-f2165515294b ro single
	initrd /boot/initrd.img-2.6.39-2-486
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

.Pentium III ; 800MHz, 512 Mo RAM
Salix-FluxBox / Swift Linux / Crunchbang / Puppy Linux
.Amd Athlon 64 4400+ 2,3 GHz, 1Go RAM
Crunchbang / LMDE 64 Cinnamon / Ubuntu
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: How to install Salix with Grub2 instead of LILO.

Post by Shador »

Freco wrote:When I reboot, I just have a quick "grub" written, but I have no menu... just a black screen...
Sure that this is the message? No "Welcome to Grub"? Or are you maybe getting a grub rescue shell prompt like this 'grub>'?
Image
Post Reply