LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do i change the kernel to boot from? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-change-the-kernel-to-boot-from-754816/)

lampamp 09-13-2009 10:00 AM

How do i change the kernel to boot from?
 
hi i want to change the kernel to boot from use my video card river
i want to boot from kernel-2.6.30.5-43.fc11.i586
how can i do that
here are some important outputs i've got
Quote:

[liveuser@localhost ~]$ rpm -qa | grep kernel
kernel-2.6.30.5-43.fc11.i586
kerneloops-0.12-5.fc11.i586
kernel-2.6.29.4-167.fc11.i586
kernel-firmware-2.6.30.5-43.fc11.noarch
[liveuser@localhost ~]$ uname -r
2.6.29.4-167.fc11.i586
[liveuser@localhost ~]$ yum list installed | grep kmod-nvidia
kmod-nvidia.i586 185.18.36-1.fc11.1 installed
kmod-nvidia-2.6.30.5-43.fc11.i586.i586 185.18.36-1.fc11.1 installed

nkd 09-13-2009 10:43 AM

have you compiled and installed the kernel 2.6.30.5?
the last step is make install and that should give you a new entry in the grub.
hope this helps
nishith

Hi_This_is_Dev 09-13-2009 03:17 PM

An entry in the file /etc/grub.conf can solve your problem. Here's an example of it:

Code:

#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.6.6-1.435.2.3)
        root (hd0,0)
        kernel /vmlinuz-2.6.6-1.435.2.3 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.6-1.435.2.3.img
title Fedora Core (2.6.5-1.358)
        root (hd0,0)
        kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.5-1.358.img
title UML Vanilla (2.6.7)
        root (hd0,0)
        kernel /vmlinuz-uml ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.7.img


Just add your custom entry at the end beginning with

Code:

title My Kernel
When you restart your system you should see your kernel listed in the OS/Kernels list. Select your kernel and see if you succeed. If not, then post the contents of your grub.conf file with the modifications you make in it.

lampamp 09-13-2009 04:23 PM

Quote:

Originally Posted by Hi_This_is_Dev (Post 3681365)
An entry in the file /etc/grub.conf can solve your problem. Here's an example of it:

Code:

#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.6.6-1.435.2.3)
        root (hd0,0)
        kernel /vmlinuz-2.6.6-1.435.2.3 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.6-1.435.2.3.img
title Fedora Core (2.6.5-1.358)
        root (hd0,0)
        kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.5-1.358.img
title UML Vanilla (2.6.7)
        root (hd0,0)
        kernel /vmlinuz-uml ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.7.img


Just add your custom entry at the end beginning with

Code:

title My Kernel
When you restart your system you should see your kernel listed in the OS/Kernels list. Select your kernel and see if you succeed. If not, then post the contents of your grub.conf file with the modifications you make in it.

will it work on the usb
im using a bootable usb
and i have no such file called grub.conf in /etc

i have the two kernels installed but i want to boot from kernel-2.6.30.5-43.fc11.i586
and my fedora is booting from the other one

please explain with examples
i am a newbie in linux

lampamp 09-14-2009 04:53 AM

won't anybody answer?

lutusp 09-14-2009 05:58 AM

Quote:

Originally Posted by lampamp (Post 3682024)
won't anybody answer?

As to booting from a USB stick, this is accomplished with your BIOS, not the Grub configuration on your hard drive. You have to enable USB booting, and you have to give the USB boot device priority over the hard drive.

As to the location of the grub configuration file, it is located at:

/boot/grub/grub.conf

lampamp 09-14-2009 06:37 AM

Quote:

Originally Posted by lutusp (Post 3682078)
As to booting from a USB stick, this is accomplished with your BIOS, not the Grub configuration on your hard drive. You have to enable USB booting, and you have to give the USB boot device priority over the hard drive.

As to the location of the grub configuration file, it is located at:

/boot/grub/grub.conf

noo
i know that
i am able to boot my usb
but my usb is running on kernel-2.6.29.4-167.fc11.i586
and i want to run it on kernel-2.6.30.5-43.fc11.i586

i have them both installed but my usb fedora is running on kernel-2.6.29.4-167.fc11.i586 so i only want to change the kernel im using

mdg 09-14-2009 07:46 AM

You've been given all the information you need to solve the problem. All you have to do is follow the instructions from Hi_This_is_Dev and lutusp.

lampamp 09-14-2009 07:58 AM

Quote:

Originally Posted by mdg (Post 3682192)
You've been given all the information you need to solve the problem. All you have to do is follow the instructions from Hi_This_is_Dev and lutusp.

but i dont have the files they talked about (in etc and boot/grub)

