LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to get dual boot working (Windows 7 & RHEL5) (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-get-dual-boot-working-windows-7-and-rhel5-4175445039/)

Garrett82 01-10-2013 01:53 PM

Unable to get dual boot working (Windows 7 & RHEL5)
 
Hello

I'm pretty new to linux and was attempting to setup dual boot with Windows 7 (already installed) and RHEL5.8.

I first searched within the forums, but did not come across a thread that matched my exact situation. If anyone has any ideas after reading what I've posted below about how to help me to boot up in Windows 7 again I would be greatly appreciative. Or, if maybe I've overlooked a thread that has what I'm looking for maybe someone could point me in the right direction.

I wanted to install both on the same internal harddrive and used the following steps that I found here to shrink the Windows partition to make room for RHEL5...

I booted up using a CentOS Live DVD and did the following:

Resized the existing Windows parition to 132GB out of a total of 250GB
Code:

[root@livecd ~]# ntfsresize -b --size 135168M /dev/sda1
Recreated partition information and made Windows partition bootable (or so I thought)
Code:

[root@livecd ~]# fdisk /dev/sda

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
  e  extended
  p  primary partition (1-4)
p
Partition number (1-4): 1
First cylinder: 1
Last cylinder or +size or +sizeM or +sizeK: +135168M

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 7
Changed system type of partition 1 to 7 (HPFS/NTFS)

Command (m for help): a
Partition number (1-4): 1

Command (m for help): p
 Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1        17233    138424040+  7  HPFS/NTFS


At this point I believe I should have been able to reboot and still boot into Windows 7, but I could not. I went ahead and installed RHEL5.8. During the installation it mentioned that I could create multiple boot options, but it didn't find anything for Windows. I'm able to boot into RHEL5 and can still see the Windows partition there.

Code:

[root@lab1 grub]# fdisk -l

Disk /dev/sda:250.0GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device  Boot      Start    End    Blocks    Id  System
/dev/sda1      *        1      17233  138424040+    7 HPFS/NTFS
/dev/sda2            17234      17246      104422+  83 Linux
/dev/sda3            17247      30401  105667537+  8e Linux LVM

Here is what I've got in /boot/grub/menu.lst when booted into RHEL
I added the Windows 7...
Code:

[root@lab1 grub]# cat menu.lst
# 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/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=20
splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu
title Windows 7
        rootnoverify (hd0,0)
        makeactive
        chainloader +1
title Red Hat Enterprise Linux Server (2.6.18-308.el5xen)
        root (hd0,1)
        kernel /xen.gz-2.6.18-308.el5 crashkernel=128M@32M
        module /vmlinuz-2.6.18-308.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        module /initrd-2.6.18-308.el5xen.img
title Red Hat Enterprise Linux Server-base (2.6.18-308.el5)
        root (hd0,1)
        kernel /vmlinuz-2.6.18-308.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-308.el5.img

When I attempt to boot into Windows 7 at the boot menu I receive this error:
Code:

Error 13: Invalid or unsupported executable format.
Anyone have an idea of what I might need to do going forward? I'm not even sure if this is a problem with Windows (and I need to maybe run the Windows restore CD to recreate something with the Windows MBR..) or if I might have messed up something or misconfigured something within Linux.

Thanks for any help.

yancek 01-10-2013 06:36 PM

I've not done resizing in the manner suggested at the site you linked to. Your windows entry looks OK as it is on sda1 and your Grub entry for windows points to it. More information on your partitions and boot files would help. Boot Red Hat and go to the site below, read the instructions then download and run the bootinfoscript. It will produce a results.txt file which you can post here.

http://sourceforge.net/projects/bootinfoscript/

Garrett82 01-11-2013 08:09 AM

Thanks for your reply, yancek. This is a computer I have at work and I'm working from home today, so I will be sure to run the bootinfoscript and post output here on Monday morning at the latest.

Garrett82 01-14-2013 06:16 AM

OK, I just ran the bootinfoscript. Here is the output:

Code:

                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================

 => Grub Legacy0.97 is installed in the MBR of /dev/sda and looks at sector
    277038611 on boot drive #1 for the stage2 file.  A stage2 file is at this
    location on /dev/sda.  Stage2 looks on partition #2 for /grub/grub.conf..

sda1: __________________________________________________________________________

    File system:     
    Boot sector type:  -
    Boot sector info:
    Mounting failed:  mount: unknown filesystem type ''

sda2: __________________________________________________________________________

    File system:      ext3
    Boot sector type:  -
    Boot sector info:
    Operating System: 
    Boot files:        /grub/menu.lst /grub/grub.conf

sda3: __________________________________________________________________________

    File system:     
    Boot sector type:  -
    Boot sector info:
    Mounting failed:  mount: unknown filesystem type ''
mount: unknown filesystem type ''

VolGroup00-LogVol00': __________________________________________________________

    File system:     
    Boot sector type:  Unknown
    Boot sector info:
    Mounting failed:  mount: unknown filesystem type ''
