LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 12-19-2005, 04:34 AM   #1
coralsaw
Member
 
Registered: Dec 2005
Posts: 35

Rep: Reputation: 15
Grub - fallback option?


Hello all,

Debian newbie here, long-time Gentoo user.

I'm having this following problem, while setting up a machine that will be administered remotely. The basic requirement is to have a stable minimal complete fallback system that gives me ssh access, no matter what.

So far I've installed 3.1 stable (sarge) with X11 and KDE for the full installation and a minimal sarge installation on a different partition. So far so good, both work as designed.

What I'm now trying to do is to have grub fallback to the minimal installation, and here lies the problem. In another distribution, I'd have used the 'fallback' mechanism of grub to always boot the minimal installation, even if by mistake I screw up the full system. Not so in Debian, I believe, since the 'update-grub' script automagically creates new kernel entries after each patch, so I'm worried my hand-crafted grub menu.lst will be overwritten. I don't want to hack the script (don't know enough about Debian yet).

What are my options? Is there a standard solution for a bullet-proof fallback system that only offers remote access?

My last option is to create a grub floppy and use that to boot the minimal install, but I'd rather not do that.

Any ideas?

TiA

/coralsaw
 
Old 12-19-2005, 11:24 AM   #2
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,176

Rep: Reputation: 54
If you want to prevent grub from being changed when a kernel is upgraded, then set apt so that the kernel is never upgraded. Create a preferences file:
Code:
nano /etc/apt/preferences
and put your kernel at a priority of 1001, so that it is never upgraded. For example, my preferences file has:
Code:
Package: xserver-xorg-driver-via
Pin: version 0.1.32-1
Pin-Priority: 1001
to prevent my via driver from being upgraded because upgrading breaks my display. You would need to do the same thing for your specific kernel version. More details on pinning packages here: http://www.debian.org/doc/manuals/ap...pt-get.en.html
 
Old 12-20-2005, 03:58 AM   #3
coralsaw
Member
 
Registered: Dec 2005
Posts: 35

Original Poster
Rep: Reputation: 15
Thx m_yates, that's quite useful. One followup question, if I may.

If I pin the kernel, I suspect that any security updates won't be applied when apt-get upgrading. Am I correct? If so, how do I update the kernel without grub configuration being overwritten, manually with apt-get?

/coralsaw
 
Old 12-20-2005, 07:46 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
You could modify /etc/kernel-img.conf by removing the call to update-grub.
Update-grub should not be called anymore
 
Old 12-20-2005, 08:29 AM   #5
coralsaw
Member
 
Registered: Dec 2005
Posts: 35

Original Poster
Rep: Reputation: 15
Is it safe to do so? When does this file get updated?
 
Old 12-20-2005, 08:55 AM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Is it safe?

Well, it's just removing a post-inst script after all
update-grub will not be launched...
To be honest, I've not yet tried it but the line is empty now because I don't like what update-grub is doing everytime and I wan't to control it for my next install

When is it updated?

It is part of kernel-package so everytime this will be updated and you ask to take the file of the maintainer then this file will be overwritten to its default content.. you can restrict to never install update of this package or ask to keep this file intact

You can do a lot of things with this entry, have a look at /usr/share/doc/kernel-package/examples
 
Old 12-20-2005, 09:15 AM   #7
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,176

Rep: Reputation: 54
Quote:
Originally Posted by nx5000
You could modify /etc/kernel-img.conf by removing the call to update-grub.
Update-grub should not be called anymore
Thanks! I learn something new every day. I hate the way grub is automatically overwritten and manually go in and change it any time the kernel is updated or installed. I'll give your suggestion a try.
 
Old 12-21-2005, 03:24 AM   #8
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Funny the kernel-package has been updated today on unstable...
 
Old 12-21-2005, 06:45 AM   #9
Ruben2
Member
 
Registered: Sep 2004
Location: Lelystad, NL
Distribution: Debian Etch
Posts: 123

Rep: Reputation: 15
As far as I know update-grub only affects a small part of the menu.lst file. I can safly install new kernels and run update-grub without affecting my personal changes to the file (WinXP was added during install, and I set it as default boot system)
If I remember correct (I'm not at home now so I can't check) menu.lst contains lines that are something like
Code:
#Start of Debian generated menu
#end of Debian generated menu
It's not exactly that but something in that direction.
If you add/remove/edit thing that are not between those lines, nothing will be changed when running update-grub
 
Old 12-21-2005, 07:07 AM   #10
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Yes thats right, you could have :
Code:
default		0


title		Debian GNU/Linux, kernel latest
root		(hd0,2)
kernel		/boot/vmlinuz-last root=/dev/hda3 ro 
initrd		/boot/initrd.img-last
savedefault
boot

### BEGIN AUTOMAGIC KERNELS LIST

blablah generated by update-grub

### END DEBIAN AUTOMAGIC KERNELS LIST
Then the vmlinuz-last would never been touched, and with default set to 0 , you would always boot on vmlinuz-last ( which could be linked to the last vmlinuz , done in a script in kernel-img.conf)

But for my machine, it still puts a lot of useless things between ###BEGIN ###END
Like recovery blocks (as I have 5 different kernels, it makes me 10 lines!) I don't need this recovery ones, if something goes wrong , I edit the line and boot . For this problem I maybe have to configure something in menu.lst but have not really searched..
Also in my previous example, it would still add /boot/vmlinuz-last between the ### marks, the result is I have 2 identical blocks.
At least, it should look for the user-defined blocks and not regenerate a block for the same kernel..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
GRUB option R¬dical_úD Suse/Novell 13 09-18-2005 12:31 PM
grub fallback configuration monkeypop Red Hat 2 06-17-2005 04:00 PM
How do I add a Shell option to grub DiSGuiZ Linux - Newbie 4 04-15-2005 03:28 PM
grub+adding windows option gonus Debian 3 08-01-2004 03:43 PM
dual rh 9 no grub option BobNz Linux - Newbie 6 05-02-2004 11:56 PM


All times are GMT -5. The time now is 05:44 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration