[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What's the easiest way for a shell script to tell if grub version 1 is installed?



On 07/01/2010 01:30 PM, Stephen Powell wrote:
What's the easiest way for a shell script to tell if grub version 1
is installed?  It is important to distinguish grub version 1 from
grub version 2.  For example, can I just do this?

if [ -f /boot/grub/menu.lst ];then
    blah
    blah
    blah
fi

Or does that file exist in grub version 2 as well?  I don't have
grub version 2 installed on any of my machines; so I can't easily
determine this.


Maybe there are magic numbers in the MBR? dd the first few KB of the device into a data file and look at it with a binary editor.

# dd if=/dev/sda of=first_blocks.dat count=8
# bvi first_blocks.dat

--
Seek truth from facts.


Reply to: