Dualbooting Windows 7 And Linux Mint 12 - Page 2

Want to support HowtoForge? Become a subscriber!
 
Submitted by CSch (Contact Author) (Forums) on Tue, 2012-01-24 18:23. ::

3 Format Drive And Install Linux

The Linux Mint installer is able to automatically format all unallocated space on your hard disk. To install, boot from your installation medium and double-click Install Linux Mint:

Select your language:

Continue if your machine matches the prerequisites:

On the next screen, select Install Linux Mint alongside Windows 7. Linux Mint will then take all unallocated hard disk space, format it and install itself on it:

 

4 Configuring Boot Order

Linux Mint comes with GRUB, its own bootloader, and will set itself as the default OS to boot with. On boot, you will be presented a selection screen for the different choices where you have ten seconds to choose:

You can change this order however if you rather want to boot from your Windows volume again. To do so on all systems derived from Ubuntu, open the grub.cfg as root:

sudo nano /boot/grub/grub.cfg

Although the file tells us to NOT EDIT it we will do so, but with care. The boot options are specified inside this configuration file. You will see a list of entries looking somewhat like this:

[...]
menuentry 'Linux Mint 12 64-bit, 3.0.0-12-generic (/dev/sda5)' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 7df91f6c-5351-4336-a3c5-eac1cf58efca
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=7df91f6c-5351-4336-a3c5-eac1cf58efca ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-12-generic
}
menuentry 'Linux Mint 12 64-bit, 3.0.0-12-generic (/dev/sda5) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 7df91f6c-5351-4336-a3c5-eac1cf58efca
echo 'Loading Linux 3.0.0-12-generic ...'
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=7df91f6c-5351-4336-a3c5-eac1cf58efca ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.0.0-12-generic
}
[...]
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 7df91f6c-5351-4336-a3c5-eac1cf58efca
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 7df91f6c-5351-4336-a3c5-eac1cf58efca
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
[...]
menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 7EE8C5C2E8C578C3
chainloader +1
}

[...]

These are the operating system choices you are given on boot. They are numbered from 0 to n, n being the number of entries -1. To change the default option, look for the following block in the beginning of the file...

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"

... and change the number in set default to the one of your choice. Remember that if you want to use Windows 7, which is the fifth entry in my case, you have to put in a 4, since the numbering starts with 0.

If you also want to shorten the time the system takes to automatically boot the selected option, look for the following block a few lines further down...

if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi

... and replace the number in set timeout=10 with a number from 0 upwards. This will determine the time in seconds the machine waits before it boots the selected choice without your interaction.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Ramón B. (not registered) on Wed, 2013-10-23 19:13.
VIELEN VIELEN DANK. SEHR GUT. ALLES KLAR. DANKE SCHON
Submitted by Jamil (not registered) on Mon, 2013-06-24 13:55.

The above method is not a good way of doing this. The best way to this is described in Grub2 tutorial at "http://www.dedoimedo.com/computers/grub-2.html". Read it thoroughly if you want to be advanced user of grub2 but if you only want to change the boot order here is how I did this. I had my window 7 in C and then installed Linux Mint 15 and there was no Windows 7 loader.
1. type in terminal "sudo update-grub". It will get the windows 7 bootloader in the boot menu of linux mint during.
2. Now suppose I want window 7 to boot first. In the /etc/grub.d directory there will be different files starting with numbers (i.e. 00_header, 10_linux, 30_os-prober (window 7 loader) etc). The principal is simple, 10_linux will boot first as its number is less then 30_os-prober. Rename the file 30_os-prober to 09_os-prober. You will not be able to rename it directly. Enter following commands in the terminal to rename it.
sudo mv /etc/grub.d/30_os-prober /etc/grub.d/09_os-prober
sudo update-grub
3. Now restart your computer and window 7 will boot first by default.

The grub.cfg reads from grub.d folder.

 If you have problem, add your comment.

Submitted by NikHoxha (not registered) on Sat, 2012-08-25 14:30.

Worked great for me! :)


Submitted by Anonymous (not registered) on Sun, 2012-05-27 17:01.

mate, this way to edit the GRUB file is wrong!

just go to "/etc/default/grub" and change the constants there, so ur OS dont get anny inconsistency...

Submitted by Dave (not registered) on Fri, 2012-01-27 13:56.
I was wondering if this still works if Windows 7 is installed on an UEFI system with a GPT disk
Submitted by Anonymous (not registered) on Thu, 2012-01-26 01:19.
Since Mint is derived from Ubuntu newbies could use Startup Manager to make the mentioned changed with GUI easily. Startup Manager could be found in software center.