adding recovery mode menu to grub

Asked by sadasivam

my grub menu contains upuntu, upuntu recovery mode, memtest1, memtest2, kupuntu. there is no menu to kupuntu recovery mode. how can i add it?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

it's UBUNTU and KUBUNTU, pronounced OO-BOON-TOO
http://en.wikipedia.org/wiki/Ubuntu_(operating_system)

If you run:

gksudo gedit /etc/default/grub; sudo update-grub

Find this line:
GRUB_DISABLE_LINUX_RECOVERY=true
and make it read:
#GRUB_DISABLE_LINUX_RECOVERY=true

Then save the new file and close gedit, the grub update will run and you can now reboot to test.

You do know you don't need 2 seperate OSes to get KUbuntu and Ubuntu. You can install KDE on Ubuntu and simply choose your desktop when you log on. They are exactly the same OS under the hood so you are exactly duplicating the data twice in your storage

Revision history for this message
sadasivam (srisadasivam) said :
#2

thank you. it is safe to have two seperate os. i think so.

my problem is - first i created a (user or administrator?) account during installation named sadasiv. and then i created a user account named gohila. then i deleted sadasiv. now i do not have administrative previlages because i forgot the password. now i can login using gohila account. i cannot install other softwares.

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#3

make a separate Question about "How to enable root account", here we try the grub issue.

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#4

Please make the followings.
With a working ubuntu linux loged in with root account working do:

Give the result of
1) sudo fdisk -lu

2) ls -lah /dev/disk/by-uuid/

3) mkdir disk10
i remember this from the morning

4) sudo mount /dev/sda10 disk10

5) sudo ls -lah disk10/boot/

6) sudo cat sudo cat disk10/boot/grub/grub.cfg

Please separate each info with numbers 1), 2) as the commands.

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#5

oops sorry

6) sudo cat disk10/boot/grub/grub.cfg

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#6

Something more,

the grub2 (boot loader) in which hard disk is? /dev/sda1 ?

if so give also

7) sudo cat sudo cat /boot/grub/grub.cfg

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#7

no, don't enable the root account. It isn't advised or needed

Boot to root recovery mode (Hold shift at boot, then select root) you can now run:

sudo adduser gohila admin

Reboot and gohila can now use sudo.

**ENABLING THE ROOT ACCOUNT IS REALLY DUMB AND WEAKENS SYSTEM SECURITY**

It's fine to have Ubuntu and Kubunto on seperate partitions but its kinda a waste of drive space but some puritans like to keep them seperate. No harm in it at all :)

Revision history for this message
sadasivam (srisadasivam) said :
#8

1)
 Device Boot Start End Blocks Id System

/dev/sda1 * 2048 39064547 19531250 83 Linux

/dev/sda2 39065598 488390655 224662529 5 Extended

/dev/sda5 97667072 273342563 87837746 b W95 FAT32

/dev/sda6 273346038 292977404 9815683+ b W95 FAT32

/dev/sda7 292980736 294004735 512000 83 Linux

/dev/sda8 294006784 488390655 97191936 8e Linux LVM

/dev/sda9 39065600 48830463 4882432 82 Linux swap / Solaris

/dev/sda10 48832512 97658879 24413184 83 Linux

Partition table entries are not in disk order

Disk /dev/sdb: 4022 MB, 4022337024 bytes

124 heads, 62 sectors/track, 1021 cylinders, total 7856127 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000341c1

   Device Boot Start End Blocks Id System

/dev/sdb1 * 62 7849447 3924693 b W95 FAT32

2)
total 0

drwxr-xr-x 2 root root 180 2010-11-09 21:17 .

drwxr-xr-x 6 root root 120 2010-11-09 21:16 ..

lrwxrwxrwx 1 root root 10 2010-11-09 21:53 0D32-2C23 -> ../../sda6

lrwxrwxrwx 1 root root 11 2010-11-09 21:53 5569a52e-292b-4151-8c26-bd83542b27a2 -> ../../sda10

lrwxrwxrwx 1 root root 10 2010-11-09 21:53 60F6-B330 -> ../../sdb1

lrwxrwxrwx 1 root root 10 2010-11-09 21:17 85a24926-af4b-4d67-b743-ea5d2cdef7cc -> ../../sda1

