Help for dualbooting

Can anyone help me? I am going to dual boot vista with linux (linux being installed first) but when i enter “sudo gedit /boot/grub/menu.lst” to bring up the bootloader info, all I get is an empty wordpad document. Any help? Thank you

The menu.lst file no longer exists in GRUB2:
https://help.ubuntu.com/community/Grub2

it was replaced with
/boot/grub/grub.cfg

IMPORTANT - don’t edit this file manually, any changes you need to make now go in:

/etc/default/grub

then you run:

sudo update-grub

Best read and understand that link first thoough.


wordpad ??

I didn’t mean wordpad, just a general term for the word processor. how would I go about setting the bootloader up then after shrinking my linux partition and installing vista onto the unallocated space?

It’s normally a good idea to install Windows FIRST, so Linux can overwrite the Windows bootloader, but if you MUST install Windows AFTER Linux (so GRUB gets overwritten by the Windows bootloader), there is no need to manually edit GRUB… just reinstall GRUB from a Linux LiveCD:

https://help.ubuntu.com/community/Grub2#Reinstalling%20GRUB%202

It should automagically find the Windows installations and add it to the GRUB menu for you.

Just to check, if linux is installed first i enter “sudo mount /dev/sda1 /mnt” into a terminal, enter “sudo grub-install --root-directory=/mnt /dev/sda” then reboot and refresh grub? Btw is the reboot done by just restarting the machine and letting it load or by interrupting and booting from the live CD again?

IF (and I mean IF) the root of your filesystem is on sda1 (and /boot isn’t on its own partition) then yes:

booting from a LiveCD, and running:

sudo mount /dev/sda1 /mnt
sudo grub-install --root-directory=/mnt /dev/sda

rebooting, and running:

sudo update-grub

will work.

BUT you need to be sure sda1 is where the root of your file system is, and that it contains /boot

[EDIT]

Btw is the reboot done by just restarting the machine and letting it load or by interrupting and booting from the live CD again?

Booting to the hard drive… the refresh of GRUB is only to detect the Windows OS and add it to the GRUB menu.

Is the reboot back into the live CD or will there be a GRUB menu where i can select Linux to boot into?

Sorry, read EDIT above… we must have been typing at the same time.

Thank you for all your help :slight_smile:

I tried booting from the live CD and entering the coding to re install GRUB but they don’t do anything. Any help?

I take it you can boot Windows?

Boot to the LiveCD, and send the output from:

sudo fdisk -l

What do i do after that? My linux partition is sda1 if that helps?

What you should do is…

Answer my questions. :wink:

Can you boot to Windows?

and

Can you send the (whole) output from:

sudo fdisk -l

I’m booted to windows now and i’ll just go do that for you

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00072225

Device Boot Start End Blocks Id System
/dev/sda1 1 7281 58483608+ 83 Linux
/dev/sda2 * 7282 9359 16689152 7 HPFS/NTFS
/dev/sda3 9359 9730 2975745 5 Extended
/dev/sda5 9359 9730 2975744 82 Linux swap / Solaris

OK you were right, but I wanted to check…

REBOOT to the LiveCD (even if you are on it now)

Select “Try Ubuntu”

When you get to the desktop, don’ t do ANYTHING other than what follows.

Go to Applications>Accessories>Terminal

When the terminal opens, enter:

sudo mount /dev/sda1 /mnt

and hit enter

When back at $ prompt, enter:

sudo grub-install --root-directory=/mnt /dev/sda

and hit enter.

When back at $ prompt, Reboot to the hard drive.

When booted, open a terminal, and enter:

sudo update-grub

hit enter, and your password when asked.

You should then be done.

Or a slightly more complex method that will cause the LiveCD to treat the broken system’s / as its own, then reinstall GRUB
(Commands run in a chroot environment will affect the broken systems filesystems and not those of the LiveCD)

Boot to the LiveCD, open a terminal and enter:

sudo mount /dev/sda1 /mnt
sudo mount --bind /dev  /mnt/dev
sudo mount --bind /dev/pts  /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys  /mnt/sys
sudo chroot /mnt
sudo update-grub
sudo grub-install /dev/sda
sudo grub-install --recheck /dev/sda

Exit chroot by hitting CTRL+D on keyboard

Now carry on and unmount the directories you mounted with:

sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt/usr
sudo umount /mnt

Now reboot with:

sudo reboot

When rebooted to the hard drive, open a terminal and enter:

sudo update-grub

On next boot, Windows should be in the GRUB menu too.


It’s all in here:
https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD