Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
Hi, trying to change with the entry of grub: sudo kate /boot/grub/grub.cfg putting "Windows 7" in place of Windows Recovery Environment (loader) on /dev/sda2. just launch the command sudo update-grub ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    20

    Cool how to modify name entry grub [kubuntu 10.10]

    Hi,
    trying to change with the entry of grub:
    sudo kate /boot/grub/grub.cfg putting "Windows 7" in place of Windows Recovery Environment (loader) on /dev/sda2.
    just launch the command sudo update-grub charge me more:
    -Found linux image: /boot/vmlinuz-2.6.35-22-generic
    -Found initrd image: /boot/initrd.img-2.6.35-22-generic
    -Found memtest86+ image: /boot/memtest86+.bin
    -Found Windows Recovery Environment (loader) on /dev/sda2
    Windows 7 should be written here. The procedure is another?
    Thanks

  2. #2
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    Yes, with grub2 you don't edit grub.cfg (check why in the link below).

    Your answer is at
    https://help.ubuntu.com/community/Grub2
    under Custom Menu Entries

    Regards
    Luis

  3. #3
    Just Joined!
    Join Date
    Aug 2010
    Posts
    20
    help me write name grub entry?

  4. #4
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    Quote Originally Posted by polis2010 View Post
    help me write name grub entry?
    Sure.

    Custom Menu Entries

    GRUB 2 allows users to create customized menu selections which will be automatically added to the main menu when sudo update-grub is executed. An empty 40_custom file is available in /etc/grub.d/ for use or to serve as an example to create other custom menus.

    The user can either edit the default /etc/grub.d/40_custom file or create a new one. The easiest way to create the content of a custom menu is to copy a working entry from /boot/grub/grub.cfg. Once copied, the contents of 40_custom can be tailored to the user's desires.

    Run sudo update-grub after.

    $ cat /etc/grub.d/40_custom
    #!/bin/sh
    exec tail -n +3 $0
    # 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.

    If you have more questions, get back.
    And please tell us how it went.
    Regards,
    Luis

    "Linux is easy."

  5. #5
    Just Joined!
    Join Date
    Oct 2006
    Location
    France
    Posts
    18
    Hello.

    To add to Luis suggestion, I'd like to add one.
    Here is what I found into my grub.cfg located in /boot/grub/

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Windows NT/2000/XP (on /dev/sda1)" {
    insmod fat
    set root='(hd0,1)'
    search --no-floppy --fs-uuid --set 1c03-0fe5
    drivemap -s (hd0) ${root}
    chainloader +1
    }

    This is the portion of the script that would be loaded at boot time.
    You cannot modify this by hand. It won't do anything good.
    Insted, add this entry (yours, not mine) to the /etc/grub.d/40_custom as described by Luis.
    This is now where you can modify the entry with the title that you would like to appear on the screen.
    Modify it. Do not forget the } sign at the end otherwise it won't work!
    Save the file.
    run udpate-grub as root
    Check your /boot/grub/grub.cfg file to see if your modification has been made.
    Reboot.
    You should be able to see the new entry you've made at the bottom of the menu list.

  6. #6
    Just Joined!
    Join Date
    Aug 2010
    Posts
    20
    on my grub.cfc there is :
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Windows Recovery Environment (loader) (on /dev/sda2)" {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos2)'
    search --no-floppy --fs-uuid --set xxxxxxxxxxxxx
    drivemap -s (hd0) ${root}
    chainloader +1
    }

    I want to put "Windows 7" on file 40_custom, would like?

  7. #7
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    polis, you are very new to Linux, right? Or do you have dificulty reading in English?
    Just asking so I may help better.

    "You cannot modify this by hand. It won't do anything good.
    Instead, add this entry (yours, not mine) to the /etc/grub.d/40_custom as described by Luis.
    This is now where you can modify the entry with the title that you would like to appear on the screen.
    Modify it. Do not forget the } sign at the end otherwise it won't work!
    Save the file.
    run udpate-grub as root
    Check your /boot/grub/grub.cfg file to see if your modification has been made.
    Reboot.
    You should be able to see the new entry you've made at the bottom of the menu list. "

  8. #8
    Just Joined!
    Join Date
    Aug 2010
    Posts
    20
    luis then, how to add entry in 40_cutom file?
    thanks

  9. #9
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    The idea is to open both files in a text editor and copy and paste from grub.cfg to 40_custom.

    But to do that you must have write permissons to /etc/grub.d/40_custom.
    If you type
    $ls -l /etc/grub.d/40_custom
    you'll get
    -rwxr-xr-x 1 root root 214 2009-12-07 22:49 /etc/grub.d/40_custom

    That means only root user can write on it.

    Saw in your 1st post you use kate. Do you know how to do the copy and paste with it between files, running as root (sudo kate ...)?

    That will do it.

    Hope it helps
    Luis

    PS: I use vi or nano. I may just open two terminals, open both files, select with mouse in grub.cfg (or left click -> Copy), change to 40_custom, press mouse wheel/middle button to paste (or left click -> Paste) .

    There's several other ways to do it, with terminal based or graphical editors. The easiest way depends on your linux knowledge.

  10. #10
    Just Joined!
    Join Date
    Oct 2006
    Location
    France
    Posts
    18
    Quote Originally Posted by ptkobe View Post
    The idea is to open both files in a text editor and copy and paste from grub.cfg to 40_custom.

    But to do that you must have write permissons to /etc/grub.d/40_custom.
    If you type
    $ls -l /etc/grub.d/40_custom
    you'll get
    -rwxr-xr-x 1 root root 214 2009-12-07 22:49 /etc/grub.d/40_custom

    That means only root user can write on it.

    Saw in your 1st post you use kate. Do you know how to do the copy and paste with it between files, running as root (sudo kate ...)?

    That will do it.

    Hope it helps
    Luis

    PS: I use vi or nano. I may just open two terminals, open both files, select with mouse in grub.cfg (or left click -> Copy), change to 40_custom, press mouse wheel/middle button to paste (or left click -> Paste) .

    There's several other ways to do it, with terminal based or graphical editors. The easiest way depends on your linux knowledge.
    YEs

    Don't forget to make a copy of those files FIRST...

    And in case you don't get it, here it is again.

    1. Open the file 40_custom which is located in /etc/grub.d/
    Ok ?

    2. Copy and paste your entry at the bottom as said in the file:
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Windows Recovery Environment (loader) (on /dev/sda2)" {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos2)'
    search --no-floppy --fs-uuid --set xxxxxxxxxxxxx
    drivemap -s (hd0) ${root}
    chainloader +1
    }
    Ok ?

    3. Rename this line >>> "Windows Recovery Environment (loader) (on /dev/sda2)"
    with something you like.
    Ok ?

    4. Save the file (of course you are root. right ?)
    Ok ?

    5. Do an update-grub
    Ok ?

    6. Reboot.
    You may see an new entry at the bottom.

    Now, would you remove the previous entry ?
    Last edited by tinytux; 11-13-2010 at 03:54 AM. Reason: modifications

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
  •  
...