Skip to content

Instantly share code, notes, and snippets.

@Pristavkin
Last active February 10, 2020 19:16
Show Gist options
  • Select an option

  • Save Pristavkin/2ae751c1d48efe594415f61b78b84bfa to your computer and use it in GitHub Desktop.

Select an option

Save Pristavkin/2ae751c1d48efe594415f61b78b84bfa to your computer and use it in GitHub Desktop.

Revisions

  1. Pristavkin revised this gist Feb 10, 2020. 1 changed file with 7 additions and 6 deletions.
    13 changes: 7 additions & 6 deletions 41_Windows
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,11 @@
    #!/bin/sh
    # 1. Place this file to /etc/grub.d/41_Windows
    # 1. Place this file to /etc/grub.d/05_Windows
    # 2. Update Windows patrtition setting. In this example Winodws will be booted from hd0,1 - sda2 partition ("hd0" is sda, and ",1" is second partition on disk)
    # 3. Add "GRUB_DEFAULT="Windows 10"" line to /etc/default/grub for default boot to window 10
    # 3. Add "GRUB_DEFAULT=saved" and "GRUB_SAVEDEFAULT=true" lines to /etc/default/grub for save last booted OS
    # 4. Run "chmod +x /etc/grub.d/41_Windows && grub2-mkconfig --output=/boot/grub2/grub.cfg" after all modifications for make new config file
    exec tail -n +3 $0
    exec tail -n 5 $0
    menuentry "Windows 10" {
    set root=(hd0,1)
    chainloader +1
    }
    savedefault
    set root=(hd0,1)
    chainloader +1
    }
  2. Pristavkin revised this gist Sep 21, 2019. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions 41_Windows
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,9 @@
    # /etc/grub.d/41_Windows
    # Boot from hd0,1 - sda2 partition ("hd0" is sda, and ",1" is second partition on disk)
    # Add "GRUB_DEFAULT="Windows 10"" line to /etc/default/grub for default boot to window 10
    # Run "chmod +x /etc/grub.d/41_Windows && grub2-mkconfig --output=/boot/grub2/grub.cfg" after all modifications for make new config file
    #!/bin/sh
    # 1. Place this file to /etc/grub.d/41_Windows
    # 2. Update Windows patrtition setting. In this example Winodws will be booted from hd0,1 - sda2 partition ("hd0" is sda, and ",1" is second partition on disk)
    # 3. Add "GRUB_DEFAULT="Windows 10"" line to /etc/default/grub for default boot to window 10
    # 4. Run "chmod +x /etc/grub.d/41_Windows && grub2-mkconfig --output=/boot/grub2/grub.cfg" after all modifications for make new config file
    exec tail -n +3 $0
    menuentry "Windows 10" {
    set root=(hd0,1)
    chainloader +1
  3. Pristavkin revised this gist Sep 21, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 41_Windows
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # /etc/grub.d/41_Windows
    # Boot from hd0,1 - sda2 partition ("hd0" is sda, and ",1" is second partition on disk)
    # Add "GRUB_DEFAULT="Windows 10"" line to /etc/default/grub for default boot to window 10
    # Run "grub2-mkconfig --output=/boot/grub2/grub.cfg" after all modifications for make new config file
    # Run "chmod +x /etc/grub.d/41_Windows && grub2-mkconfig --output=/boot/grub2/grub.cfg" after all modifications for make new config file
    menuentry "Windows 10" {
    set root=(hd0,1)
    chainloader +1
  4. Pristavkin revised this gist Sep 21, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 41_Windows
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    # /etc/grub.d/41_Windows
    # Boot from hd0,1 - sda2 partition ("hd0" is sda, and ",1" is second partition on disk)
    # Add "GRUB_DEFAULT="Windows 10"" line to /etc/default/grub for default boot to window 10
    # Run "grub2-mkconfig --output=/boot/grub2/grub.cfg" after all modifications for make new config file
    menuentry "Windows 10" {
    set root=(hd0,1)
    chainloader +1
  5. Pristavkin revised this gist Sep 21, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 41_Windows
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    # /etc/grub.d/41_Windows
    # Boot from hd0,1 - sda2 partition ("hd0" is sda, and ",1" is second partition on disk)
    # Add "GRUB_DEFAULT="Windows 10"" line to /etc/default/grub for default boot to window 10
    menuentry "Windows 10" {
    set root=(hd0,1)
    chainloader +1
  6. Pristavkin created this gist Sep 21, 2019.
    6 changes: 6 additions & 0 deletions 41_Windows
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # /etc/grub.d/41_Windows
    # Boot from hd0,1 - sda2 partition ("hd0" is sda, and ",1" is second partition on disk)
    menuentry "Windows 10" {
    set root=(hd0,1)
    chainloader +1
    }