mdg 09-14-2009 08:19 AM

Then try looking for the file menu.lst in /boot/grub

mobinskariya 09-14-2009 08:25 AM

can you give us the output of
Code:

ls -l
when inside the /boot and /boot/grub..

regards
mobin

lampamp 09-14-2009 08:44 AM

Quote:

Originally Posted by mdg (Post 3682216)
Then try looking for the file menu.lst in /boot/grub

in /boot/grub
i have only one file called "splash.xpm.gz"

lampamp 09-14-2009 08:46 AM

Quote:

Originally Posted by mobinskariya (Post 3682222)
can you give us the output of
Code:

ls -l
when inside the /boot and /boot/grub..

regards
mobin

sorry but what's the command to become in /boot?

mobinskariya 09-14-2009 08:49 AM

i meant to change your directory to /boot..
Code:

cd /boot
edit: also i havnt tried usb booting..

lampamp 09-14-2009 09:03 AM

Quote:

Originally Posted by mobinskariya (Post 3682255)
i meant to change your directory to /boot..
Code:

cd /boot
edit: also i havnt tried usb booting..

the output is
Quote:

[liveuser@localhost boot]$ ls -l
total 12196
-rw-r--r--. 1 root root 97567 2009-05-27 17:25 config-2.6.29.4-167.fc11.i586
-rw-r--r--. 1 root root 100548 2009-08-27 21:30 config-2.6.30.5-43.fc11.i586
drwxr-xr-x. 3 root root 4096 2009-06-04 13:07 efi
-rw-r--r--. 1 root root 118396 2009-04-24 15:19 elf-memtest86+-2.11
drwxr-xr-x. 2 root root 4096 2009-04-29 17:33 grub
-rw-------. 1 root root 3168668 2009-09-15 16:58 initrd-2.6.30.5-43.fc11.i586.img
-rw-r--r--. 1 root root 116720 2009-04-24 15:19 memtest86+-2.11
-rw-r--r--. 1 root root 1257178 2009-05-27 17:25 System.map-2.6.29.4-167.fc11.i586
-rw-r--r--. 1 root root 1365421 2009-08-27 21:30 System.map-2.6.30.5-43.fc11.i586
-rwxr-xr-x. 1 root root 3035056 2009-05-27 17:25 vmlinuz-2.6.29.4-167.fc11.i586
-rwxr-xr-x. 1 root root 3208560 2009-08-27 21:30 vmlinuz-2.6.30.5-43.fc11.i586

lampamp 09-14-2009 11:36 AM

see also the outputs in the top post
they show that i'm running 2.6.29.4-167.fc11.i586

Hi_This_is_Dev 09-14-2009 03:29 PM

Quote:

Originally Posted by lampamp (Post 3682272)
drwxr-xr-x. 2 root root 4096 2009-04-29 17:33 grub


cd to that directory as given below:

Code:

cd grub
Now give this commmand:

Code:

ls -l

Have a look at the steps I have shown below:
Code:

-bash-2.05b# pwd
/root
-bash-2.05b# cd /boot/grub/
-bash-2.05b# ls -l
total 192
-rw-r--r--  1 root root    82 Jul 22  2004 device.map
-rw-r--r--  1 root root  7616 Jul 22  2004 e2fs_stage1_5
-rw-r--r--  1 root root  7344 Jul 22  2004 fat_stage1_5
-rw-r--r--  1 root root  6656 Jul 22  2004 ffs_stage1_5
-rw-------  1 root root    819 Mar 29  2005 grub.conf
-rw-r--r--  1 root root  8160 Jul 22  2004 jfs_stage1_5
lrwxrwxrwx  1 root root    11 Jul 27  2004 menu.lst -> ./grub.conf
-rw-r--r--  1 root root  6848 Jul 22  2004 minix_stage1_5
-rw-r--r--  1 root root  9024 Jul 22  2004 reiserfs_stage1_5
-rw-r--r--  1 root root  3461 May  5  2004 splash.xpm.gz
-rw-r--r--  1 root root    512 Jul 22  2004 stage1
-rw-r--r--  1 root root 101800 Jul 22  2004 stage2
-rw-r--r--  1 root root  6304 Jul 22  2004 vstafs_stage1_5
-rw-r--r--  1 root root  9096 Jul 22  2004 xfs_stage1_5
-bash-2.05b#

The file grub.conf is listed there.


The same file (linked) is found in the directory /etc also as given below:

Code:

-bash-2.05b# pwd
/root
-bash-2.05b# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hda2
#          initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.6.6-1.435.2.3)
        root (hd0,0)
        kernel /vmlinuz-2.6.6-1.435.2.3 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.6-1.435.2.3.img
