LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-26-2011, 09:03 AM   #1
willroberts
LQ Newbie
 
Registered: Sep 2011
Location: Atlanta, Georgia
Distribution: Debian, CentOS
Posts: 9

Rep: Reputation: Disabled
Question Change GRUB boot options without menu.lst


I've recently switched to Debian for home use after using CentOS almost exclusively over the past few years. To edit the startup menu entries in Grub, I usually just edited menu.lst directly.

In a new Debian 6 install, menu.lst does not exist, and grub.cfg is generated automatically by update-grub. I looked through /etc/default/grub and /etc/grub.d to see if the menu options were present, but didn't find any.

What I want to do is add a 'vga=###' option to the kernel parameters. How can I do this using update-grub?
 
Old 09-26-2011, 10:52 AM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
grub.cfg can be edited

vga=... can be added to kernel line
 
Old 09-26-2011, 11:18 AM   #3
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Quote:
Originally Posted by amani View Post
grub.cfg can be edited

vga=... can be added to kernel line
The only problem would be later if an update-grub gets run it will go back to the default.
 
Old 09-26-2011, 12:19 PM   #4
willroberts
LQ Newbie
 
Registered: Sep 2011
Location: Atlanta, Georgia
Distribution: Debian, CentOS
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Larry Webb View Post
The only problem would be later if an update-grub gets run it will go back to the default.
Right. The header of grub.cfg says "DO NOT EDIT THIS FILE", so I would like to learn the correct way to do this.

One solution someone recommended at work was to edit /etc/grub.d/10_linux and edit this section:

Code:
while [ "x$list" != "x" ] ; do
  linux=`version_find_latest $list`
  echo "Found linux image: $linux" >&2
  basename=`basename $linux`
  dirname=`dirname $linux`
  rel_dirname=`make_system_path_relative_to_its_root $dirname`
  version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
  alt_version=`echo $version | sed -e "s,\.old$,,g"`
  linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
Making this change:

Code:
linux=`version_find_latest $list vga=###`
This would make any kernel detected by grub use the specified video mode after running update-grub.

Is there any more proper way to do this?
 
Old 09-26-2011, 01:59 PM   #5
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Being honest I have never tried to edit the vga mode. Here is the tutorial I use when trying to install or alter grub. It is from ubuntu but the rules should apply here also except you will have to use su - inplace of sudo for root permission.

grub2

I will have a spare moment this evening and will see if I can find more for you or try myself.
 
Old 09-26-2011, 06:51 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Me too - that's a good article.
Additions to /etc/default/grub should be the answer. GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT are standard (supported) entries.
 
Old 09-26-2011, 11:09 PM   #7
willroberts
LQ Newbie
 
Registered: Sep 2011
Location: Atlanta, Georgia
Distribution: Debian, CentOS
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks for the help! That's exactly what I needed.

Here were my changes to /etc/default/grub:

Code:
GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX_DEFAULT="" (removed 'quiet')
GRUB_GFXMODE=1024x768
Then update-grub && reboot and everything is perfect!

Edit: I jumped the gun, GRUB_GFXMODE is only for the boot menu itself. I'm trying to find a way to set the console resolution (the resolution used after the OS has loaded).

Last edited by willroberts; 09-26-2011 at 11:12 PM.
 
Old 09-26-2011, 11:55 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Oops - I think support for things like vga= and video= all went away with KMS. Meaning, of course, that this isn't really a grub issue at all.

You could try adding it to the either of those lines, but "it's your gun, and your foot".
 
1 members found this post helpful.
Old 09-27-2011, 05:55 AM   #9
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
The safe way to test this is to install another grub to a separate partition and then chainload the version you want to run the test on with a direct boot to the distro. If set freezes or something bad goes wrong delete the added grub or correct it and you are back in business. I did not have the time last night to try this.

(Yes I have to use wife,s set at night and she did not work last night.)

Last edited by Larry Webb; 09-27-2011 at 06:08 AM.
 
Old 09-27-2011, 08:15 AM   #10
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
I think "video=1024x768" will work, I use "video=800x600" in slackware-current to change the console front size
 
Old 09-27-2011, 12:09 PM   #11
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Quote:
Originally Posted by colorpurple21859 View Post
I think "video=1024x768" will work, I use "video=800x600" in slackware-current to change the console front size
Right but you are probably using grub legacy. Grub2 has no provisions that I have seen.
 
Old 09-27-2011, 12:21 PM   #12
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by Larry Webb View Post
Right but you are probably using grub legacy. Grub2 has no provisions that I have seen.
Isn't that a kernel parameter (and should therefore be independent of the bootloader)? By the way, the default bootloader in Slackware is LILO.
 
Old 09-27-2011, 12:58 PM   #13
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
According to Ubuntus Grub2 tutorial this is where in /etc/default/grub that kernel paramters are enter.
#

GRUB_CMDLINE_LINUX

* Entries on this line are added to the end of the 'linux' command line (GRUB legacy's "kernel" line) for both normal and recovery modes. It is used to pass options to the kernel.
or
you could create a custom entry and and enter the kernel paramter there.

I know Slackware uses lilo, but on my system at home I chainload Slackware from ubuntu as well as having lilo install on the Slackware partition.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How come I can't edit /boot/grub/grub.conf or /boot/grub/menu.lst in Fedora 14? trien27 Fedora 4 01-22-2011 04:02 PM
How to change Grub menu.lst text color? linus72 Linux - Newbie 16 06-03-2009 06:48 PM
How to change the grub menu.lst ? uffe2 Linux - Software 2 01-04-2008 09:00 PM
How to change partition Grub looks for menu.lst file in. Mountain Man Linux - General 8 12-27-2007 11:47 AM
Grub - how do I change which partition is used to find menu.lst nickhen Linux - General 1 01-24-2005 01:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:06 PM.

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