LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   contents of menu.list (grub) changes on updating (https://www.linuxquestions.org/questions/debian-26/contents-of-menu-list-grub-changes-on-updating-411312/)

kushalkoolwal 02-03-2006 01:12 PM

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

drakebasher 02-03-2006 02:06 PM

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?

kushalkoolwal 02-03-2006 02:19 PM

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.

drakebasher 02-03-2006 03:28 PM

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....

lestoil 02-03-2006 06:49 PM

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.

drakebasher 02-03-2006 10:51 PM

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.

kushalkoolwal 02-04-2006 02:55 AM

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.:(

kushalkoolwal 02-06-2006 05:52 PM

Can anyone give any clue why this is happening?

turnovg 02-09-2006 01:51 PM

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.

kushalkoolwal 02-09-2006 04:59 PM

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...:confused:

bobbens 02-11-2006 06:32 AM

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...:confused:

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.

nx5000 02-11-2006 08:23 AM

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...

kushalkoolwal 02-11-2006 03:19 PM

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..

nx5000 02-13-2006 02:21 AM

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

kushalkoolwal 02-14-2006 08:04 PM

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.....:D


All times are GMT -5. The time now is 11:39 PM.