title Fedora Core (2.6.5-1.358)
        root (hd0,0)
        kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.5-1.358.img
title UML Vanilla (2.6.7)
        root (hd0,0)
        kernel /vmlinuz-uml ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.7.img
-bash-2.05b#



About booting from a USB drive, I cannot help you because I have never tried it. But yes, the USB drive must be bootable and you have to configure your BIOS to change first priority from your hard disk or floppy disk or whatever it may be to USB Drive.

lutusp 09-14-2009 07:46 PM

Quote:

Originally Posted by lampamp (Post 3682272)
the output is

You've listed the contents of your /boot directory. In this list is another directory called "grub". Move to that directory:

# cd grub

Notice that the file grub.conf, that you believe doesn't exist, is listed.

Make a copy for safekeeping:

# cp grub.conf grub.backup

Now edit the configuration:

# kwrite grub.conf

Add a menu entry to the menu list to allow booting from the kernel you want. For example, you might have an existing menu entry like this (copied from my grub.conf):

title Fedora (2.6.30.5-43.fc11.i686.PAE)
root (hd0,0)
kernel /boot/vmlinuz-2.6.30.5-43.fc11.i686.PAE ro root=UUID=d07e202b-d783-4d15-a303-93c15ff4c17f rhgb quiet
initrd /boot/initrd-2.6.30.5-43.fc11.i686.PAE.img

Make a copy of your version of this text block, add it to the menu list below the original entry, and give it a different title. Change the kernel specifier numbers to correspond to the kernel you want to add to the menu by reading the numbers located in the /boot file list.

Save the edited grub.conf file and boot from the USB stick.

jschiwal 09-14-2009 07:51 PM

Do you have a /boot/grub/menu.lst file. That is the one to modify.

mobinskariya 09-14-2009 08:33 PM

OP says he has no menu.lst.how can that happen? i havnt tried usb booting(so ignorant)
Quote:

Originally Posted by lampamp (Post 3682246)
in /boot/grub
i have only one file called "splash.xpm.gz"


jschiwal 09-15-2009 04:30 AM

You will need to provide more information about your installation. Why do you use a usb to boot? Is it a boot disk that simply contains the MBR used to continue booting from another partition? How did you produce this boot disk? Did you follow a howto?

Print out "cat /proc/cmdline". That will show where the partition containing the kernel is.

Post the output of "sudo /sbin/fdisk -l" which shows your partitions.
Post the output of "cat /etc/fstab". The boot directory may be in it's own partition.
Post the output of "ls /boot" and "ls /". I've seen installations where the kernel and grub files are in the root (/) directory.

normally, the /boot/grub directory will contain these files:
Code:

/boot/grub
default    device.map.old  fat_stage1_5  iso9660_stage1_5  menu.lst      minix_stage1_5    stage1  stage2.old    vstafs_stage1_5
device.map  e2fs_stage1_5  ffs_stage1_5  jfs_stage1_5      reiserfs_stage1_5  stage2  ufs2_stage1_5  xfs_stage1_5

In the initial grub screen, when you boot, instead of selecting the kernel, opt to edit instead. Instead of editing the values, write them down an
d post the results. We need a starting point before we even know where the relevant files are located. This stanza should look like:
Code:

title openSUSE 11.1 - 2.6.27.29-0.1 (default)
    root (hd0,5)
    kernel /boot/vmlinuz-2.6.27.29-0.1-default root=/dev/disk/by-id/ata-TOSHIBA_MK2049GSY_48CYT01OT-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK2049GSY_48CYT01OT-part5 splash=silent showopts vga=0x314
    initrd /boot/initrd-2.6.27.29-0.1-default


lampamp 09-15-2009 05:31 AM

Quote:

Originally Posted by jschiwal (Post 3683354)
You will need to provide more information about your installation. Why do you use a usb to boot? Is it a boot disk that simply contains the MBR used to continue booting from another partition? How did you produce this boot disk? Did you follow a howto?

Print out "cat /proc/cmdline". That will show where the partition containing the kernel is.

Post the output of "sudo /sbin/fdisk -l" which shows your partitions.
Post the output of "cat /etc/fstab". The boot directory may be in it's own partition.
Post the output of "ls /boot" and "ls /". I've seen installations where the kernel and grub files are in the root (/) directory.

normally, the /boot/grub directory will contain these files:
Code:

/boot/grub
default    device.map.old  fat_stage1_5  iso9660_stage1_5  menu.lst      minix_stage1_5    stage1  stage2.old    vstafs_stage1_5
device.map  e2fs_stage1_5  ffs_stage1_5  jfs_stage1_5      reiserfs_stage1_5  stage2  ufs2_stage1_5  xfs_stage1_5

