grub, how to tweak a little

grub, how to tweak a little

Postby Maroman » 08 Nov 2013, 07:14

Grub is the first program every of us starts using computer with point linux (or many other linux systems). it's important but many of us do not understand way it performs. frankly speaking it launches operating systems and some diagnostic tools. it strongly depends on disc topology (due to computer firmware). let's talk about grub designed for computers with bios firmware. during system installation grub itself is "divided" into parts and installed in MBR, just next to MBR (there is a bit of spare space) and root directory (or separate partition, depends on our orders).
parameters of grub are mainly set in config (text) file /etc/default/grub. we can edit it as a root
Code: Select all
gksu pluma /etc/default/grub

please notice that all line starting with hash (#) are comments

what to change?

resolution. is defined by GRUB_GFXMODE parameter (usually default is set). in my case (for a notebook) it's
Code: Select all
GRUB_GFXMODE=1366x768

time to start. usually grub waits a little during start to give opportunity to choose the starting system/tool. time is defined by GRUB_TIMEOUT parameter. the syntax is as follows
Code: Select all
GRUB_TIMEOUT={-1|0|n}

what means (choose only one option)
-1 infinity, system waits for your action
0 start immediately with default choice
n (integer), gives you n second to take decision. after that starts default action

choice. the choice is defined by GRUB_DEFAULT parameter. by default always first system is chosen (counting starts from 0) but about a sequence of systems a little later (another tip). if there is the only one system, there is nothing to do. but usually we have more systems and in different linux systems also tools are shown. if we want to choose different system we should change this parameter, for example (if 5th system exists)
Code: Select all
GRUB_DEFAULT=4

we can use different solution, namely start the previously started system. if we want to change we have some time for decision (defined previously). firstly hash (comment the line with GRUB_DEFAULT parameter. instead you should write
Code: Select all
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true


done.

remember that changing config file doesn't change (almost) anything. config file is used to generate /boot/grub/grub.cfg file. to activate any change please start
Code: Select all
sudo update-grub


sorry for boring experts you are :cry:

cheers,
ride my bike,
User avatar
Maroman
 
Posts: 369
Joined: 02 Jun 2013, 09:17
Location: Warsaw Metropolitan Area, Poland

Re: grub, how to tweak a little

Postby Maroman » 08 Nov 2013, 07:17

changing background.

as you can see the starting panel is rather ugly. usually blue background, white letters. all can be changed but it's interesting to use picture as a background. there are some limitations but usually jpg or png file can be used. one possible method is to copy picture file to /boot/grub directory.
open terminal in directory with picture you want to use and then
Code: Select all
sudo cp your_picture /boot/grub

you can copy any number of pictures but only one is used. first by name.

to activate repeat update-grub command (as a root). done and looks better.

cheers,
ride my bike,
User avatar
Maroman
 
Posts: 369
Joined: 02 Jun 2013, 09:17
Location: Warsaw Metropolitan Area, Poland

Re: grub, how to tweak a little

Postby drum » 08 Nov 2013, 07:58

^nice tips Maroman
Point Linux = freedom, reliability, stability, configurability, flexibility, security Image

The "Penguin" has arrived - and he's not going away - ever.

point linux = semper fidelis
User avatar
drum
 
Posts: 111
Joined: 24 Oct 2013, 06:57
Location: Belgium

Re: grub, how to tweak a little

Postby Maroman » 08 Nov 2013, 08:48

changing the order.
beware of trains, mad bikers and non-clever hints. you are all doing on your own risk :evil:

firstly go to /etc/grub.d/ directory. to change the order of systems/tools in grub please read README file. here you can find some hints. in the directory there are executable scripts. running update-grub generates grub.cfg using one by one scripts from this directory. if you do not want to have some elements in your grub - make file unexecutable (it can be applied for memtest in ubuntu for example by changing mod of 20_linux_xen file).
please notice that other systems (not our native one - point) are searched by 30_os-prober_script. so if you have windows for example and want to be the first system entry you should execute the above said script first (10_linux generates entry to our linux - point). so
Code: Select all
sudo mv 30_os-prober 09_os-prober

and script 09... runs before script 10... and entry to other systems (windows for example) is before entry to our point.

update-grub (as a root) ends the procedure.

hope it's clear but might be a little dangerous =@ (sorry :cry: )

cl(h)eers :lol:
ride my bike,
User avatar
Maroman
 
Posts: 369
Joined: 02 Jun 2013, 09:17
Location: Warsaw Metropolitan Area, Poland

Re: grub, how to tweak a little

Postby nekomajin » 08 Nov 2013, 10:00

Can we get all of this on the PL-Wiki, please? So we'll have a central point for Point Linux issues.
Have a good time with Point Linux.
nekomajin
 
Posts: 36
Joined: 03 Sep 2013, 06:15
Location: Germany


Return to Tutorials and Howtos

Who is online

Users browsing this forum: No registered users and 1 guest