Results 1 to 10 of 12

Thread: i delete all kernels !! cant boot !!

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Beans
    40
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: i delete all kernels !! cant boot !!

    there is no way to install kernel from Live CD ?

    my /boot is in dev/sda6 and / on dev/sda2

  2. #2
    Join Date
    May 2007
    Location
    East Yorkshire, England
    Beans
    Hidden!

    Re: i delete all kernels !! cant boot !!

    If you mount all of your HDD partitions you can chroot in and reinstall the kernel (or any package) that way:

    Code:
    mkdir /mnt/root
    mount /dev/sda2 /mnt/root
    mount /dev/sda6 /mnt/root/boot
    mount --bind /dev /mnt/root/dev
    mount --bind /proc /mnt/root/proc
    mount --bind /sys /mnt/root/sys
    chroot /mnt/root
    apt-get install [whatever]
    Website | Blog | The Arch Hurd Project

    If you want to ask about something I posted, send a PM, as I don't watch many threads

  3. #3
    Join Date
    Mar 2008
    Beans
    40
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: i delete all kernels !! cant boot !!

    Quote Originally Posted by Barrucadu View Post
    If you mount all of your HDD partitions you can chroot in and reinstall the kernel (or any package) that way:

    Code:
    mkdir /mnt/root
    mount /dev/sda2 /mnt/root
    mount /dev/sda6 /mnt/root/boot
    mount --bind /dev /mnt/root/dev
    mount --bind /proc /mnt/root/proc
    mount --bind /sys /mnt/root/sys
    chroot /mnt/root
    apt-get install [whatever]
    Code:
    root@ubuntu:/# apt-get install linux-image
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      linux-tools-common
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
      linux-image-2.6.32-22-generic linux-image-generic
    Suggested packages:
      fdutils linux-doc-2.6.32 linux-source-2.6.32 linux-tools
    The following NEW packages will be installed:
      linux-image linux-image-2.6.32-22-generic linux-image-generic
    0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
    Need to get 30.9MB of archives.
    After this operation, 97.0MB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    WARNING: The following packages cannot be authenticated!
      linux-image-2.6.32-22-generic linux-image-generic linux-image
    Install these packages without verification [y/N]? y
    Err http://archive.ubuntu.com/ubuntu/ lucid-updates/main linux-image-2.6.32-22-generic 2.6.32-22.36
      Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)
    Err http://security.ubuntu.com/ubuntu/ lucid-security/main linux-image-2.6.32-22-generic 2.6.32-22.36
      Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    Err http://security.ubuntu.com/ubuntu/ lucid-security/main linux-image-generic 2.6.32.22.23
      Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    Err http://security.ubuntu.com/ubuntu/ lucid-security/main linux-image 2.6.32.22.23
      Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-image-2.6.32-22-generic_2.6.32-22.36_i386.deb  Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux-meta/linux-image-generic_2.6.32.22.23_i386.deb  Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux-meta/linux-image_2.6.32.22.23_i386.deb  Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
    root@ubuntu:/#

  4. #4
    Join Date
    May 2007
    Location
    East Yorkshire, England
    Beans
    Hidden!

    Re: i delete all kernels !! cant boot !!

    Hmm, weird, never had networking fail in a chroot before. Download the debs and install them manually.

    edit: aha! I guess you use DHCP, and so your /etc/resolv.conf file in the chroot is empty. If it is, just stick the entries for OpenDNS in there so you can resolve hostnames:

    /etc/resolv.conf
    Code:
    nameserver 208.67.222.222
    nameserver 208.67.220.220
    Or just download the debs manually, both should work.
    Website | Blog | The Arch Hurd Project

    If you want to ask about something I posted, send a PM, as I don't watch many threads

  5. #5
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: i delete all kernels !! cant boot !!

    Quote Originally Posted by Barrucadu View Post
    Hmm, weird, never had networking fail in a chroot before. Download the debs and install them manually.

    edit: aha! I guess you use DHCP, and so your /etc/resolv.conf file in the chroot is empty. If it is, just stick the entries for OpenDNS in there so you can resolve hostnames:

    /etc/resolv.conf
    Code:
    nameserver 208.67.222.222
    nameserver 208.67.220.220
    Or just download the debs manually, both should work.
    I usually just bind the resolv.conf file. e.g.
    Code:
    mount --bind /etc/resolv.conf /mnt/root/etc/resolv.conf
    Here is the script I use to chroot into Ubuntu:
    Code:
    #!/bin/bash
    
    ############################################################################
    # variables                                                                #
    ############################################################################
    
    # device name of the root partition
    ROOT="/dev/sda1"
    
    # mount point of the new root partition
    MOUNT="/mnt/maverick"
    
    # list of virtual filesystems and additional config files
    ARGS="dev dev/pts proc sys etc/resolv.conf"
    
    # list of additional devices and their mount pont. 
    # device names must be separated by the mount point with a colon (:)
    # e.g. /dev/sda2:/home or /dev/sda5:/boot
     
    AMOUNT=""
    
    # user name
    UNAME="sisco"
    
    ############################################################################
    # start the chroot environment                                             #
    ############################################################################
    
    # add user to the list of allowed users to make connections to the X server.
    sudo -u $USER xhost SI:localuser:$UNAME
    
    # create the mount point & mount the root partition
    mkdir -p $MOUNT
    mount $ROOT $MOUNT
    
    # mount the virtual filesystems & resolv.conf to enable the network
    for i in $ARGS; do
      mount --bind /$i $MOUNT/$i
    done 
    
    # mount additional partitions:
    for i in $AMOUNT; do
      mkdir -p ${MOUNT}${i//*:/}
      mount ${i//:*/} ${MOUNT}${i//*:/}
    done
    
    # chroot into the linux installation
    chroot $MOUNT su - $UNAME

  6. #6
    Join Date
    Mar 2008
    Beans
    40
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: i delete all kernels !! cant boot !!

    @Barrucadu, thnaks alot !!

    @sisco311, thanks your script is very useful

    thnaks every body .. now every thing playing as well

  7. #7
    Join Date
    Oct 2008
    Beans
    551
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: i delete all kernels !! cant boot !!

    Good luck on your exam!
    Happily running 13.04! "It's only an apt-get away!"

  8. #8
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: i delete all kernels !! cant boot !!

    Quote Originally Posted by alz3abi View Post
    @Barrucadu, thnaks alot !!

    @sisco311, thanks your script is very useful

    thnaks every body .. now every thing playing as well
    You're welcome!


    Please mark this thread as [SOLVED].

    At the top of the page, click the "Thread Tools" Menu and then "Mark this thread as Solved".

    Thanks.

    Oh, and best of luck in your exam!

Bookmarks

Posting Permissions

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