jeff1evesque / LeQue

Activate installed microphone, and analyze sound input
13 stars 2 forks source link

Dualboot: Windows 7 default boot #373

Open jeff1evesque opened 10 years ago

jeff1evesque commented 10 years ago

We have Ubuntu Server 14.04 as a dual boot with Windows 7 on the same hard disk. However, we would like to ensure that Windows 7 is the default boot. Also, at startup GNU GRUB seem to display duplicated options:

GNU GRUB version 2.02^beta2-9ubuntu1

Ubuntu
Advanced options for Ubuntu
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)
Windows 7 (loader) (on /dev/sda1)
Windows 7 (loader) (on /dev/sda2)
Windows Recovery Environment (loader) (on /dev/sdb1)

Use the [up arrow] and [down arrow] keys to select which entry is highlighted.
Press enter to boot the selected OS.  `e' to edit the commands
before booting or `c' for a command-line.
jeff1evesque commented 10 years ago

We will reorder Windows 7 to boot up before Ubuntu Server 14.04:

$ cd /etc/grub.d
$ sudo update-grub
[sudo] password for jeffrey: 
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-32-generic
Found initrd image: /boot/initrd.img-3.13.0-32-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Found Windows 7 (loader) on /dev/sda2
done
$ ls
00_header        10_linux      20_memtest86+  30_uefi-firmware  41_custom
05_debian_theme  20_linux_xen  30_os-prober   40_custom         README
$ sudo mv 30_os-prober 09_os-prober
[sudo] password for jeffrey: 
$ ls
00_header        09_os-prober  20_linux_xen   30_uefi-firmware  41_custom
05_debian_theme  10_linux      20_memtest86+  40_custom         README
jeffrey@ubuntu14:/etc/grub.d$
$ sudo update-grub
Generating grub configuration file ...
Found Windows 7 (loader) on /dev/sda1
Found Windows 7 (loader) on /dev/sda2
Found linux image: /boot/vmlinuz-3.13.0-32-generic
Found initrd image: /boot/initrd.img-3.13.0-32-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

IRC #ubuntu (07/29/14 ~ 10:50am EST):

jeffreylevesque: anyone use some kind of 'Grub Customizer'?

ActionParsnip: jeffreylevesque: what do you want to achieve with Grub?

jeffreylevesque: ActionParsnip: Windows 7 is on my original partition. Ubuntu Server 14.04 is on my second partition. I want it to default to windows 7, and some of entries at startup are duplicated within the GRUB bootloader

ActionParsnip: jeffreylevesque: you dont need a customizer for that, you need 2 commands ActionParsnip: jeffreylevesque: sudo mv /etc/grub.d/30_os-prober /etc/grub.d/09_os-prober; sudo update-grub ActionParsnip: jeffreylevesque: the number in the filename dictates the order, so if you put the windows one as a lower number than the Linux ones, it will be top

jeffreylevesque: ActionParsnip: I installed GRUB on the master boot record. Will I be able to do as you suggested? And, could you explain the reason of the moving the file?

ActionParsnip: jeffreylevesque: the location of Grub is moot, the config will update it as needed ActionParsnip: jeffreylevesque: 09 is less than 30 ActionParsnip: jeffreylevesque: the linux ones appear first as they are numbered 10 ActionParsnip: jeffreylevesque: so by changing it to 09 it appears above the linux ones ActionParsnip: jeffreylevesque: its a simple concept

jeffreylevesque: ActionParsnip: sounds simple. Is it possible to have two or more entries with the same number? Would that be ok?

ActionParsnip: jeffreylevesque: i believe so and it will go to alphebetical order, best to just re-jig them to not have the same number

Now, at machine startup we see the following:

GNU GRUB version 2.02^beta2-9ubuntu1

Windows 7 (loader) (on /dev/sda1)
Windows 7 (loader) (on /dev/sda2)
Ubuntu
Advanced options for Ubuntu
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)

Use the [up arrow] and [down arrow] keys to select which entry is highlighted.
Press enter to boot the selected OS.  `e' to edit the commands
before booting or `c' for a command-line.
jeff1evesque commented 10 years ago

We still need to remove the duplicated entries at startup:

GNU GRUB version 2.02^beta2-9ubuntu1

Windows 7 (loader) (on /dev/sda1)
Windows 7 (loader) (on /dev/sda2)
Ubuntu
Advanced options for Ubuntu
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)

Use the [up arrow] and [down arrow] keys to select which entry is highlighted.
Press enter to boot the selected OS.  `e' to edit the commands
before booting or `c' for a command-line.