Вы находитесь на странице: 1из 3

STEP-1 This will overwrite your Windows Boot Loader.

It is OK to do this, in fact that is the goal of this how to (in order to boot Ubuntu). Boot from a Live CD and open a terminal. You'll need to run a few commands s root so you can use sudo -i to get a root shell and run them normally instead of using sudo on each of them. Be extra careful when running a root shell, especially for typos! STEP -2 We'll need to find which partition your Ubuntu system is installed on. Type the command fdisk -l. It will output a list of all your partitions, for example : fdisk -l Disk /dev/hda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 /dev/sda2 /dev/sda3 /dev/sda4 /dev/sda5 /dev/sda6 1 8 64228+ 83 Linux 9 1224 9767520 83 Linux * 1225 2440 9767520 a5 FreeBSD 2441 14593 97618972+ 5 Extended 14532 14593 498015 82 Linux swap / Solaris 2441 14530 97112862 83 Linux

Partition table entries are not in disk order STEP-3 Here I have three Linux partitions. /dev/sda2 is my root partition, /dev/sda1 is my /boot partition and /dev/sda6 is my /home partitions. If you only have one, obviously this is the one your Ubuntu system is installed on. If you have more than one and you don't know which one your Ubuntu is installed on, we'll look for it later. First, create a mountpoint for your partition, for example : STEP-4 mkdir /media/root Then mount your partition in it. If you don't know which one it is, then mount any of them, we'll see if it's the correct one. mount /dev/sda2 /media/root Of course, replace /dev/sda2 with the correct name of your partition. You can check if it's the correct one by running

STEP-5 ls /media/root which should output something like this : bin dev home lib mnt root srv usr boot etc initrd lib64 opt sbin sys var cdrom initrd.img media proc selinux tmp vmlinuz If what you have looks not at all like this, you didn't mount the correct partition. Do umount /media/root to unmount it and try another one. You also need to mount your /boot partition if you made one, like this : mount /dev/sda1 /media/root/boot To make sure it was the correct one, run ls /media/root/boot which should output something like this : config-2.6.18-3-686 initrd.img-2.6.18-3-686.bak System.map2.6.18- 3-686 grub lost+found vmlinuz-2.6.18-3-686 initrd.img-2.6.18-3-686 memtest86+.bin Once again, if what you have doesn't fit, unmount it and try another partition. STEP-6 Now that everything is mounted, we just need to reinstall GRUB : sudo grub-install --root-directory=/media/root /dev/sda If you got BIOS warnings try: sudo grub-install --root-directory=/media/root /dev/sda --recheck Of course, replace /dev/sda with the location you want to install GRUB on. If all went well, you should see something like this : Installation finished. No error reported. This is the contents of the device map /boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. (hd0) /dev/sda STEP-7 Reboot (to your hard drive). Grub should be installed and both Ubuntu and Windows should have been automatically detected. If, after installing grub, Windows does not appear in the boot menu you will need to edit /boot/grub/menu.lst (That is a small "L" and not the number 1 in menu.lst) Open a terminal and enter : gksu gedit /boot/grub/menu.lst

Or, in Kubuntu: kdesu kate /boot/grub/menu.lst Your Windows stanza should look something like this : (if these lines are commented then remove the comments and add before or after AUTOMAGIC KERNEL LIST in menu.lst. title Windows XP/Vista rootnoverify (hd0,0) makeactive chainloader +1 (Note:for /dev/sda1 /dev/sda2 /dev/sda3 /dev/sda4 -----> -----> -----> -----> rootnoverify rootnoverify rootnoverify rootnoverify (hd0,0) (hd0,1) (hd0,2) (hd0,3) the

Note: Put your Windows stanza before or after AUTOMAGIC KERNEL LIST in the menu.lst

Вам также может понравиться