
Hi, On one of my machines I had an ubuntu installation on a single partition (sda3). I recently moved everything except /home onto another partition (sda6) and set up grub to boot from that partition. This was all working fine until there was a kernel update. The update reconfigured grub to try boot from the original partition, which failed, but fortunately grub lets you edit stuff before booting and I was able to fix it without too much pain. How do I fix it properly so that the next kernel update doesn't break it in the same way? Glenn -- Glenn Ramsey <glenn(a)componic.co.nz> 07 8627077 http://www.componic.co.nz

Edit the /boot/grub/menu.lst and set the default options to the correct drive in there. Liz 2009/5/9 Glenn Ramsey <glenn(a)componic.co.nz>:
Hi,
On one of my machines I had an ubuntu installation on a single partition (sda3). I recently moved everything except /home onto another partition (sda6) and set up grub to boot from that partition.
This was all working fine until there was a kernel update. The update reconfigured grub to try boot from the original partition, which failed, but fortunately grub lets you edit stuff before booting and I was able to fix it without too much pain.
How do I fix it properly so that the next kernel update doesn't break it in the same way?
Glenn
-- Glenn Ramsey <glenn(a)componic.co.nz> 07 8627077 http://www.componic.co.nz _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

2009/5/9 Glenn Ramsey <glenn(a)componic.co.nz>
Hi,
On one of my machines I had an ubuntu installation on a single partition (sda3). I recently moved everything except /home onto another partition (sda6) and set up grub to boot from that partition.
This was all working fine until there was a kernel update. The update reconfigured grub to try boot from the original partition, which failed, but fortunately grub lets you edit stuff before booting and I was able to fix it without too much pain.
How do I fix it properly so that the next kernel update doesn't break it in the same way?
Glenn
sudo update-grub

On one of my machines I had an ubuntu installation on a single partition (sda3). I recently moved everything except /home onto another partition (sda6) and set up grub to boot from that partition.
This was all working fine until there was a kernel update. The update reconfigured grub to try boot from the original partition, which failed, but fortunately grub lets you edit stuff before booting and I was able to fix it without too much pain.
sudo update-grub
This will have been run when the kernel was updated, and will actually be what caused Glenn's original problem. Glenn, you'll need to edit /boot/grub/menu.lst in a text editor, and find the line that looks similar to this: # kopt=root=/dev/sda3 ro It may refer to a UUID, like so: # kopt=root=UUID=d8f53f29-5c11-4562-8e80-e33feebd98e9 ro Change this line to read # kopt=root=/dev/sda6 ro or whatever more closely matches your existing one, and then run "sudo update-grub". Check the resulting file to make sure it's retained this setting - if you look further down the file you'll find the actual grub configuration blocks, and they should reflect your change. It's worth stressing here that the lines I pasted above are commented for a reason. Do not uncomment them! These lines are how update-grub manages the configuration file - it uses a series of commented lines to automatically build up a config file based on the kernels it finds you have installed. If you read the existing comments carefully, in particular the bits with ## at the start of each line, it'll explain how the system works. And, if you want to just add a config stanza that you know is fine and will work, you can add it before the line that says "### BEGIN AUTOMAGIC KERNELS LIST" and update-grub will never touch it.

Daniel Lawson wrote:
On one of my machines I had an ubuntu installation on a single partition (sda3). I recently moved everything except /home onto another partition (sda6) and set up grub to boot from that partition.
This was all working fine until there was a kernel update. The update reconfigured grub to try boot from the original partition, which failed, but fortunately grub lets you edit stuff before booting and I was able to fix it without too much pain.
sudo update-grub
This will have been run when the kernel was updated, and will actually be what caused Glenn's original problem.
Glenn, you'll need to edit /boot/grub/menu.lst in a text editor, and find the line that looks similar to this:
# kopt=root=/dev/sda3 ro
It may refer to a UUID, like so: # kopt=root=UUID=d8f53f29-5c11-4562-8e80-e33feebd98e9 ro
Change this line to read
# kopt=root=/dev/sda6 ro
or whatever more closely matches your existing one, and then run "sudo update-grub". Check the resulting file to make sure it's retained this setting - if you look further down the file you'll find the actual grub configuration blocks, and they should reflect your change.
It's worth stressing here that the lines I pasted above are commented for a reason. Do not uncomment them! These lines are how update-grub manages the configuration file - it uses a series of commented lines to automatically build up a config file based on the kernels it finds you have installed. If you read the existing comments carefully, in particular the bits with ## at the start of each line, it'll explain how the system works.
And, if you want to just add a config stanza that you know is fine and will work, you can add it before the line that says "### BEGIN AUTOMAGIC KERNELS LIST" and update-grub will never touch it.
Thanks Daniel, now that I know how this works the comments and instructions in menu.lst make more sense. In order to get it to work properly I had to edit the kopt line as you suggested to have the correct UUID for my sda6 but also there is another line # groot=(hd0,X) which I had to set correctly. Also next time there is a kernel update I will know what to check for prior to shutting down or rebooting. Cheers Glenn -- Glenn Ramsey <glenn(a)componic.co.nz> 07 8627077 http://www.componic.co.nz

Thanks Daniel, now that I know how this works the comments and instructions in menu.lst make more sense.
In order to get it to work properly I had to edit the kopt line as you suggested to have the correct UUID for my sda6 but also there is another line # groot=(hd0,X) which I had to set correctly.
Oops, I missed that one. Glad you picked it up :)
Also next time there is a kernel update I will know what to check for prior to shutting down or rebooting.
Once you've edited these configuration comments in grub.conf, there shouldn't be any more problems - debian and ubuntu don't actually edit that file in any way other than what update-grub does, which is to read the configuration comments and generate a grub config section for every kernel it can find.
participants (4)
-
Bruce Kingsbury
-
Daniel Lawson
-
Glenn Ramsey
-
Liz Quilty