lrwxrwxrwx 1 root root 10 2010-11-09 21:53 8cef0f6e-3c2b-4b14-80cd-4e843dde4381 -> ../../sda7

lrwxrwxrwx 1 root root 10 2010-11-09 21:53 B0BA-B303 -> ../../sda5

lrwxrwxrwx 1 root root 10 2010-11-09 21:17 f9ae0031-3648-43f1-8196-45095ea95d4e -> ../../sda9

5)
total 14M

drwxr-xr-x 3 root root 4.0K 2010-07-19 18:05 .

drwxr-xr-x 23 root root 4.0K 2010-08-31 21:43 ..

-rw-r--r-- 1 root root 626K 2010-04-16 18:31 abi-2.6.32-21-generic

-rw-r--r-- 1 root root 114K 2010-04-16 18:31 config-2.6.32-21-generic

drwxr-xr-x 2 root root 4.0K 2010-07-20 16:04 grub

-rw-r--r-- 1 root root 7.6M 2010-07-19 18:05 initrd.img-2.6.32-21-generic

-rw-r--r-- 1 root root 157K 2010-03-23 15:07 memtest86+.bin

-rw-r--r-- 1 root root 1.7M 2010-04-16 18:31 System.map-2.6.32-21-generic

-rw-r--r-- 1 root root 1.2K 2010-04-16 18:33 vmcoreinfo-2.6.32-21-generic

-rw-rw-rw- 1 root root 3.9M 2010-04-16 18:31 vmlinuz-2.6.32-21-generic

7)
 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 $prefix/grubenv ]; then

  load_env

fi

set default="0"

if [ ${prev_saved_entry} ]; then

  set saved_entry=${prev_saved_entry}

  save_env saved_entry

  set prev_saved_entry=

  save_env prev_saved_entry

  set boot_once=true

fi

function savedefault {

  if [ -z ${boot_once} ]; then

    saved_entry=${chosen}

    save_env saved_entry

  fi

}

function recordfail {

  set recordfail=1

  if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi

}

insmod ext2

set root='(hd0,1)'

search --no-floppy --fs-uuid --set 85a24926-af4b-4d67-b743-ea5d2cdef7cc

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

insmod ext2

set root='(hd0,1)'

search --no-floppy --fs-uuid --set 85a24926-af4b-4d67-b743-ea5d2cdef7cc

set locale_dir=($root)/boot/grub/locale

set lang=en

insmod gettext

if [ ${recordfail} = 1 ]; then

  set timeout=-1

else

  set timeout=20

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/light-gray

### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###

menuentry 'Ubuntu, with Linux 2.6.32-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {

 recordfail

 insmod ext2

 set root='(hd0,1)'

 search --no-floppy --fs-uuid --set 85a24926-af4b-4d67-b743-ea5d2cdef7cc

 linux /boot/vmlinuz-2.6.32-25-generic root=UUID=85a24926-af4b-4d67-b743-ea5d2cdef7cc ro quiet splash

 initrd /boot/initrd.img-2.6.32-25-generic

}

menuentry 'Ubuntu, with Linux 2.6.32-25-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {

 recordfail

 insmod ext2

 set root='(hd0,1)'

 search --no-floppy --fs-uuid --set 85a24926-af4b-4d67-b743-ea5d2cdef7cc

 echo 'Loading Linux 2.6.32-25-generic ...'

 linux /boot/vmlinuz-2.6.32-25-generic root=UUID=85a24926-af4b-4d67-b743-ea5d2cdef7cc ro single

 echo 'Loading initial ramdisk ...'

 initrd /boot/initrd.img-2.6.32-25-generic

}

menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {

 recordfail

 insmod ext2

 set root='(hd0,1)'

 search --no-floppy --fs-uuid --set 85a24926-af4b-4d67-b743-ea5d2cdef7cc

 linux /boot/vmlinuz-2.6.32-21-generic root=UUID=85a24926-af4b-4d67-b743-ea5d2cdef7cc ro quiet splash

 initrd /boot/initrd.img-2.6.32-21-generic

}

menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {

 recordfail

 insmod ext2

 set root='(hd0,1)'

 search --no-floppy --fs-uuid --set 85a24926-af4b-4d67-b743-ea5d2cdef7cc

 echo 'Loading Linux 2.6.32-21-generic ...'

 linux /boot/vmlinuz-2.6.32-21-generic root=UUID=85a24926-af4b-4d67-b743-ea5d2cdef7cc ro single

 echo 'Loading initial ramdisk ...'

 initrd /boot/initrd.img-2.6.32-21-generic

}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###

menuentry "Memory test (memtest86+)" {

 insmod ext2

 set root='(hd0,1)'

 search --no-floppy --fs-uuid --set 85a24926-af4b-4d67-b743-ea5d2cdef7cc

 linux16 /boot/memtest86+.bin

}

menuentry "Memory test (memtest86+, serial console 115200)" {

 insmod ext2

 set root='(hd0,1)'

 search --no-floppy --fs-uuid --set 85a24926-af4b-4d67-b743-ea5d2cdef7cc

 linux16 /boot/memtest86+.bin console=ttyS0,115200n8

}

### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###

menuentry "Ubuntu 10.04 LTS (10.04) (on /dev/sda10)" {

 insmod ext2

 set root='(hd0,10)'

 search --no-floppy --fs-uuid --set 5569a52e-292b-4151-8c26-bd83542b27a2

 linux /boot/vmlinuz-2.6.32-21-generic root=/dev/sda10

 initrd /boot/initrd.img-2.6.32-21-generic

}

### 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 ###

Revision history for this message
sadasivam (srisadasivam) said :
#9

6)

root@sadasivams-desktop:~# sudo cat disk12/boot/grub/grub.cfg
cat: disk12/boot/grub/grub.cfg: No such file or directory

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#10

ok, i am sorry i did not mean to be root, i mean you may be able to make sudo.

ok there are two methods to fix the problem

i know that your kubuntu is in /dev/sda10 please confirm if so.

Method1
edit your /etc/grub.d/40_custom with

gksudo gedit /etc/grub.d/40_custom

and add the next lines:
---------------------------------------------------

menuentry "Kubuntu Bootloader" {

set root=(hd0,10)

chainloader +1

}

----------------------------------------------

WITHOUT ----------------------------------------
Save the file and reboot.
Normally now you will see an entry to your Grub2 that will lead you to boot loader of kubuntu on sda10.

if you dont have a bootloader in /dev/sda10 we will go to method1

Revision history for this message
sadasivam (srisadasivam) said :
#11

yes. kupuntu is in /dev/sda10

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#12

if the previous does not work

make steps until
gksudo gedit /etc/grub.d/40_custom

remove previous lines

add these lines

---------------------------------
menuentry 'KUbuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,10)'
        search --no-floppy --fs-uuid --set ec6cbb9c-9f28-4960-ab34-a8647cc4ca04
        echo 'Loading Linux 2.6.32-21-generic ...'
        linux /vmlinuz-2.6.32-21-generic root=UUID=5569a52e-292b-4151-8c26-bd83542b27a2 ro single
        echo 'Loading initial ramdisk ...'
        initrd /initrd.img-2.6.32-21-generic
}
---------------------------------

WITHOUT ---------------------------

Save and reboot you must be ok!

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#13

i forgot one step,

after save the file in any method

run

sudo update-grub

and then reboot

if i did not catch you early, you can do it now the /etc/grub.d/40_custom is already edited.

if method1 does not work
make method2

sudo update-grub

reboot
Grub must be ok, and you can boot in Kubuntu.

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#14

i must go, normally you must be ok. I will be available tommorow.

Revision history for this message
sadasivam (srisadasivam) said :
#15

method 1 : invalid signature
method 2: file not found
                load the kernel first

Revision history for this message
sadasivam (srisadasivam) said :
#16

thank you.

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#17

i am happy to give you solutions. Now you also know some things to help others.

Have a nice continue to Linux world!

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#18

with this method you can boot also your other distro, fedora.

we must know the partition /dev/sdaX
the uuid of partition
and the contents of /boot/ of /dev/sdaX

Revision history for this message
sadasivam (srisadasivam) said :
#19

my problem is not solved.
method1: invalid signature
method2: ec....04 file not found.
               load the kernel first

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#20

