Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19
Hello im a linux noob and thats the reason I want to boot my windows xp by default. Now kubuntu boots first. I've googled how to do this but the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Posts
    23

    [SOLVED] GRUB boot order


    Hello im a linux noob and thats the reason I want to boot my windows xp by default.

    Now kubuntu boots first.

    I've googled how to do this but the topics of other people with the same 'problem' were old or maybe incorrrect. Because the official GRUB Ubuntu wiki says you should not change the /boot/grub/grub.cfg file manually. The first line on the .cfg file is also a warning: DO NOT EDIT THIS FILE.

    So it continued looking for a proper way to change the boot order. Then I found something about etc/grub.d and also etc/default/grub

    The problem is I don't understand how to change the boot order using this.

    Can anyone explain me ? (and remember im a linux noob )

    Thanks!

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,206
    You are using grub 2, which is more complicated in its operations than the legacy grub that I use. But I found the following on Google. It's an extract from the Grub2 manual.:

    "The following variables can be defined in /etc/default/grub to customize generated file :

    GRUB_DEFAULT=NUM

    The menu entry NUM will automatically be be booted after GRUB_TIMEOUT seconds if the user haven't chosen a menu entry.

    NUM must be specified as the row number to boot, first line is row 0. Set GRUB_DEFAULT=, then run update-grub.

    GRUB_TIMEOUT=SECONDS

    * Grub will boot the default entry after SECONDS, if the user remained inactive. "

    I don't know what editor you are using; let's assume kate. So you start by opening a terminal and typing "kdesu cp /etc/default/grub /etc/default/grub.orig". kdesu gives you root access (i.e. makes you the system administrator temporarily) and the rest of the command makes a safety copy of the file you are going to edit. You should always do this before modifying an important system file.

    Next type "kdesu kate /etc/default/grub" to put the configfuration file into the kate editor. Then find (or if need be insert) the line with GRUB_DEFAULT as shown above and edit it so that NUM is the menu number of the default you want (remembering that the count starts at zero, not one). Save and exit the editor.

    Finally type "kdesu grub-update" to make your new grub.cfg.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  3. #3
    Just Joined!
    Join Date
    Jan 2010
    Posts
    23
    thanks this is really helpful

    -- edit

    now i know i have to set it as '8' but i cant modify the file. i need root permisson.

    kdesu does not work.

    i tried sudo edit /etc/default/grub
    and su root
    and sudo gedit /etc/default/grub

    i feel such a noob its frustrating

  4. #4
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    339
    What does happen when you input
    Code:
    kdesu kate /etc/default/grub
    Do you get a blank document?
    If you don't have kate try kwrite instead of kate in the line.
    Pete

  5. #5
    Just Joined!
    Join Date
    Jan 2010
    Posts
    23

    Unhappy

    it says: kdesu: command not found

  6. #6
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    You did issue this command in Kubuntu, correct?

    Can you login as root in terminal window, like this?
    su -
    (password) Press enter
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Have you tried nano editor?
    Code:
    sudo nano /etc/default/grub
    Press Ctrl+X, Y and hit Enter key to save file.

    Its not recommended to edit grub.cfg file but if its necessary then you have to set write of grub.cfg file first.
    Execute this
    Code:
    sudo chmod +w /boot/grub/grub.cfg
    Edit file using nano editor.
    Code:
    sudo nano /boot/grub/grub.cfg
    Reset write bit again.
    Code:
    sudo chmod -w /boot/grub/grub.cfg
    If you have any question, post the contents of grub.cfg file here.
    Last edited by devils casper; 02-13-2010 at 03:40 PM.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    I guess this is part of grub2? Man, I need to learn up on this stuff....i'm getting behind the times.
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  9. #9
    Just Joined!
    Join Date
    Jan 2010
    Posts
    23
    sorry i havent had any time lately, I will soon let you guys know more, i will try the nano thing.

    thanks for helping me so far !

  10. #10
    Just Joined!
    Join Date
    Jan 2010
    Posts
    23
    Quote Originally Posted by devils casper View Post
    Have you tried nano editor?
    Code:
    sudo nano /etc/default/grub
    Press Ctrl+X, Y and hit Enter key to save file.

    Its not recommended to edit grub.cfg file but if its necessary then you have to set write of grub.cfg file first.
    Execute this
    Code:
    sudo chmod +w /boot/grub/grub.cfg
    Edit file using nano editor.
    Code:
    sudo nano /boot/grub/grub.cfg
    Reset write bit again.
    Code:
    sudo chmod -w /boot/grub/grub.cfg
    If you have any question, post the contents of grub.cfg file here.
    ok this is my grub.cfg:

    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #

    ### BEGIN /etc/grub.d/00_header ###
    if [ -s /boot/grub/grubenv ]; then
    have_grubenv=true
    load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
    saved_entry=${prev_saved_entry}
    save_env saved_entry
    prev_saved_entry=
    save_env prev_saved_entry
    fi
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    if loadfont /usr/share/grub/unicode.pf2 ; then
    set gfxmode=640x480
    insmod gfxterm
    insmod vbe
    if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
    fi
    fi
    if [ ${recordfail} = 1 ]; then
    set timeout=-1
    else
    set timeout=10
    fi
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/white
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/10_linux ###
    menuentry "Ubuntu, Linux 2.6.31-19-generic" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-19-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro quiet splash
    initrd /boot/initrd.img-2.6.31-19-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-19-generic (recovery mode)" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-19-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro single
    initrd /boot/initrd.img-2.6.31-19-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-17-generic" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-17-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro quiet splash
    initrd /boot/initrd.img-2.6.31-17-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-17-generic (recovery mode)" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-17-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro single
    initrd /boot/initrd.img-2.6.31-17-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-14-generic" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro quiet splash
    initrd /boot/initrd.img-2.6.31-14-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro single
    initrd /boot/initrd.img-2.6.31-14-generic
    }
    ### END /etc/grub.d/10_linux ###

    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    linux16 /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
    insmod ntfs
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set c230e8ff30e8fb75
    drivemap -s (hd0) ${root}
    chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###

    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###


    however I prefer editing it in Kate, because I don't want to make any mistakes. Here I don't get any permissions for saving the file. However I think I know how to put it. Is it correct in this way? :


    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #

    ### BEGIN /etc/grub.d/00_header ###
    if [ -s /boot/grub/grubenv ]; then
    have_grubenv=true
    load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
    saved_entry=${prev_saved_entry}
    save_env saved_entry
    prev_saved_entry=
    save_env prev_saved_entry
    fi
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    if loadfont /usr/share/grub/unicode.pf2 ; then
    set gfxmode=640x480
    insmod gfxterm
    insmod vbe
    if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
    fi
    fi
    if [ ${recordfail} = 1 ]; then
    set timeout=-1
    else
    set timeout=10
    fi
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/white
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
    insmod ntfs
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set c230e8ff30e8fb75
    drivemap -s (hd0) ${root}
    chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###

    ### BEGIN /etc/grub.d/10_linux ###
    menuentry "Ubuntu, Linux 2.6.31-19-generic" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-19-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro quiet splash
    initrd /boot/initrd.img-2.6.31-19-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-19-generic (recovery mode)" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-19-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro single
    initrd /boot/initrd.img-2.6.31-19-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-17-generic" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-17-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro quiet splash
    initrd /boot/initrd.img-2.6.31-17-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-17-generic (recovery mode)" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-17-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro single
    initrd /boot/initrd.img-2.6.31-17-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-14-generic" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro quiet splash
    initrd /boot/initrd.img-2.6.31-14-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd1,5)
    search --no-floppy --fs-uuid --set 98745e1e-cd00-4325-a2db-046da2001871
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=98745e1e-cd00-4325-a2db-046da2001871 ro single
    initrd /boot/initrd.img-2.6.31-14-generic
    }
    ### END /etc/grub.d/10_linux ###

    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    linux16 /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###



    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###




    I think that should do ? But how do I change it in kate ?? Nano editor seems to work but it's a bit risky for me as a noob :P

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •