[SLL] install/grub problem

Derek Simkowiak dereks at realloc.net
Wed Mar 25 17:32:53 PDT 2009


    First example:

http://josephhall.org/grub_install_hda1.html#2drives

    Here's another example, this time with Windows on the 2nd drive:

http://blog.firetree.net/2005/08/26/duel-boot-windows-with-grub/

    Note, the grub drive and partition lettering is zero-based, as in, 
"hd0,0" instead of "hda1".

    I have attached my grub's menu.lst, from my laptop workstation.  It 
was generated by Ubuntu 8.10.  I have Windows on the first partition of 
my (single) drive.  It's full of comments, including a Windows example, 
so it should get you rolling.  (There are also a lot of Ubuntu-specific 
options at the end, like a memtest, and so on.)

    I've never liked Grub.  Lilo supports a -R option, which could be 
used to easily boot a bunch of Windows workstations into a Linux cluster 
at night.  (The U.W. did this.)  Grub still doesn't support that option.


--Derek


On 03/25/2009 01:25 PM, Paul Franz wrote:
> On Wed, March 25, 2009 11:09 am, Derek Simkowiak wrote:
>   
>>     Your analysis sounds correct.  It sounds like the MBR got
>> overwritten with a bad Grub configuration.
>>     
>
> I restored the system by booting from an old floppy disk with Win 98 stuff on it. Ran
> fdisk /mbr and that worked. Windows complained a little and insisted on running chkdsk
> but that completed and all the original boot options are available.
>
>   
>>     I think you should boot off a rescue CD-ROM.  Then, either recreate
>> the Windows MBR, or else boot off a Linux CD-ROM in "Rescue" mode and
>> just re-install Grub with a corrected configuration.
>>     
>
> I believe this is possible but I don't know how to load windows using grub. I know the
> windows boot loader can chain to grub in order to boot Linux.
>
> One of the problems is now there is grub and grub 2. The current (latter) version has
> little or no documentation.
>
> <http://www.gnu.org/software/grub/grub-2-support.en.html>
>
> Which says the documentation is in the wiki. I didn't see any.
>
> This old article from the Linux Journal is the best I have on grub.
>
> <http://www.linuxjournal.com/article/4622>
>
>   
>>     If you want to re-install the Windows MBR, you can use the CD
>> "Ultimate Boot CD", which is a free download.  It's a cool CD image,
>> with a zillion rescue and testing features.
>>
>>     If you want to re-install Grub, boot with your favorite Linux
>> install CD and go into rescue mode.
>>     
>
> I can do that fine and chroot to /mnt/sysimage then all the grub stuff is in
> /boot/grub as shown in my first post.
>
>
>   
>>     If you have access to an Ubuntu CD-ROM, you can do both.  Here's how
>> to reinstall the Windows MBR using an Ubuntu CD:
>>     
>
> I have one.
>   
>> http://www.arsgeek.com/2008/01/15/how-to-fix-your-windows-mbr-with-an-ubuntu-livecd/
>>
>>     I think the first thing I'd try is just re-installing Grub with a
>> corrected configuration.
>>     
>
> I think the grub configuration in /boot/grub/grub.conf is probably OK. I just need to
> figure out how to get the system to go there. I think the best thing is to use the
> windows boot loader in the root directory of /dev/sda1 to chain to the grub boot
> loader.
>
> I don't know for certain where to write the grub boot loader - I think it should go on
> the boot record of /dev/sdb2, but not sure. Then I use dd to snag the first 512 bytes
> and put them in a file and move the file to the root directory of windows and edit the
> boot.ini file appropriately. I believe I can do that part OK. I just am not at all
> sure about using grub to install on the boot record.
>
> I think it is possible for grub to do some hiding so I should be able to boot the
> second installation of windows as C:\ by adding commands to the grub.conf in
> /dev/hdb2.
>
> Sure could use some guidance.
>
>   
>> --Derek
>>
>> On 03/25/2009 12:29 AM, Paul Franz wrote:
>>     
>>> I could really use some help.
>>>
>>> OK, I have a dual boot working system that has Windows XP on /dev/sda1 and the
>>> remaining half of the disk has Fedora Core 2 on it. I then added another 160 GB
>>> drive
>>> filled with a Windows XP system that was bootable but only used about 20 GB of
>>> space.
>>> I added that drive and it showed up as the F: drive when booting Windows. I ran
>>> defrag
>>> on that drive which took about 30 hours knowing that I'd have enough space available
>>> to install Fedora 10. I was a bit miffed because I had planned on installing on my
>>> own
>>> network from the mounted .iso on a server but the network install never provided me
>>> that option. It after I entered the IP, netmask and gateway. it went into the
>>> install
>>> and resized the windows partition on the second drive. When the intallation finished
>>> and asked for the first boot, I did that and got the black screen. I then booted
>>> from
>>> CD in rescue mode and was given two choices for which Linux system and I chose the
>>> new
>>> one (refused to let me use the old one, claiming too many /boot partitions) and then
>>> did
>>>
>>> chroot /mnt/sysimage.
>>>
>>> What I think happened is that during the install grub overwrote the mbr on /dev/hda.
>>> Notice the last comment line in grub.conf on /dev/hdb2 (/boot/grub.conf) which is
>>>
>>> #boot=/dev/sda
>>>
>>> That tells me it overwrote the mbr on the first drive leaving the system no longer
>>> bootable.
>>>
>>> I think what has to be done is restore the windows xp Master boot record then fix up
>>> grub but I need direction now. However, it may be possible to write a grub record
>>> into
>>> the mbr (/dev/sda) that will work. But I don't know how to get the newest
>>> installation
>>> of Fedora to boot since it starts past cyl 1024 and is not LBA mode. Maybe that
>>> doesn't matter.
>>>
>>> Thanks, help will certainly be appreciated.
>>>
>>>
>>> >From fdisk -l
>>>
>>> Disk /dev/sda: 80.0 GB, 80026361856 bytes
>>> 255 heads, 63 sectors/track, 9729 cylinders
>>> Units = cylinders of 16065 * 512 = 8225280 bytes
>>> Disk identifier: 0x35ba35b9
>>>
>>>    Device Boot      Start         End      Blocks   Id  System
>>> /dev/sda1   *           1        5099    40957686    7  HPFS/NTFS
>>> /dev/sda2            5100        5109       80325   83  Linux
>>> /dev/sda3            5110        5237     1028160   82  Linux swap / Solaris
>>> /dev/sda4            5238        9729    36081990    f  W95 Ext'd (LBA)
>>> /dev/sda5            5238        9729    36081958+  83  Linux
>>>
>>> Disk /dev/sdb: 160.0 GB, 160041885696 bytes
>>> 255 heads, 63 sectors/track, 19457 cylinders
>>> Units = cylinders of 16065 * 512 = 8225280 bytes
>>> Disk identifier: 0xe18ce18c
>>>
>>>    Device Boot      Start         End      Blocks   Id  System
>>> /dev/sdb1   *           1        2805    22528000    7  HPFS/NTFS
>>> /dev/sdb2            2806        2817       96390   83  Linux
>>> /dev/sdb3            2818        2883      530145   82  Linux swap / Solaris
>>> /dev/sdb4            2884       19457   133130655    5  Extended
>>> /dev/sdb5            2884       19457   133130623+  8e  Linux LVM
>>>
>>> Disk /dev/sdc: 31 MB, 31457280 bytes
>>> 16 heads, 32 sectors/track, 120 cylinders
>>> Units = cylinders of 512 * 512 = 262144 bytes
>>> Disk identifier: 0x91f72d24
>>>
>>>    Device Boot      Start         End      Blocks   Id  System
>>> /dev/sdc1   *           1         120       30704    6  FAT16
>>> Partition 1 has different physical/logical endings:
>>>      phys=(118, 15, 32) logical=(119, 15, 32)
>>>
>>> what's mounted - from df: (after booting from rescue and chroot
>>> /mnt/sysimage)
>>>
>>> Filesystem           1K-blocks      Used Available Use% Mounted on
>>> /dev/VolGroup00/LogVol01
>>>                       30655872   3511428  27144444  12% /
>>> /dev/VolGroup00/LogVol00
>>>                      102350000      4256 102345744   1% /home
>>> /dev/sdb2                93327     13670     74838  16% /boot
>>> /dev/sda5             35515412  20826664  12884652  62% /mnt/rowlf
>>> /dev/sda2                77772     11241     62515  16% /mnt/rowlf/boot
>>>
>>> grub.conf in /dev/sda2
>>>
>>> # grub.conf generated by anaconda
>>> #
>>> # Note that you do not have to rerun grub after making changes to this file
>>> # NOTICE:  You have a /boot partition.  This means that
>>> #          all kernel and initrd paths are relative to /boot/, eg.
>>> #          root (hd0,1)
>>> #          kernel /vmlinuz-version ro root=/dev/hda5
>>> #          initrd /initrd-version.img
>>> #boot=/dev/hda2
>>> default=1
>>> timeout=10
>>> splashimage=(hd0,1)/grub/splash.xpm.gz
>>> title Fedora Core (2.6.8-1.521)
>>>         root (hd0,1)
>>>         kernel /vmlinuz-2.6.8-1.521 ro root=LABEL=/
>>>         initrd /initrd-2.6.8-1.521.img
>>> title Fedora Core (2.6.7-1.494.2.2)
>>>         root (hd0,1)
>>>         kernel /vmlinuz-2.6.7-1.494.2.2 ro root=LABEL=/
>>>         initrd /initrd-2.6.7-1.494.2.2.img
>>> title Fedora Core (2.6.6-1.435.2.3)
>>>         root (hd0,1)
>>>         kernel /vmlinuz-2.6.6-1.435.2.3 ro root=LABEL=/
>>>         initrd /initrd-2.6.6-1.435.2.3.img
>>> title Fedora Core (2.6.5-1.358)
>>>         root (hd0,1)
>>>         kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/
>>>         initrd /initrd-2.6.5-1.358.img
>>> title Windows XP
>>>         rootnoverify (hd0,0)
>>>         chainloader +1
>>>
>>> grub.conf in /dev/sdb2
>>>
>>> # grub.conf generated by anaconda
>>> #
>>> # Note that you do not have to rerun grub after making changes to this file
>>> # NOTICE:  You have a /boot partition.  This means that
>>> #          all kernel and initrd paths are relative to /boot/, eg.
>>> #          root (hd1,1)
>>> #          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol01
>>> #          initrd /initrd-version.img
>>> #boot=/dev/sda
>>> default=1
>>> timeout=5
>>> splashimage=(hd1,1)/grub/splash.xpm.gz
>>> hiddenmenu
>>> title Fedora (2.6.27.19-170.2.35.fc10.i686)
>>>         root (hd1,1)
>>>         kernel /vmlinuz-2.6.27.19-170.2.35.fc10.i686 ro
>>> root=UUID=ae36e173-2e60-42d3-bef9-b1ac0de67fae rhgb quiet
>>>         initrd /initrd-2.6.27.19-170.2.35.fc10.i686.img
>>> title Windows XP
>>>         rootnoverify (hd0,0)
>>>         chainloader +1
>>> title Fedora 2 - Rowlf
>>>         rootnoverify (hd0,1)
>>>         chainloader +1
>>>
>>>
>>>
>>>       
>
>
>   

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: menu.lst
Url: http://lists2.linuxjournal.com/pipermail/linux-list/attachments/20090325/1bd03c2f/attachment.bat 


More information about the linux-list mailing list