In the initial grub screen, when you boot, instead of selecting the kernel, opt to edit instead. Instead of editing the values, write them down an
d post the results. We need a starting point before we even know where the relevant files are located. This stanza should look like:
Code:

title openSUSE 11.1 - 2.6.27.29-0.1 (default)
    root (hd0,5)
    kernel /boot/vmlinuz-2.6.27.29-0.1-default root=/dev/disk/by-id/ata-TOSHIBA_MK2049GSY_48CYT01OT-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK2049GSY_48CYT01OT-part5 splash=silent showopts vga=0x314
    initrd /boot/initrd-2.6.27.29-0.1-default


made the usb using live usb creator
i couldn't format the hd because i have many important files on it

so i've got some outputs:

Quote:

[liveuser@localhost ~]$ cd /boot
[liveuser@localhost boot]$ cd grub
[liveuser@localhost grub]$ cp grub.conf grub.backup
cp: cannot stat `grub.conf': No such file or directory
[liveuser@localhost grub]$ ls -l
total 100
-rw-r--r--. 1 root root 98743 2009-04-17 14:19 splash.xpm.gz
Quote:

[liveuser@localhost ~]$ ls /boot
config-2.6.29.4-167.fc11.i586 memtest86+-2.11
efi System.map-2.6.29.4-167.fc11.i586
elf-memtest86+-2.11 untitled folder
grub vmlinuz-2.6.29.4-167.fc11.i586
initrd-2.6.29.4-167.fc11.i586.img
Quote:

[liveuser@localhost ~]$ ls /
bin dev home lost+found mnt proc sbin srv tmp var
boot etc lib media opt root selinux sys usr

mobinskariya 09-15-2009 05:37 AM

give us the output of
Code:

df -h
fdisk -l


lampamp 09-15-2009 07:27 AM

Quote:

Originally Posted by mobinskariya (Post 3683401)
give us the output of
Code:

df -h
fdisk -l


the outputs are:
Quote:

[liveuser@localhost ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/live-rw 3.0G 2.3G 684M 78% /
tmpfs 1007M 220K 1007M 1% /dev/shm
/dev/sdc1 2.0G 2.0G 520K 100% /mnt/live
varcacheyum 1007M 0 1007M 0% /var/cache/yum
/tmp 1007M 12K 1007M 1% /tmp
vartmp 1007M 0 1007M 0% /var/tmp
[liveuser@localhost ~]$ fdisk -l
[liveuser@localhost ~]$
note fdisk -l gave me nothing

lampamp 09-15-2009 07:35 AM

i found a folder called boot in /mnt/live/efi
this folder contains
Quote:

[root@localhost boot]# ls -l
total 9296
-rwxr-xr-x. 1 root root 407 2009-06-04 20:10 boot.conf
-rwxr-xr-x. 1 root root 216534 2009-06-04 20:10 boot.efi
-rwxr-xr-x. 1 root root 407 2009-06-04 20:10 bootia32.conf
-rwxr-xr-x. 1 root root 216534 2009-06-04 20:10 bootia32.efi
-rwxr-xr-x. 1 root root 407 2009-06-04 20:10 grub.conf
-rwxr-xr-x. 1 root root 4862836 2009-06-04 20:10 initrd0.img
-rwxr-xr-x. 1 root root 14336 2009-06-04 20:10 isolinux.bin
-rwxr-xr-x. 1 root root 987 2009-06-04 20:10 isolinux.cfg
-rwxr-xr-x. 1 root root 116720 2009-06-04 20:10 memtest
-rwxr-xr-x. 1 root root 775160 2009-06-04 20:10 splash.jpg
-rwxr-xr-x. 1 root root 98743 2009-06-04 20:10 splash.xpm.gz
-rwxr-xr-x. 1 root root 147728 2009-06-04 20:10 vesamenu.c32
-rwxr-xr-x. 1 root root 3035056 2009-06-04 20:10 vmlinuz0
i found that the boot.conf and the grub.conf and the bootia32.conf are the same
the contents of the 3 files abobe are:

Quote:

default=0
splashimage=/EFI/boot/splash.xpm.gz
timeout 10
hiddenmenu

title Fedora-11-i686-Live
kernel /EFI/boot/vmlinuz0 root=CDLABEL=Fedora-11-i686-Live rootfstype=auto ro liveimg quiet rhgb
initrd /EFI/boot/initrd0.img
title Verify and Boot Fedora-11-i686-Live
kernel /EFI/boot/vmlinuz0 root=CDLABEL=Fedora-11-i686-Live rootfstype=auto ro liveimg quiet rhgb check
initrd /EFI/boot/initrd0.img
do u think this plays a role and what should i do?

mobinskariya 09-15-2009 07:43 AM

where is your new kernel image?i cant find any in your /boot other than vmlinuz0.

lampamp 09-15-2009 07:54 AM

Quote:

Originally Posted by mobinskariya (Post 3683529)
where is your new kernel image?i cant find any in your /boot other than vmlinuz0.

i dont know
i searched for it

can u give me a way to uninstall the old kernel

mobinskariya 09-15-2009 08:05 AM

uninstalling old kernel without installing the new one?? which kernel will you use to boot then?actually you dont need to uninstall old kernel for the new one to work.. the only thing to be done is, compile the new kernel, install it, make an initrd for that kernel image and add a new entry in the grub by editing menu.lst..

btw what steps did you follow to install a kernel?

lampamp 09-15-2009 08:13 AM

Quote:

Originally Posted by mobinskariya (Post 3683561)
uninstalling old kernel without installing the new one?? which kernel will you use to boot then?actually you dont need to uninstall old kernel for the new one to work.. the only thing to be done is, compile the new kernel, install it, make an initrd for that kernel image and add a new entry in the grub by editing menu.lst..

btw what steps did you follow to install a kernel?

i installed kmod-nvidia
it automatically installed kernel-2.6.30.5-43.fc11.i586 and an nvidia driver compatible with kernel-2.6.30.5-43.fc11.i586
so because my fedora is still running on the old kernel, my nvidia isnt working correctly.

is there a way to install a kmod-nvidia package which is compatible with 2.6.29.4-167.fc11.i586?

mobinskariya 09-15-2009 08:26 AM

i am totally ignorant about usb booting and i am assuming that it is similar to that of a normal linux. since there was no one replying to you, i am just trying to help you. i dont know anything about the nvdia drivers..maybe try fdisk -l as a root..
please give the output of
Code:

su -
fdisk -l
ls -l /lib/modules/
vim /etc/fstab


lampamp 09-15-2009 08:27 AM

Quote:

Originally Posted by mobinskariya (Post 3683577)
i am totally ignorant about usb booting and i am assuming that it is similar to that of a normal linux. since there was no one replying to you, i am just trying to help you. i dont know anything about the nvdia drivers..maybe try fdisk -l as a root..
please give the output of
Code:

su -
fdisk -l
ls -l /lib/modules/
vim /etc/fstab


output:
Quote:

drwxr-xr-x. 7 root root 4096 2009-06-04 13:07 2.6.29.4-167.fc11.i586
drwxr-xr-x. 7 root root 4096 2009-09-15 16:58 2.6.30.5-43.fc11.i586
thx
i appreciate what ur doing :)

lampamp 09-15-2009 08:33 AM

is there a way to remove a specific kernel? i'll try maybe it work

jschiwal 09-15-2009 05:49 PM

You probably should have mentioned that you are using live usb creator from the beginning. Are you running off a live CD?

You may have lost the new kernel after a reboot. According to a wikipedia article, there is a persistence option. I'm betting this wasn't enabled. You are using isolinux to boot and your system may be using unionfs to overlay new files to a read-only ISO image when the persistence option is enabled.

Is this what you used to install it:
http://en.wikipedia.org/wiki/Fedora_Live_USB_creator

lampamp 09-16-2009 05:42 AM

Quote:

Originally Posted by jschiwal (Post 3684239)
You probably should have mentioned that you are using live usb creator from the beginning. Are you running off a live CD?

You may have lost the new kernel after a reboot. According to a wikipedia article, there is a persistence option. I'm betting this wasn't enabled. You are using isolinux to boot and your system may be using unionfs to overlay new files to a read-only ISO image when the persistence option is enabled.

Is this what you used to install it:
http://en.wikipedia.org/wiki/Fedora_Live_USB_creator

yes i used the live usb creator
but it's not a read only image

i'm trying to update the kernel to use the video card
so i was thinking
is there a way to install a kmod-nvidia package which is compatible with 2.6.29.4-167.fc11.i586?

jschiwal 09-16-2009 07:02 AM

Add the rpmfusion repo. It may have it. Also search on the rpm.fusion.net website. Search on google using "site:pbone.net nvidia 2.6.29.4"

lampamp 09-16-2009 07:07 AM

Quote:

Originally Posted by jschiwal (Post 3684978)
Add the rpmfusion repo. It may have it. Also search on the rpm.fusion.net website. Search on google using "site:pbone.net nvidia 2.6.29.4"

thx i'll try it today


All times are GMT -5. The time now is 07:39 PM.