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



All times are GMT -5. The time now is 08:00 PM.