Results 1 to 21 of 21
  1. #1
    Join Date
    Dec 2001
    Location
    Netherlands
    Posts
    849

    how2check: lilo or grub -- remotely

    Hi,

    How do I determine if the bootloader in the system is lilo or grub when both the config files are present ?


    .
    # experienced Cloud/OpenStack Architect
    #
    # Feel free to PM me for any info or help to build your cloud.

  2. #2
    Good question. Basically when you update your boot loaders config file and write the MBR, then that boot loader takes over. I know that's not the answer you're looking for, but maybe it helps.

    You could always reboot the machine and watch the boot process through a remote console device.

  3. #3
    You could copy the boot sector to a file, using a command like this:

    dd if=/dev/hda of=/tmp/boot-img.mbr bs=512 count=1

    then download that file locally and use dd to write it to a floppy.

    boot off the floppy at your local workstation.

    I haven't tried it yet myself, but ran into the same problem before and thought of doing this to check.

  4. #4
    Join Date
    Aug 2002
    Location
    UK
    Posts
    1,040
    Interesting idea with dd.

    Last time a client asked us to check we got an on-site tech to watch the display output when we rebooted the box remotely
    Robin Balen
    Gyron Internet Ltd - http://gyron.net/
    UK colocation, managed hosting and connectivity services with 100% uptime SLAs

  5. #5
    Join Date
    Nov 2001
    Location
    Ann Arbor, MI
    Posts
    2,979
    I would ask the person who installed it.
    -Mark Adams
    www.bitserve.com - Secure Michigan web hosting for your business.
    Only host still offering a full money back uptime guarantee and prorated refunds.
    Offering advanced server management and security incident response!

  6. #6
    Join Date
    Jan 2001
    Location
    Vienna, Austria
    Posts
    2,531
    Just a question:

    When you do: cat /root/anaconda-ks.cfg | grep bootloader

    and get

    bootloader

    as result, then you are using GRUB, right?

  7. #7
    Join Date
    Aug 2002
    Location
    UK
    Posts
    1,040
    I would ask the person who installed it.

    This person didn't have a clue which was installed
    Robin Balen
    Gyron Internet Ltd - http://gyron.net/
    UK colocation, managed hosting and connectivity services with 100% uptime SLAs

  8. #8
    Join Date
    Nov 2001
    Location
    Ann Arbor, MI
    Posts
    2,979
    Originally posted by Angel78
    When you do: cat /root/anaconda-ks.cfg | grep bootloader

    and get

    bootloader

    as result, then you are using GRUB, right?
    That seems like a good way to tell, if that file is there.
    I would just do a less on the file though, it's not like it's that long. It should indicate whether you specified a different bootloader. Smart thinking.
    -Mark Adams
    www.bitserve.com - Secure Michigan web hosting for your business.
    Only host still offering a full money back uptime guarantee and prorated refunds.
    Offering advanced server management and security incident response!

  9. #9
    Lets play devils advocate


    Why does it matter?

    I use LiLo. It rules.

    You can test a new kernel without fear of hosing your system that is 1500 miles away:

    lilo -R <new_image_name>

    Try that with grub! Mffff!
    "The only difference between a poor person and a rich person is what they do in their spare time."
    "If youth is wasted on the young, then retirement is wasted on the old"

  10. #10
    Join Date
    Jul 2001
    Location
    /dev/null
    Posts
    1,219
    But with grub you can define a fall-back kernel (the last working one for example) in the grub conf. This one would boot if there would be a problem with the current one for whatever reason. As far as I know this doesn't work with lilo.

  11. #11
    Join Date
    Dec 2001
    Location
    Netherlands
    Posts
    849
    Thank you all for responding.


    This is not a kernel upgrade issue, but just a question that someone asked me [to check my admin skills I guess, which in turn, all yours for this particular one.. ]

    [b]cat /root/anaconda-ks.cfg | grep bootloader


    bootloader
    bootloader --useLilo



    Is this the result of which it was at boot time, or at the current.
    err.. what exactly am I looking at ?

    The question is to tell him what bootloader will be used on his next reboot.

    still waiting for that magic answer...


    Last edited by admin0; 06-19-2003 at 02:38 AM.
    .
    # experienced Cloud/OpenStack Architect
    #
    # Feel free to PM me for any info or help to build your cloud.

  12. #12
    Use the dd method I suggested earlier - that will tell what is currently installed on the mbr, which will be the one that will be used on next boot.

    Checking the anaconda-ks.cfg file just tells you what got installed. Your's looks like it was told to use Lilo - but that could have been changed.

  13. #13
    Lilo ALSO can use a "fallback" kernel.

    Lilo -R <kernel image>

    That kernel will ONLY be loaded at next boot. Therefore lets say your kernel is built wrong, you messed up, whatever. Cal the DC and ask for a hard reboot, and it will reboot with your ORIGINAL kernel in place.
    "The only difference between a poor person and a rich person is what they do in their spare time."
    "If youth is wasted on the young, then retirement is wasted on the old"

  14. #14
    Join Date
    Apr 2002
    Location
    Cornfield
    Posts
    131
    Check the current running kernel with
    uname -a
    Check both config files - see which one (LILO or GRUB) has the correct kernel listed as default boot. If BOTH do - screw it. Run lilo -v, then tell the customer they use LILO.
    Fire extinguisher extraordinare
    -------------------------------
    FastServers.Net NOC Admin

  15. #15
    Join Date
    Dec 2001
    Location
    QLD, Australia
    Posts
    285
    Hey there,

    To identify if you're using lilo or grub.

    1) dd if=/dev/hda of=/tmp/boot.img bs=512 count=1
    2) cat /tmp/boot.img

    It's lilo if it has something about "Missing io.sys". It's GRUB if it mentions GRUB.

    Stuart
    Biza•io - Digital Wealth Management
    The Blockchain Wallet - Multi Crypto Wallet

  16. #16
    It works Stuart the man
    ••• Like us on Facebook to qualify for discounts! •••
    ••• http://www.sprintserve.net •••
    ••• Offering: | Internap FCP Bandwidth! | Rebootless Kernel Updates! | Magento Optimized Hosting | Wordpress Hosting | •••
    ••• Services: | Managed Multiple Cores 64bit Servers | Server Management | •••

  17. #17
    Yeah Stuart - that's good, saves a step (and a big doh!).

    But cat corrupted my terminal.

    strings /tmp/boot.img is nicer.

  18. #18
    Join Date
    Nov 2001
    Location
    Ann Arbor, MI
    Posts
    2,979
    I'll give stuart 35% credit and heyzuess 65% credit for that one.

    Though in theory, looking at the kickstart file would have worked in many circumstances.

    Heyzuess's idea started out good, but then I was thinking, "and put it on a floppy and boot from it"? That's just too hard. Which is why I initiallly disregarded his or her idea.

    EDIT: WWIT?
    Last edited by bitserve; 06-20-2003 at 12:31 AM.
    -Mark Adams
    www.bitserve.com - Secure Michigan web hosting for your business.
    Only host still offering a full money back uptime guarantee and prorated refunds.
    Offering advanced server management and security incident response!

  19. #19
    Join Date
    Dec 2001
    Location
    QLD, Australia
    Posts
    285
    Originally posted by heyzuess
    Yeah Stuart - that's good, saves a step (and a big doh!).

    But cat corrupted my terminal.

    strings /tmp/boot.img is nicer.
    That's interesting. I had no problems when pulling up an SSH session within an xterm.

    Were you using Windows at the time?

    Stuart
    Biza•io - Digital Wealth Management
    The Blockchain Wallet - Multi Crypto Wallet

  20. #20
    No, a gnome-terminal on the local box (not ssh'd into anywhere) so it's not too big of a deal - mother always said not to cat binary files....

    I always seem to go about things the odd way - but it was a recycled tip anyways.

    Everyone gets 1000 points!

  21. #21
    Ctrl-V, Escape, C, Enter.

    That should reset your terminal if you've garbled it.

    Regards,

    Robert.

Posting Permissions

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