mount: unknown filesystem type ''
mount: unknown filesystem type ''

VolGroup00-LogVol01': __________________________________________________________

    File system:     
    Boot sector type:  Unknown
    Boot sector info:
    Mounting failed:  mount: unknown filesystem type ''
mount: unknown filesystem type ''
mount: unknown filesystem type ''
mount: unknown filesystem type ''

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes


Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *            63  276,848,143  276,848,081  7 NTFS / exFAT / HPFS
/dev/sda2        276,848,145  277,056,989      208,845  83 Linux
/dev/sda3        277,056,990  488,392,064  211,335,075  8e Linux LVM


"blkid" output: ________________________________________________________________

Device          UUID                                  TYPE      LABEL

/dev/mapper/VolGroup00-LogVol00 1db9fde3-ae6c-43a5-bf9e-82fa5eca3eb8  ext3     
/dev/mapper/VolGroup00-LogVol01                                        swap     
/dev/sda2        f10c2800-03aa-44d1-944a-5ed1940b2c86  ext3      /boot
/dev/sr0                                                iso9660    RHEL_6.3 i386 Disc 1
/dev/VolGroup00/LogVol00 1db9fde3-ae6c-43a5-bf9e-82fa5eca3eb8  ext3     
/dev/VolGroup00/LogVol01                                        swap     

========================= "ls -R /dev/mapper/" output: =========================

/dev/mapper:
control
VolGroup00-LogVol00
VolGroup00-LogVol01

================================ Mount points: =================================

Device          Mount_Point              Type      Options

/dev/mapper/VolGroup00-LogVol00 /                        ext3      (rw)
/dev/sda2        /boot                    ext3      (rw)


============================= sda2/grub/grub.conf: =============================

--------------------------------------------------------------------------------
# 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/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=20
splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu
title Windows 7
        rootnoverify (hd0,0)
        makeactive
        chainloader +1
title Red Hat Enterprise Linux Server (2.6.18-308.el5xen)
        root (hd0,1)
        kernel /xen.gz-2.6.18-308.el5 crashkernel=128M@32M
        module /vmlinuz-2.6.18-308.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        module /initrd-2.6.18-308.el5xen.img
title Red Hat Enterprise Linux Server-base (2.6.18-308.el5)
        root (hd0,1)
        kernel /vmlinuz-2.6.18-308.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-308.el5.img
--------------------------------------------------------------------------------

=================== sda2: Location of files loaded by Grub: ====================

          GiB - GB            File                                Fragment(s)

            ?? = ??            grub/grub.conf
            ?? = ??            grub/menu.lst
            ?? = ??            grub/stage2
            ?? = ??            initrd-2.6.18-308.el5.img
            ?? = ??            initrd-2.6.18-308.el5kdump.img
            ?? = ??            initrd-2.6.18-308.el5xen.img
            ?? = ??            vmlinuz-2.6.18-308.el5
            ?? = ??            vmlinuz-2.6.18-308.el5xen

======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown BootLoader on VolGroup00-LogVol00'


Unknown BootLoader on VolGroup00-LogVol01'



=============================== StdErr Messages: ===============================

  One or more specified logical volume(s) not found.
  One or more specified logical volume(s) not found.
  One or more specified logical volume(s) not found.
hexdump: /dev/mapper/VolGroup00-LogVol00': No such file or directory
hexdump: stdin: Bad file descriptor.
hexdump: /dev/mapper/VolGroup00-LogVol00': No such file or directory
hexdump: /dev/mapper/VolGroup00-LogVol00': Bad file descriptor
  One or more specified logical volume(s) not found.
  One or more specified logical volume(s) not found.
  One or more specified logical volume(s) not found.
hexdump: /dev/mapper/VolGroup00-LogVol01': No such file or directory
hexdump: stdin: Bad file descriptor.
hexdump: /dev/mapper/VolGroup00-LogVol01': No such file or directory
hexdump: /dev/mapper/VolGroup00-LogVol01': Bad file descriptor
mdadm: No arrays found in config file


Garrett82 01-14-2013 06:26 AM

One other bit of information I failed to mention before that I just thought of...after running the following commands I mentioned in my original post:

Code:

Command (m for help): a
Partition number (1-4): 1

Command (m for help): p

I saw this error mixed in with the output of 'p'

Code:


Partition 1 does not start on physical sector boundary


yancek 01-14-2013 09:43 AM

Your results.txt output shows Red Hat Grub Legacy in the mbr and since you can boot it, that is not part of the problem. The grub.conf entry for windows is correct pointing to the first drive, first partition. You indicate in an earlier post that you can still see the windows files so you might have a problem with the boot files. You could try reinstalling windows boot file to the mbr of the disk. These files are usually not on a Recovery Disk so you will probably need a full installation CD/DVD. You would need to look for the Repair option on the CD/DVD. You would then need to reinstall Grub to the mbr to boot both windows and Red Hat.

There is some information missing from your results.txt output. Usually it shows boot files for windows also and there is nothing in the output. It also shows uuid and /etc/fstab info which is not in your output. If the windows boot files are actually missing for some reason that would obviously be a problem. You could check from Red Hat to see if your windows boot files are where they belong.

Windows 7 has its own software for resizing. I resized a windows 7 partition to install Linux using GParted when I first bought the computer three years ago. I was unable to boot windows but had made a Recovery disk for windows and was able to reset to factory settings. I had no data as it was not a problem. I have read numerous posts of people who have successfully used GParted. I don't know why in the tutorial you referred to they suggest you delete the partition and re-create it. Generally, one would use the 'w' command in fdisk to write the change and reboot.

Your windows boot files may be corrupt?? If you have an installation CD/DVD it should be an easy fix. If not, I would search for repairing windows 7 bootloader. You should find a lot of sites.

Garrett82 01-14-2013 05:28 PM

Thank you! I downloaded a windows install iso today during some downtime at work and will burn it to dvd tomorrow and give some of this a try. I will say, though, that I placed a windows rescue disk in, booted from it and it did not recognize a windows operating system. I'm really hoping the procedures I used did not wipe out my windows drive, but I guess I will just re-install if so. I'll update this thread with attempts to rebuild windows MBR tomorrow.

suicidaleggroll 01-14-2013 05:46 PM

I certainly wouldn't feel warm and fuzzy about deleting and re-creating the partition in fdisk. A much better option, as suggested in that link, is to use Windows's partitioning tools to shrink its own partition. Once you have some available space on the drive, any Linux distro can install to it without a problem.

I can almost guarantee you that your problems are due to the way in which the Windows partition resizing was done ("almost", because I haven't actually tried it myself, but it definitely looks a bit unsettling).

Can you at least mount the Windows partition from within RHEL? If nothing else, you can back up the necessary files to an external drive that way and then use the Windows DVD to re-install.

Garrett82 01-16-2013 08:26 AM

In retrospect I agree 100% that it would have been wiser to have used windows partitioning tools. Ah well. I have been trying to see if I could mount the Windows partition (/dev/sda1)to see if any files remain, but I'm getting the following:

Code:

# mount /dev/sda1 /mnt
mount:  you must specify the filesystem type

# mount -t ntfs /dev/sda1 /mnt
mount:  unknown filesystem type 'ntfs'

I did some searching on those and found some cryptic information about compiling my kernel with ntfs support, but no concrete steps with which to follow in order to achieve being able to mount it..

Code:

# uname -r
2.6.18-348.el5


suicidaleggroll 01-16-2013 08:44 AM

You just need to install the NTFS packages in RHEL. I think it's called ntfs-3g, but you can use "yum list | grep ntfs" to see for sure. Once you find the package name, "yum install package" will install it. Then, as long as the partition isn't corrupt, you should be able to mount it just like you tried above.

jkirchner 01-16-2013 08:45 AM

Quote:

Originally Posted by Garrett82 (Post 4867265)
Hello

Code:

[root@lab1 grub]# fdisk -l

Disk /dev/sda:250.0GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device  Boot      Start    End    Blocks    Id  System
/dev/sda1      *        1      17233  138424040+    7 HPFS/NTFS
/dev/sda2            17234      17246      104422+  83 Linux
/dev/sda3            17247      30401  105667537+  8e Linux LVM


I know when I have installed Windows 7 it sets up 2 partitions, 1 of 100MB or so for boot and then the larger one for the rest of windows. Grub then points to the smaller boot section to boot windows. Unless you installed windows differently you seem to be missing a portion.

Garrett82 01-16-2013 12:36 PM

Thanks, guys. Installed the ntfs-3g package and I might be in trouble...

Code:

# mount -t ntfs /dev/sda1
NTFS signature is missing.
Failed to mount 'dev/sda1': Invalid argument
The device '/dev/sda1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

So, I'm guessing from that output that I've probably wiped out what I had of Windows, which is what I was expecting given the feedback you all have graciously provided.

If that is the case and I need to reinstall Windows, do any of you have a good recommended thread to look at or set of steps to follow for installing Windows on a computer with existing RedHat OS? Or would it be easier to to just start over, install Windows and then reinstall RedHat using preferred procedures? Thanks again for all the help.

yancek 01-16-2013 01:37 PM

You would need to make certain you install windows to sda1. It will overwrite the mbr and you will then need to reinstall Grub to boot both.
You might be able to use EasyBCD from windows but I don't think it is a free download any longer.
Might be easier to reinstall both, windows first.

Garrett82 01-23-2013 06:21 AM

Finally got a chance to try reinstalling Windows7 and thankfully there was an option to install only to sda1. I did this and then reinstalled linux and everything is working great.

Thanks again for the help everyone.


All times are GMT -5. The time now is 10:08 AM.