help in updating grub after moving /boot to a different partition

Status
Not open for further replies.

infra_red_dude

Wire muncher!
this is my present setup now:

/boot on hd(0,7) - boot partition
/ on hd(0,9) - root partition
and other std. linux and windows partitions.

when i installed ubuntu 7.04 my setup was like this
/boot on hd(0,8 ) - boot partition
/ on hd(0.9) - root partition
and other std. linux and windows partitions.

recently i split a fat32 partition into two using gparted from widin ubuntu and rearranged/formatted some partitions. now my setup is as shown above. everything is working fine and i face no problems as such. i updated grub and edited the entries so that it points to the correct boot partition.

problem is when ubuntu automatically runs the grub-update command (for e.g after making any changes or installing/updating the kernel/modules). when the grub update is automatically run it installs grub but it edits the menu.lst file to include the boot partition wid the old value (hd0,8 ) whereas now the boot partition is on hd(0,7). everytime this happens i hafta make sure that i manually edit the grub menu list and change hd(0,8 ) to hd(0,7) otherwise it fails to boot (of corz i can edit the command line from widin grub and correct it but i dun want this hassle). please do help me out. i did search on the net... but cudn't find anything which was productive for me.
 

praka123

left this forum longback
I know this phenomenon where partn numbers are changed,experienced before.the soltn will be for one thing use fdisk /dev/hda and go to expert mode to fix partn order.(press x;press f)
and if that doesnt go well,go to /boot/grub/menu.lst and see the entries kopt and groot correct.also the option # updatedefaultentry=false to be set.
 
OP
infra_red_dude

infra_red_dude

Wire muncher!
^^^ oops!!! that worsned things!!! :D had to do some restoration work. any other suggestions? does grub store the boot partition number somewhere? i'm unable to find that....
 

praka123

left this forum longback
Only think am aware of is setting menu.lst correct options.grub manual sure got more info.
*www.gnu.org/software/grub/
I have gone through this partn number changing when with Windows XP installed and changed partn.that time grub was reinstalled and it correctly detects.one thing you can do is try setting grub manually(be sure about /boot and / ).try
 
OP
infra_red_dude

infra_red_dude

Wire muncher!
praka123 said:
one thing you can do is try setting grub manually(be sure about /boot and / ).try
yeah thats what i do after every update which i wanna avoid. i'm not able to find out where does grub store the boot partition number.
 

cynosure

UbuntuUser
I downloaded Super Grub Installer a few months back. It has some advanced options in it.
I havnt used it much (And when I do, I always screw up the boot order:D), but try it.
 
OP
infra_red_dude

infra_red_dude

Wire muncher!
edit: how stupid of me! i've been looking everywhere but /usr/sbin/update-grub script!!! :D

will try to go thru it and edit it once and for all!!! will get back if i face any problems!
 
OP
infra_red_dude

infra_red_dude

Wire muncher!
oops!! no not editing the script. trying to figure from where and how the update-script obtains the boot partition number :)

edit: the find_device function in the script is responsible for determining the boot partition number.... hmm.. gotta dig out more now!

edit2: i guess i'll hafta go thru it several times to understand it. i'm no programmer.. mebbe someone can help me :)
 
Last edited:

praka123

left this forum longback
Do u have a seperate /boot partn?if true,there may be chance that u got grub installed to ur /boot dir on / root partn instead of /boot partition.also ur /etc/fstab shud be checked.post here.
again scrutinize ur /boot/grub/menu.lst groot= entry
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,8 )
^mine.i got a seperate /boot partn @/dev/sda9 so in grub (hd0,8 )
u know that :D
onlything u can check is that ur hdd is detected correctly by looking at /boot/grub/device.map for correct entries of ur hdds.
for eg; mine got:
Code:
(hd0)   /dev/sda
there.for multiple hdd i think u know how to enter then.
another problem somewhere i read was grub got problem in reading partn entered as uuid's and LABEL's instead of direct name.although blkid command can show the o/p.
edit:all ur manual edits in menu.lst must not be btwn:

### BEGIN AUTOMAGIC KERNELS LIST
and
### END DEBIAN AUTOMAGIC KERNELS LIST

else they are over written !!!
 
Last edited:
OP
infra_red_dude

infra_red_dude

Wire muncher!
thank you prakash! :) i guess the problem is solved!! :) i'll test it as soon as i can!

yes prakash! problem solved.. tested today! thanks pal :) but now the update-grub boot script refuses to detect the windows vista installation and removes the entry from the the menu list... so i haf a backup menu list... which i hafta replace again everytime...:(
 
Last edited:
Status
Not open for further replies.
Top Bottom