Announcement

Collapse
No announcement yet.

lost /boot, looking for repair procedure

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    lost /boot, looking for repair procedure

    Hello,

    one of my harddrives broke down and taking along some not so precious windows partitions I also lost my swap partition and a partition where /boot was mounted. The rest of my kubuntu (updated to 8.04) is installed on the other drive. So as I figure all I lost was kernel images and grub.
    Now I'd like to put everything to the working harddrive. I don't expect probs with partitioning but I'd like to keep my kubuntu installation if possible.
    I thought of something like booting from the live CD, correcting /etc/fstab according to , chroot to / on the existing kubuntu install and reinstall/fix/repair broken packages (grub and kernel images). Now I wonder if this will work an how to do the reinstall/fix/repair step.

    Thanks
    Volker

    #2
    Re: lost /boot, looking for repair procedure

    Sounds like you have it down fairly well.
    GParted Live CD to do the partitioning: make swap and a separate /boot partition:
    /boot contains kernel & initrd images at the top level of /boot;
    /boot/grub contains GRUB files (which you will copy from your Kubuntu /boot/grub or from your Kubuntu GRUB image files at /usr/lib/grub/i386-pc).
    In the new menu.lst you need to set the GRUB root statement (groot= statement) to be the new /boot partition.
    I suppose you have kernel & initrd images you can copy into /boot.

    Then install GRUB to the MBR of the first-in-order hard drive set to boot in BIOS and do so using the GRUB files you put in the /boot partition.
    Thus, it will be
    root (hdx,y)
    setup (hd0)
    quit
    where (hdx,y) is the /boot partition, and (hd0) is the first hard drive that is set to boot in BIOS.
    In the following how-to, I show how to do that.
    How To GRUB Methods - Toolkit
    http://kubuntuforums.net/forums/inde...opic=3081671.0
    Reply #14 --- Separate GRUB-boot partition. Recent experience with it. Install Kubuntu 7.04. Two HDDs
    NOTE: This how-to shows how to make a separate GRUB partition, NOT a true full /boot partition, but the installation of GRUB is the same: root—setup--quit.
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Re: lost /boot, looking for repair procedure

      Hi Qqmike,

      sorry to not respond for such a long time, was busy.

      Originally posted by Qqmike
      I suppose you have kernel & initrd images you can copy into /boot.
      In fact I don't really know where to get kernel & initrd images that fit to my setup (i386/AMD Thunderbird). But I suppose it wouldn't be a big problem since I never changed the kubuntu standard install packages or made my own kernel (I'm one of those people that use kubuntu because it just runs and you don't have to do lots of fiddeling around) ;-) .

      Could you or anybody else provide hints for finding the mentioned images and installing these into /boot?

      Something else: I wasn't planning on using a separate /boot partition again but instead using the /boot directory on the one single linux partition.

      Comment


        #4
        Re: lost /boot, looking for repair procedure

        OK, sounds like you are keeping this simple and easier than what I first thought.
        If you didn't touch the Kubuntu, you should already have everything in-place, GRUB, /boot and in /boot you should have the kernel & initrd files.

        So then, all you need to do is to re-install GRUB to the MBR of your (new) first-to-boot drive (as set in BIOS). And you do that with the root, setup, and quit commands (see above post). Sounds like GRUB was set up in the MBR of the drive that failed, and now you have no way of booting into Kubuntu.

        Thus, it will be
        root (hdx,y)
        setup (hd0)
        quit
        where (hdx,y) is the Kubuntu partition, and (hd0) is the first hard drive that is set to boot in BIOS--the one with Kubuntu on it. (You removed the bad hard drive, right?)

        If you have just the one remaining hard drive, then hdx = hd0. The y is the partition Kubuntu is installed to (counting from zero: the first partition is y=0, the second is y=1, etc.).
        You have to do this from a Live Kubuntu CD.
        Then use Konsole (see the how-to).
        sudo grub
        grub> find /boot/grub/menu.lst
        will show you what (hdx,y) is.
        then continue with root, setup, and quit.

        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          Re: lost /boot, looking for repair procedure

          btw, don't hesitate to post back if there's problems.

          I'm not the expert on fstab, but here's my entry (in 8.04) for my swap partition:

          # /dev/sdb5
          UUID=9aetceteraetcetera877 none swap sw 0 0

          (If you have problems setting up this new swap partition, you may have to start a new topic for it so people will see it.)

          Partitioning—how to, Rog131:
          http://kubuntuforums.net/forums/inde...opic=3090704.0


          The GRUB stuff:
          It's likely that your Kubuntu was untouched.
          /boot contains your kernel & initrd files
          /boot/grub contains your GRUB files
          the commands I gave you above (root-setup-quit) will use those files to re-install GRUB to the MBR of your hard drive (called hd0).

          THEN, you will (probably) also have to edit your menu.lst since you now have just the one hard drive hd0. In menu.lst (following the *** Begin Automagic Kernels List line), there are root statements:
          root (hdx,y)
          You need to make sure the hdx is correct in each one.
          (With just the one hard drive, hdx will be hd0.)

          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment


            #6
            Re: lost /boot, looking for repair procedure

            If you have any problem getting the UUID of the newly created swap partition, try this rule:

            UUIDs, listing:
            From Live CD or HD: ls /dev/disk/by-uuid/ -alh
            From HD: blkid

            You'll probably be doing this from a live CD.

            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment

            Working...
            X