LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-03-2006, 01:12 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 49
contents of menu.list (grub) changes on updating


Hello All,

I have some strange problem with GRUB's menu.lst file. intially with my fresh install contents of my menu.lst file were as follow:

Code:
title		Debian GNU/Linux, kernel 2.6.13
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.13 root=/dev/hda1 ro 
initrd		/boot/initrd.img-2.6.13
savedefault
boot

title		Debian GNU/Linux, kernel 2.6.13 (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.13 root=/dev/hda1 ro single
initrd		/boot/initrd.img-2.6.13
savedefault
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
Afer some time, I had to change the drive assignment(Pirmary Master to Secondary Master) so therefore I change all the instances of hda1 to hdc1 in the above contents which now looks like this:
Code:
title		Debian GNU/Linux, kernel 2.6.13
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.13 root=/dev/hdc1 ro 
initrd		/boot/initrd.img-2.6.13
savedefault
boot

title		Debian GNU/Linux, kernel 2.6.13 (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.13 root=/dev/hdc1 ro single
initrd		/boot/initrd.img-2.6.13
savedefault
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
Everything worked fine. But now when ever I install any program like splashy,etc which updates the grub configuraion, it sets back hdc1 to hda1 again which was my original drive assignment(which I don;t want ofcourse). Here are the contents after installing splashy.

Code:
title		Debian GNU/Linux, kernel 2.6.13(splashy)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.13 root=/dev/hda1 vga=791 quiet ro 
initrd		/boot/initrd.img-2.6.13
savedefault
boot

title		Debian GNU/Linux, kernel 2.6.13 (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.13 root=/dev/hda1 ro single
initrd		/boot/initrd.img-2.6.13
savedefault
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
It seems that there is some file in the /boot directory which maintains a copy of the original menu.lst file, so the program like splashy which requies updating of grub reads from there and changes it back to original content.

It is not a porblem of splashy, because even if I install a new compiled kernel it does the same thing.

How can I resolve this?

Thanks in advance
 
Old 02-03-2006, 02:06 PM   #2
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Rep: Reputation: 16
Have you looked at your /etc/fstab lately? What is on hda1? If you have a Linux there, it is possible that you are booting from the kernel on (hd0,0)/boot/ and then running /sbin/init /dev/hdc1, but if your fstab was created for your original install on hda and not edited after the change (for hdc), then you may be mounting the wrong partition. On the other hand, if you don't have a working Linux on hda1, I'm at a loss. If you run 'mount' are their any surprises?
 
Old 02-03-2006, 02:19 PM   #3
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by drakebasher
Have you looked at your /etc/fstab lately? What is on hda1? If you have a Linux there, it is possible that you are booting from the kernel on (hd0,0)/boot/ and then running /sbin/init /dev/hdc1, but if your fstab was created for your original install on hda and not edited after the change (for hdc), then you may be mounting the wrong partition. On the other hand, if you don't have a working Linux on hda1, I'm at a loss. If you run 'mount' are their any surprises?
Yes, did not change my fstab after editing the menu.lst file i.e. it is still the same as original. Currently on hda1 I have non linux disk.

I am totally lost. Also what do you mean when you say:
Code:
and then running /sbin/init /dev/hdc1,
Thanks for the effort.
 
Old 02-03-2006, 03:28 PM   #4
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Rep: Reputation: 16
Quote:
Originally Posted by kushalkoolwal
Also what do you mean when you say:
Code:
and then running /sbin/init /dev/hdc1,
I was just following the steps of booting. /sbin/int is the first file to run after loading the kernel. By giving 'root=/dev/hdc1' to the kernel, that tells the kernel where init is, and I guess where it whould find /etc/fstab. But I think that if fstab called for the root ( / ) partition to be somewhere other than the 'root=/dev/whatever' partition, the system would load okay. I've played around with several copies of several distros and I know that I've confused myself before on what is where and I know this has been a point of confusion for many in working with grub.

I've only worked with Debian for a short while, but I have noticed that some configuration files have as their first line something about where it's from or something similar. But really I have no clue. I've moved drives and partitions several times before with other distros and haven't seen anything like what you describe....
 
Old 02-03-2006, 06:49 PM   #5
lestoil
Member
 
Registered: Apr 2004
Location: new york
Distribution: win2k,ubuntu,sw13,arch,centos5.3
Posts: 815

Rep: Reputation: 31
Isn't your root hd(0,0) line the same before and after you changed primary and master disk designation? Wouldn't man grub give you better info? Isn't the root different after the disk change? hd(0,0) is /dev/hda1 no? Good luck.
 
Old 02-03-2006, 10:51 PM   #6
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Rep: Reputation: 16
Quote:
Originally Posted by lestoil
Isn't the root different after the disk change? hd(0,0) is /dev/hda1 no? Good luck.
This is one of those big points of confusion in Grub. (hd0) is not necessarily hda: (hd0) is the boot device, that is it's the first hard drive Grub sees. So I'm assuming that when kushalkoolwal put his Debian on hdc that he also changed his BIOS to boot from hdc which would make it (hd0). And as he says that hda is not a Linux disk, I expect he has changed his BIOS to boot from the secondary master IDE.
 
Old 02-04-2006, 02:55 AM   #7
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Unhappy

Quote:
Originally Posted by drakebasher
This is one of those big points of confusion in Grub. (hd0) is not necessarily hda: (hd0) is the boot device, that is it's the first hard drive Grub sees. So I'm assuming that when kushalkoolwal put his Debian on hdc that he also changed his BIOS to boot from hdc which would make it (hd0). And as he says that hda is not a Linux disk, I expect he has changed his BIOS to boot from the secondary master IDE.
Yes you are right. I have changed the setting in BIOS to boot from the Linux Disk which is the secondary Master.....

I don;t know what is causing this problem.
 
Old 02-06-2006, 05:52 PM   #8
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Can anyone give any clue why this is happening?
 
Old 02-09-2006, 01:51 PM   #9
turnovg
Member
 
Registered: Dec 2003
Posts: 33

Rep: Reputation: 15
Without update?

Do you update your grub manually with grub-update, or the program you install does it? If former, after changing the /dev/hda1 to /dev/hdc1 do not run update-grub. It should be OK.
 
Old 02-09-2006, 04:59 PM   #10
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by turnovg
Do you update your grub manually with grub-update, or the program you install does it? If former, after changing the /dev/hda1 to /dev/hdc1 do not run update-grub. It should be OK.
The Program does it automatically. And therefore it changes back to /dev/hda1

I am toally lost at this point...
 
Old 02-11-2006, 06:32 AM   #11
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Rep: Reputation: 30
Quote:
Originally Posted by kushalkoolwal
The Program does it automatically. And therefore it changes back to /dev/hda1

I am toally lost at this point...
to do changes to grub you should edit the automagic commented lines above your "boot setup". There should be something like:
Code:
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda3 ro
and you just change that to whatever you want and whenever you install a new kernel and such itll default to that setting.
 
Old 02-11-2006, 08:23 AM   #12
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
I like debian because there a 10 methods to do a thing

Here's another one that should help you:

modify
/etc/kernel-img.conf

and remove

postinst_hook = /sbin/update-grub

New kernel images installation won't launch anymore update-grub

but then when you install a new image, you have to edit yourself /boot/grub/menu.lst otherwise next reboot...
 
Old 02-11-2006, 03:19 PM   #13
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Thank you nx5000 and bobbens!!!!!!

I will try that. I think it should do the trick in my case. btw, from where did u get this information(man? debian doc??).

Once again, thanks a lot..
 
Old 02-13-2006, 02:21 AM   #14
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
I think I discovered this conf file while looking in the documentation for kernel-package, especially:
/usr/share/doc/kernel-package/README.grub
There are interesting things in this directory
 
Old 02-14-2006, 08:04 PM   #15
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by bobbens
to do changes to grub you should edit the automagic commented lines above your "boot setup". There should be something like:
Code:
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda3 ro
and you just change that to whatever you want and whenever you install a new kernel and such itll default to that setting.
Bobbens, thanks. Your method worked!!!

Also, nx5000 I tried the method that you suggeted but it did not work.The program that I installed still went ahead and made changes to the menu.lst

Thank you to both of you for the kind help......

Debian Rules.....
 
  


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
cannot list directory contents kpachopoulos Linux - General 2 11-29-2005 05:24 PM
Lilo and Grub menu list merger.... Rubedogg Linux - Newbie 2 03-24-2005 06:47 PM
won't list contents of cdrom gillmb Linux - Newbie 2 10-19-2004 02:09 PM
Launch menu contents flushed when updating Steel Shepherd Linux - Software 4 02-02-2004 09:16 PM
List the contents of a directory to a file MasterC Linux - General 19 11-26-2002 10:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:42 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration