need grub help with new PC

simonn ulist at gs1.ubuntuforums.org
Mon Jul 17 03:05:14 UTC 2006


I assume /dev/sda5 is / for your ubuntu install?



Was your previous drive SATA? This is important because if you previous
drive was not, then initrd is unlikely to contain the SATA drivers you
need to boot. 



initrd is the initial ram disk, basically, this is loaded first and
creates a kind of very mini linux with which to boot the rest of the
system.



Also, do you only have the one hard drive?



Personally, I would do the following:



Boot from a boot cd and mount /dev/sda5, to, for example, /mnt/linux.



As root, chroot into /mnt/linux




Code:
--------------------
    

  % chroot /mnt/linux

  
--------------------




Start grub:




Code:
--------------------
    

  % grub

  
--------------------




If you have only one hard disk then grub will consider this to be hd0.
Grub uses 0 as the first partition number, so sda5 is partition number
4. So to install grub do the following in the grub shell:




Code:
--------------------
    

  > root (hd0,4)

  > setup (hd0)

  > quit

  
--------------------




root (hd0,4) tells grub to look for the /boot directory on the fifth
partition (i.e. partition # 4) of the first hard drive (i.e. hd0). 



setup (hd0) tells grub to write the above information to the MBR of the
first hardrive.



I guess you can figure out what quit means.



If you reboot, grub should now pick up /boot/grub/menu.lst on
/dev/sda5. However, if, as previously mentioned, you are moving from
IDE to SATA it is unlikely that you have the SATA drivers in your
initrd. There are several ways to fix this, but I would like to know if
you are moving from IDE to SATA first.


-- 
simonn




More information about the ubuntu-users mailing list