Page 1 of 10 123 ... LastLast
Results 1 to 10 of 100

Thread: grub can't install, server non bootable

  1. #1
    Join Date
    Feb 2013
    Location
    Paris, France
    Beans
    51
    Distro
    Ubuntu 12.04 Precise Pangolin

    grub can't install, server non bootable

    Hi all,

    First post, first (real stuck-situation-like) problem. I'm not exactly sure what's happening.

    I first installed my ubuntu server (11.10 amd64) using lvm but not fully mastering the concept of it. I think that's partly what made the mess of partitions on my two disks (seems to me). I installed everything using grub2 from the start to boot my Ubuntu, which I updated later to Ubuntu Server 12.04, no problem.

    Here is the situation:

    - As of today, I can't boot at all, stuck with no evolution at what seems to be just before the grub options (Edit: precision from Pavel A.);

    - I can boot using the server install liveCD with option Rescue a broken system;

    - I setup network access, but don't seem to have a /run folders (don't know if it's related but seemed abnormal in some forums);

    - The devices map I built is as follows:

    .VGa contains sda1 [Linux partition], sda2, sda3 [/] and sda5(the latter seems the same as sda3, same descriptors)
    .VGb contains sdc1, sdc2 [/boot] and sdc3 [/home]
    !(I'm about to merge the two VGs into one, but running lvchange -an on my lv hangs also...)

    - Last thing I did to the boot environment was to (cleanly) remove older kernels from the boot partition (236MB large, was 99% full);

    - I ran grub-install (after having mounted boot) but got various errors:

    .can't install on /dev/sdabecause core.imgwon't fit (first partion starts on 32)
    .output of grub-install on /dev/sdc exhibits error physical volume pv0 not found
    .I even tried to grub-install directly to /dev/sda5, apparently with no error, but with no success at boot either

    - tail /var/log/syslog yields no output (blank), no new syslog is created that I can see

    > I looked here [serverfault]: Grub2 reports physical volume pv0 not found when probing/installing
    > I looked here [Ubuntu forums]: [SOLVED] Install kernel with liveCD & fix grub2
    > I looked here [Ubuntu help] : Fixing a Broken System
    > I looked here [ubuntu forums]: [SOLVED] 10.10 Maverick - Grub won't recognize my Windows partition

    None of what I did changed anything to the stuck-boot-situation (I can't define it any better: it just hangs, for minutes and minutes and minutes).
    I hope I've not left out any important detail.

    I used the Boot Repair CD (Ubuntu Secure Remix version) and generated the following report on the state of my boot:

    http://paste.ubuntu.com/1620777


    I have no idea what to do anymore, especially if installing grub doesn't work. I've not lost any data, but as it was a production(-ish) server (i.e. entirely personal), I now strongly feel the need for mirrors (I already set backups but... on the server ).


    Anyway, if any of you geniuses had any idea or lead, that would be a great help.

    Thank you !

    M

  2. #2
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,139
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: grub can't install, server non bootable

    Wow you really did made a mess.

    First thing I see, which might not be critical but you shouldn't have done it, is that it seems you used the disks sdb and sdd for LVM as a whole disk, even though most instructions say to use partitions, not the disk. Like create one single partition on the whole disk and use that as physical device for LVM, not the whole disk device.

    Second, I don't know which partition tool you used, but it left too little space in front of the first partition. Always leave 1MiB space in front of the first partition, or in sectors that is 2048 sectors of 512B each. With parted you can control the start and end of a partition when creating it.

    Even in this situation you should be able to install grub2 on /dev/sdc but only there. And you have to set bios to boot from this disk.

    You can use ubuntu live cd (desktop version) to repair this, it's better to use 12.04 if that's what you have on the server right now. But to repair the bootloader from live mode you need to add the lvm2 package and activate the LVM with:
    Code:
    sudo apt-get install lvm2
    sudo vgchange -ay
    After that all VGs and LVs should be activated.

    You should be able to install grub2 on /dev/sdc with:
    Code:
    sudo mount /dev/binomiale/root /mnt
    sudo grub-install --root-directory=/mnt /dev/sdc
    That should fix it temporarily if the commands above activated the LVM correctly. Don't forget that /dev/sdc needs to be first disk to boot from in bios.

    In any case, you should consider arranging the partitioning better but that might require a new install, so it might be lot of work installing again clean and configuring everything again.

    EDIT PS: I forgot to mention, if /dev/sdc2 is a /boot partition that you had configured and you are using it, you need to mount it too. In the second block of commands above, before running the grub-install command, run also:
    Code:
    sudo mount /dev/sdc2 /mnt/boot
    It is needed for grub2 to install correctly. If you are not using sdc2 as /boot any more, forget about this command.
    Last edited by darkod; February 7th, 2013 at 05:00 PM.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  3. #3
    Join Date
    Feb 2013
    Location
    Paris, France
    Beans
    51
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: grub can't install, server non bootable

    Gee thanks! I'm relieved not to be alone on that one...
    Welcome in my mess, is that what I should say?

    So first:

    - the disks partitioning: I know, when I came to understand enough, that ugly scheme had my eyes wtering, but I know there's not much I can do about it. Though I didn't know about the free-first-1M (thanks!), I think sda1 is just for that and serves no other purpose, or maybe to host some rescue tool or I don't know, can't be mounted or anything so I just leave it alone and try to forget about it. I just want to add that this is all a result of automatic partitioning by the help of the lvm manager, none of this I did myself (as I didn't know what to do at the time).

    I actually used the liveCD to reorganise my two new disks like you suggested.
    I removed them from the lvm,
    made a first partition from 1M to 4G on each (first 1M free)
    Code:
    (parted)mkpart primary ext4 1M 4G
    in case the lone disk needs to be bootable,
    used up the rest of the space to create a data partition that I could add to the volume group
    Code:
    mkpart primary ext4 4G -1s
    then made ext4 partitions in it
    Code:
    mkfs.ext4 /dev/sdb2
    mkfs.ext4 /dev/sdd2
    then integrated those in the main volume group
    Code:
    pvcreate /dev/sdb2
    pvcreate /dev/sdd2
    vgextend binomiale /dev/sdb2
    vgextend binomiale /dev/sdd2
    Last I created a new logical volume for later use
    Code:
    lvcreate -C y -L 1500M -n dat binomiale
    Only issue is I can't seem to mount those, using the path /dev/mapper/binomiale/dat or /dev/binomiale/dat, it keeps asking me for a filesystem type, but I can feed it pretty much anything, I won't get closer to mounting it.
    I'm writing all that for the record, mainly. If you happen to have an idea about that too, I'll say don't hesitate

    - I think I already overinstalled the grub to sdc but to no avail, with the boot partition properly mounted and all, anyway I did it once more, following your specific instructions. I'm still stuck at the same point, no change here: blinking cusror about 4 lines down, just before grub display time, I'd say. And my BIOS seems to detect only one bootable drive as when I wander over the BIOS options, the boot order I can specify only includes one disk, just not sure which one of sda or sdc.
    Maybe it's sda that's detected by the BIOS as bootable, but not sdc ?

  4. #4
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,139
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: grub can't install, server non bootable

    After creating the LV you still need to create a filesystem to use it. Imagine it as standard partition.

    So, you didn't need to do mkfs.ext4 on the physical partitions, I don't know if that can create issues later.

    You only need to create the partitions as LVM Members (in parted set the lvm flag), use pvcreate on them, then extend the VG on them, and that's it.

    So, for using the new LV try first:
    sudo mkfs.ext4 /dev/binomiale/dat

    You will still have to mount it before using it of course.

    I don't know why reinstalling grub2 didn't work. If you post the content of your /etc/fstab we can have a look.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  5. #5
    Join Date
    Feb 2013
    Location
    Paris, France
    Beans
    51
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: grub can't install, server non bootable

    Ok so:

    - OK, great, I finally could create my partitions!) Although I'm also wondering what could be the side-effects of havnig done the same operation in the reverse, I mean I tried to create a fs via the device block descriptor /dev/sdb2, your working solution was to add the partition to the vg before creating a fs through the pv device block descriptor. If I see it correctly, I see there IS a difference, but I don't see WHAT is the difference... Know what I mean? Anyway thanks that worked. Now ultimate operation I'd like to perform is to move the home lv (in c vg) to the binomiale vg (vgmerge needs c/home to be inactive). Only thing is I can't seem to inactivate it, meaning lvchange -an generates no error but lvscan shows it is still active.

    - fstab is like that:

    Code:
    <file system>                <mount point> <type> <options>                  <dump> <pass>
    proc                         /proc         proc   nodev,noexec,nosuid        0      0
    /dev/mapper/binomiale-root   /             ext4   errors=remount-ro          0      1
    # /boot was on /dev/sda2 during installation
    UUID={very long uuid...}     /boot         ext2   defaults                   0      2
    /dev/mapper/c-home           /home         ext4   defaults,usrquota,grpquota 0      2
    /dev/mapper/binomiale-swap_1 none          swap   sw                         0      2
    I checked the UUID (with blkid), it correctly points to the /dev/sdc2 /boot partition.

  6. #6
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,139
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: grub can't install, server non bootable

    I don't think you can move /home while logged in because it uses some parts of your user home folder. I would do that from live mode.

    So now you know that you are using sdc2 as /boot and need to point that out in any grub-install command when run from live mode (from inside the installation you don't need to). If you didn't do this earlier maybe that's why the newly installed grub2 on /dev/sdc didn't work.

    I haven't worked much with LVM yet, so I'm not sure if you want to literary move the home LV to another VG, or to merge both VGs, or you can simply create new LV in binomiale, copy the content of the old home LV and change the fstab. You would need to do that from live mode I guess.

    So, which of that would you like to do? Basically you have three options.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  7. #7
    Join Date
    Feb 2013
    Location
    Paris, France
    Beans
    51
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: grub can't install, server non bootable

    Right I won't be able to do anything to c-home sine even the liveCD seems to have loaded confi files from it. I'll see about it later, but I opted for solution #3. Much simpler.

    So, grub has the high hand there.
    I don't exactly see what you mean by
    you are using sdc2 as /boot and need to point that out in any grub-install command when run from live mode
    any specific command comes to mind? I though that was the point of the --root-directory directive, that somehow used the drive UUID for the reference to the boot drive ?
    I have no good idea as to how to proceed / what to do next.

  8. #8
    Join Date
    Feb 2013
    Location
    Paris, France
    Beans
    51
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: grub can't install, server non bootable

    Actually, BEFORE I figured out the location of /boot, I made a full boot directory (linux images, grub install) under /boot, so that if I don't mount sdc2 under /boot, the /boot directory IS full and should start correctly...

  9. #9
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,139
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: grub can't install, server non bootable

    Quote Originally Posted by meeshkah View Post
    Actually, BEFORE I figured out the location of /boot, I made a full boot directory (linux images, grub install) under /boot, so that if I don't mount sdc2 under /boot, the /boot directory IS full and should start correctly...
    How did you make this new boot folder? Just copied the files in there?

    The grub.cfg will be looking for sdc2 by UUID so simply creating a boot folder won't do. Also, fstab still has the /boot line and it will try to use it.

    Yes, the --root-directory is used to point out the root location but you have to mount /boot before that.

    If you created boot folder in /, first rename it to something like boot.custom. Otherwise it will clash with sdc2 which will try to be /boot.

    Then, the exact commands to try install grub2 on sdc from live mode would be:
    Code:
    sudo apt-get install lvm2
    sudo vgchange -ay
    sudo mount /dev/binomiale/root /mnt
    sudo mv /mnt/boot /mnt/boot.custom #(rename the folder)
    sudo mount /dev/sdc2 /mnt/boot
    sudo grub-install --root-directory=/mnt /dev/sdc
    Make sdc first disk to boot from and it should boot up.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  10. #10
    Join Date
    Feb 2013
    Location
    Paris, France
    Beans
    51
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: grub can't install, server non bootable

    About the boot folder under /boot I juste filled it.

    fstab has the line about the /boot folder but isn't it commented out ?
    I looked for a mention about the location of the /boot folder in grub.cfg but did not see any occurence.

    I was along your line of thought (and already emptied out the /boot folder) so this is what I typed:
    Code:
    sudo vgchange -ay
    sudo mount /dev/binomiale/root /mnt/root
    sudo mount /dev/sdc2 /mnt/root/boot
    sudo grub-install --root-directory=/mnt/root /dev/sdc
    It reported no error and successfully installed. Then it printed ou a device map, after which it said to correct it if inccorect and relaunch grub-install. This is the device map:

    Code:
    (fd0)    /dev/fd0
    (hd0)    /dev/sda
    (hd1)    /dev/sdb
    (hd2)    /dev/sdc
    (hd3)    /dev/sdd
    I shutdown and restarted the server but still no boot, still the same situation as before. So I'm guessing something is wrong:
    - maybe the BIOS is only seeing sda as bootable, so it won't even let me boot on sdc?
    - maybe I should launch the boot-repair tool and use the grub removal option on sda?
    Last edited by meeshkah; February 8th, 2013 at 05:02 PM.

Page 1 of 10 123 ... LastLast

Tags for this Thread

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
  •