Find the answer to your Linux question:
Results 1 to 5 of 5
I've been working on a server that I have managed to royally screw up. Long story short, my kernel was upgraded and needed to be downgraded. When I used rug ...
  1. #1
    Just Joined!
    Join Date
    Nov 2008
    Posts
    2

    Question Is There Any Help for an Id10t?

    I've been working on a server that I have managed to royally screw up. Long story short, my kernel was upgraded and needed to be downgraded. When I used rug to uninstall the package, I had it in my mind that the most recent version would be uninstalled, so I rebooted. As a result, I could not boot my partition because... surprise, surprise, no kernel. In an effort to recover, I loaded my DVD in rescue mode. My CD was /media/cdrom and my partition (/dev/sda3) was /mnt. I entered the following command from /media/cdrom:

    Code:
    cp kernel-version.rpm /dev/sda3
    Once that completed, I can no longer access my partition. Should I have used cp file /dev/sda3/? Am I completely dead now?

    Any help is appreciated, I feel like a huge 0 right now.

  2. #2
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    2,941
    The drive partition /dev/sda3 should be mounted somewhere in your filesystem eg /mnt. Type
    Code:
    mount
    and it should return information on current mounted partitions etc. example output
    Code:
    /dev/hda11 on /media/hda11 type ext3 (rw)
    On this machine I have hda11 as root for my openSUSE10.3 install. For this the boot folder contents are ...

    Code:
    jonathan-user@jonathan-desktop ~ $ ls /media/hda11/boot -l
    total 9704
    -rw------- 1 root root     512 2007-12-30 15:05 backup_mbr
    lrwxrwxrwx 1 root root       1 2007-12-30 14:18 boot -> .
    -rw-r--r-- 1 root root   80417 2008-10-16 17:08 config-2.6.22.19-0.1-default
    drwxr-xr-x 2 root root    4096 2008-11-09 00:18 grub
    lrwxrwxrwx 1 root root      28 2008-11-09 00:18 initrd -> initrd-2.6.22.19-0.1-default
    -rw-r--r-- 1 root root 4205527 2008-11-09 00:18 initrd-2.6.22.19-0.1-default
    -rw-r--r-- 1 root root  389120 2007-12-31 21:32 message
    -rw-r--r-- 1 root root  100317 2008-10-16 17:09 symsets-2.6.22.19-0.1-default.tar.gz
    -rw-r--r-- 1 root root  400576 2008-10-16 17:09 symtypes-2.6.22.19-0.1-default.gz
    -rw-r--r-- 1 root root  116297 2008-10-16 17:09 symvers-2.6.22.19-0.1-default.gz
    -rw-r--r-- 1 root root  843572 2008-10-16 17:05 System.map-2.6.22.19-0.1-default
    -rwxr-xr-x 1 root root 2147452 2008-10-16 17:08 vmlinux-2.6.22.19-0.1-default.gz
    lrwxrwxrwx 1 root root      29 2008-11-09 00:17 vmlinuz -> vmlinuz-2.6.22.19-0.1-default
    -rw-r--r-- 1 root root 1593900 2008-10-16 17:05 vmlinuz-2.6.22.19-0.1-default
    jonathan-user@jonathan-desktop ~ $
    Lets say I had a copy of the kernel at /media/cdrom then I would use
    Code:
    cp /media/cdrom/vmlinuz-2.6.22.19-0.1-default /media/hda11/boot
    to copy it to the correct location. You can get additional help on cp by typing
    Code:
    man cp
    .
    The .rpm file is not the kernel image ... its used by a package manager ... see here

    There should be some sort of safe recovery option to get the system to work again ... I suggest you use that rather than trying to copy individual files. Hope this helps ... you can also try the openSUSE website for help recovering a system for the version you are using.

  3. #3
    Just Joined!
    Join Date
    Nov 2008
    Posts
    2
    Thanks for your reply. I'm aware that the rpm is not the kernel - I need to reinstall the kernel package, which is why I was interested in the rpm. I'm also aware of how to read the man page for cp, but thanks. The partition is not mounted, but when I attempt to access it, and the reinstall portion of the CD says that there is no valid Linux install, so I'm pretty sure I'm screwed.

  4. #4
    Just Joined!
    Join Date
    Apr 2007
    Posts
    93
    The first advice, which is too late now, is that you should have made a "rescue" disk. That would have had the kernel and a copy of the file system, so you could re-install it.

    What you need to do now is boot a "Live CD" version of a Linux OS, and unpack the one file to a local directory. RPM has that ability. I do not remember the command, but you should be able to find it all out, either on the Live CD or online.

    Then you need to mount "/boot" and then copy the kernel by hand and re-write whatever your boot loader references (usually for grub it it "menu.lst" or "grub.conf").

    The only starting information I can tell you is that if you use an OpenSuSE LiveCD, in their default mode, they do not mount the real disc partitions. They only mount their RAM disc parititions. I do not know offhand how hard it would be to mount the real HD partitions.

  5. #5
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    2,941
    First gain root access
    Code:
    su -
    then list drive partitions with
    Code:
    fdisk -l
    next make a folder to mount the partition to
    Code:
    mkdir /manmount
    lets say you want to mount sda3 to /manmount then
    Code:
    mount /dev/sda3 /manmount
    That will mount the partition so
    Code:
    ls /manmount
    will show information on that partition. You can try to fix this by replacing relevant files and updating system configuration for example the grub menu.lst but I would use the recovery utility to fix something like a deleted kernel. You could also try copying the kernel and initrd from the live CD/DVD rather than trying to extract the kernel from an rpm.
    btw after you mount the partition double check if you have a kernel image already ... it may be that you have an old version of the kernel available and you just need to update grub to start it.

Posting Permissions

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