ok leave method1

sudo mount /dev/sda10 disk10

Please give the output:

1) sudo mount /dev/sda10 disk10

2) sudo ls -lah disk10/boot/

3) sudo cat /etc/grub.d/40_custom

Revision history for this message
sadasivam (srisadasivam) said :
#21

2)
sadasivams@sadasivams-desktop:~$ sudo ls -lah disk20/boot/
total 14M
drwxr-xr-x 3 root root 4.0K 2010-07-19 18:05 .
drwxr-xr-x 23 root root 4.0K 2010-08-31 21:43 ..
-rw-r--r-- 1 root root 626K 2010-04-16 18:31 abi-2.6.32-21-generic
-rw-r--r-- 1 root root 114K 2010-04-16 18:31 config-2.6.32-21-generic
drwxr-xr-x 2 root root 4.0K 2010-07-20 16:04 grub
-rw-r--r-- 1 root root 7.6M 2010-07-19 18:05 initrd.img-2.6.32-21-generic
-rw-r--r-- 1 root root 157K 2010-03-23 15:07 memtest86+.bin
-rw-r--r-- 1 root root 1.7M 2010-04-16 18:31 System.map-2.6.32-21-generic
-rw-r--r-- 1 root root 1.2K 2010-04-16 18:33 vmcoreinfo-2.6.32-21-generic
-rw-rw-rw- 1 root root 3.9M 2010-04-16 18:31 vmlinuz-2.6.32-21-generic

3)
#!/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.
menuentry 'KUbuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root = '(hd0,10)'
        search --no-floppy --fs-uuid --set ec6cbb9c-9f28-4960-ab34-a8647cc4ca04
        echo 'Loading Linux 2.6.32-21-generic ...'
        linux /vmlinuz-2.6.32-21-generic root=UUID=5569a52e-292b-4151-8c26-bd83542b27a2 ro single
        echo 'Loading initial ramdisk ...'
        initrd /initrd.img-2.6.32-21-generic
}

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#22

edit the /etc/grub.d/40_custom

1) gksudo gedit /etc/grub.d/40_custom

remove old lines and enter these:

--------------------------------
menuentry 'KUbuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,10)'
        search --no-floppy --fs-uuid --set ec6cbb9c-9f28-4960-ab34-a8647cc4ca04
        echo 'Loading Linux 2.6.32-21-generic ...'
        linux /boot/vmlinuz-2.6.32-21-generic root=UUID=5569a52e-292b-4151-8c26-bd83542b27a2 ro single
        echo 'Loading initial ramdisk ...'
        initrd /boot/initrd.img-2.6.32-21-generic
}
--------------------------------

WITHOUT --------------------------------

save the file
2) sudo update-grub

reboot, you must be ok now.

The problem was that i copy my menuentry but i had a /boot partition. You have only one partition for each distro
so i change the lines
form
        linux /vmlinuz-2.6.32-21-generic root=UUID=5569a52e-292b-4151-8c26-bd83542b27a2 ro single
        initrd /initrd.img-2.6.32-21-generic

to

        linux /boot/vmlinuz-2.6.32-21-generic root=UUID=5569a52e-292b-4151-8c26-bd83542b27a2 ro single
        initrd /boot/initrd.img-2.6.32-21-generic

Revision history for this message
sadasivam (srisadasivam) said :
#23

not working .

may i know the details about
ec6cbb9c-9f28-4960-ab34-a8647cc4ca04

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#24

this is an id of grub2 for file system i think. Like uuid of disks. But i think there is no importance for this.

i dont know how to generate this. The ec6cbb9c-9f28-4960-ab34-a8647cc4ca04 is from my menuentry.

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#25

try to remove --fs-uuid --set ec6cbb9c-9f28-4960-ab34-a8647cc4ca04

save
sudo update-grub
reboot

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#26

with the lines

 linux /boot/vmlinuz-2.6.32-21-generic root=UUID=5569a52e-292b-4151-8c26-bd83542b27a2 ro single
 initrd /boot/initrd.img-2.6.32-21-generic

are you sure that is not working?

what error gives you?

Revision history for this message
sadasivam (srisadasivam) said :
#27

file not found
load the kernel first

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#28

i think the config file is correct.

you have the right files from disk10/boot

-rw-r--r-- 1 root root 7.6M 2010-07-19 18:05 initrd.img-2.6.32-21-generic
-rw-rw-rw- 1 root root 3.9M 2010-04-16 18:31 vmlinuz-2.6.32-21-generic

 linux /boot/vmlinuz-2.6.32-21-generic root=UUID=5569a52e-292b-4151-8c26-bd83542b27a2 ro single
 initrd /boot/initrd.img-2.6.32-21-generic

and the right UUID, 5569a52e-292b-4151-8c26-bd83542b27a2
lrwxrwxrwx 1 root root 11 2010-11-09 21:53 5569a52e-292b-4151-8c26-bd83542b27a2 -> ../../sda10

So normally all are OK.

The only thing is to have an old BIOS

I copy from https://help.ubuntu.com/community/Grub2#File%20Not%20Found%20%28Error%2015%29

----------------------------------
1) File Not Found (Error 15)

This error is the result of a GRUB 2 installation to /boot but a Master Boot Record ( MBR ) which still contains Grub legacy. This can happen if you don't select your drive when running sudo upgrade-from-grub-legacy. Shortly after starting this command the user will be asked to select the device (sda, sdb, etc). Highlight the drive and press the space bar to select it when presented with this screen. Failure to select a drive will result in an Error 15.

To recover from this error, GRUB 2 must be reinstalled. Go to Reinstalling from the LiveCD for instructions.

2) Grub shows rescue prompt (and does not continue to boot)

You may have a buggy bios and the location of your /boot/* files is not under the 1024 cylinder boundary.
----------------------------------

If this is the case i suggest to save your personal data and make a normall installation without many partitions for each Graphical enviroment.

You can install a Ubuntu system and after install the KDE inside Ubuntu.
When you will be in login screen you will choose the session you prefer Gnome/KDE.
There is no need to have Ubuntu and Kubuntu separated. It is the same system.

I dont know further to help you. I made my best.

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#29

install KDE from synaptic not live cd Kubuntu.

Revision history for this message
delance (olivier-delance) said :
#30

Like actionparsnip, I think it would be easier to have a single OS and two window managers.
If you like to continue into dual boot way, could you tell me if you use same version for Kubuntu and Ubuntu (e.g. 10.10) , and if not what version for each of them ?

Revision history for this message
Demosthenes Koptsis (demosthenesk) said :
#31

wait your Kubuntu boots normally eh?

if you do a
sudo cat /boot/grub/grub.cfg | less

you will see a menuentry like

menuentry 'Kubuntu ....

copy this menuentry to your /etc/grub.d/40_custom

but change only the line

from like
linux /vmlinuz-2.6.32-25-generic root=UUID=bd9c1dde-fbdd-40a6-86c1-09d
cb0b68f5b ro quiet splash

linux /boot/vmlinuz-2.6.32-21-generic root=UUID=5569a52e-292b-4151-8c26-bd83542b27a2 ro single

that means change the "quite slpash" to "single" this is the recovery mode.

do not change /boot/grub/grub.cfg
change /etc/grub.d/40_custom.

save
sudo update-grub
reboot

i dont know anything else!

Revision history for this message
sadasivam (srisadasivam) said :
#32

to delance:
          10.04 both
to actionparsnip:
          i decided to follow your idea.
to demosthenesk:
         thank you for continuous effort.

Revision history for this message
delance (olivier-delance) said :
#33

So both use Grub2, which will avoid chaining boot loader.
I think you should create a partition dedicated to /boot, and shared by all Unixes using Grub Legacy and Grub2. In your case, you only have Grub2, which is better.
Each time update-manager install a new kernel, it will modify "/boot".
MBR in first sector of disk point directly to "/boot", but if you have two "/boot", one by OS, it's difficult to know which one is used. So you could boot Kubuntu with "/boot" of Ubuntu or you could boot Ubuntu with "/boot" of Kubuntu. This will make situation un-manageable.
After creating this partition, you will have to run "sudo update-grub". I advise you to run at least one time for all installed Unixes.

Can you help with this problem?

Provide an answer of your own, or ask sadasivam for more information if necessary.

To post a message you must log in.