Author Topic: EFI on a Windows 7 PC?  (Read 1324 times)

Offline littlenoodles

  • Full Member
  • ***
  • Posts: 68
EFI on a Windows 7 PC?
« on: January 13, 2013, 03:04:03 PM »
I just bought a new PC (hp p7-1380t), and specifically got one with Windows 7 instead of Windows 8, thinking I'd avoid the UEFI secure boot issues.  Apparently it's not that easy.
The drive seems to be set up for EFI boot, though secure boot doesn't seem to be enabled.  I can boot live linux CD's okay.  But the thing seems to be partitioned a little funny.

fdisk gives the following warning:
Quote
    WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
and reports a single partition
     /dev/sda1               1  1953525167   976762583+  ee  GPT
parted reports:
Quote
parted) print                                                           
Model: ATA Hitachi HDS72101 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  106MB   105MB   fat32        EFI system partition          boot
 2      106MB   240MB   134MB                Microsoft reserved partition  msftres
 3      240MB   989GB   989GB   ntfs         Basic data partition
 4      989GB   1000GB  10.9GB  ntfs         Basic data partition

Before I attempt to install pclos on this thing, I need to verifty that it'll work.  Some questions:
1. That 10.9GB partition at the end seems to be the HP 'recovery' partition.  If I were able to shringk the big Windows partition (3) and insert some linux partitions between (3) and (4), will that mess up the HP recovery?
2. I pulled the hard drive out of my old pclos system and installed it as a secondary SATA drive (in the last SATA port - sata3 - on my motherboard).  I had planned to copy all my files from there to the new drive and then use it as a backup drive going forward.  Windows sees this drive (mounts its NTFS partition as drive F:), but linux doesn't see it at all (there is a /dev/sda, but no others - if I plug in a flash drive, that shows up as /dev/sdf).  Is there something I have to do in the BIOS to make this visible to linux?

Thanks,
Rob

Offline gandy

  • Hero Member
  • *****
  • Posts: 1173
Re: EFI on a Windows 7 PC?
« Reply #1 on: January 13, 2013, 03:29:47 PM »
I think your first step would be to make a set of recovery discs with Win 7. The rest is beyond my expertise. I'm sure someone will come along with more help.
For me, it is far better to grasp the Universe as it really is than to persist in delusion, however satisfying and reassuring. –
Carl Sagan

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11538
  • ----IOFLU----
Re: EFI on a Windows 7 PC?
« Reply #2 on: January 13, 2013, 06:13:20 PM »
littlenoodles :

Before making any recommendations, I have a few questions.

1. Does the new computer support USB 3.0 connections, and how many?

2. Does it have SATA 3 6Gb/s internal connection ports?

3. Does it have eSATA external ports?

4. What CPU?

5. On board GPU or add in graphics card, and specifically what chipset?

6. PSU size, in Watts?

7. Amount of RAM... number of DIMM slots.

8. Do you currently have any SATA to USB or eSATA external hard drive cases?

I looked at the HP site, and this model has numerous options concerning the above. I just want to know exactly what your specific machine contains by way of hardware. I'm assuming a YES for the first two questions, but want confirmation.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline littlenoodles

  • Full Member
  • ***
  • Posts: 68
Re: EFI on a Windows 7 PC?
« Reply #3 on: January 14, 2013, 09:04:38 AM »
Before making any recommendations, I have a few questions.

1. Does the new computer support USB 3.0 connections, and how many?
    yes - 2 on the front panel

2. Does it have SATA 3 6Gb/s internal connection ports?
    don't know about 3.6Gb/s, but yes, it has 2 free SATA internal connection ports.  Odd behavior there.
    It came with the hard drive in SATA0 and DVD/ROM in SATA2.
    When I plug the old drive into SATA1, Linux sees it, but I can't boot Windows.  EFI boot loads the grub bootloader from the old drive - which won't boot PCLOS, presumably because the disks are not in the order grub expects.  Haven't tried to boot the XP partition on the old drive from GRUB - too scary.  This is all pretty weird, no?  The new drive is still SATA0 - why would EFI try to boot off of SATA1 just because it's there?  If I try to 'legacy boot' off of SATA0, it doesn't see an OS at all.  There's an EFI setup utility in the BIOS that seems to show the root directories of the first partition on each drive - I'm afraid to explore beyond that...
    When I plug my old drive into SATA3, Windows boots and sees it as drive F:, but Linux (live CD) doesn't see it at all.  The BIOS doesn't see it either.  I don't see any options in the BIOS setup that would allow me to force it to see the drive as SATA3.
    Catch-22?
    I can 'legacy boot' live CD's from SATA2 with the old hard drive in either SATA1 or SATA3.

3. Does it have eSATA external ports?
    Don't think so.

4. What CPU?
    i5-2330, I think  (definitely i5, just not sure about the specific model - but it's the lowest-level one offered for the p7-1380t.

5. On board GPU or add in graphics card, and specifically what chipset?
    On board Intel HD2500

6. PSU size, in Watts?
    don't know

7. Amount of RAM... number of DIMM slots.
    2 DIMM slots - both full.  I think there are 6GB, but maybe only 4.  Windows 7 is the 64-bit version.

8. Do you currently have any SATA to USB or eSATA external hard drive cases?
    No.

One other oddity - the integrated graphics has 2 DVI connectors and nothing else.  The computer came with a DVI-to-VGA adapter, which I used to plug in my 23" 1920x1080 monitor (no DVI cable handy).  This 'works', except that Windows and Linux can't identify the monitor.  Windows still let me manually set the resolution to 1920x1080.  Ubu12.10 does not.  Mageia let me set it manually on the live CD, but won't apply it till I reboot - but I can restart X, and at that point xrandr lets me set the resolution, and it works.  I assume PCLOS will behave like Mageia - my PCLOS live CD is scratched and I've yet to make a new one.  Anyway, I think a DVI cable will solve that, but if you know the definitive answer...   Also, when I power down the PC, the monitor doesn't sleep - it keeps displaying a 'no VGA cable found' message.

Thanks for your help,
Rob

Offline littlenoodles

  • Full Member
  • ***
  • Posts: 68
Re: EFI on a Windows 7 PC?
« Reply #4 on: January 14, 2013, 09:11:01 AM »
By the way, I assume that if and when I get my SATA drive configuration worked out, I'll need to install the PCLOS grub bootloader in the PCLOS root partition and then use EasyBCD to tell the Windows loader about it.  I used to prefer installing grub in the MBR and make Linux the default, but I guess that's off the table in EFI land.  And I'm guessing that PCLOS doesn't handle native EFI installation yet.  True?

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11538
  • ----IOFLU----
Re: EFI on a Windows 7 PC?
« Reply #5 on: January 14, 2013, 08:07:10 PM »
Before making any recommendations, I have a few questions.

1. Does the new computer support USB 3.0 connections, and how many?
    yes - 2 on the front panel

2. Does it have SATA 3 6Gb/s internal connection ports?
    don't know about 3.6Gb/s, but yes, it has 2 free SATA internal connection ports.  Odd behavior there.
    It came with the hard drive in SATA0 and DVD/ROM in SATA2.
    When I plug the old drive into SATA1, Linux sees it, but I can't boot Windows.  EFI boot loads the grub bootloader from the old drive - which won't boot PCLOS, presumably because the disks are not in the order grub expects.  Haven't tried to boot the XP partition on the old drive from GRUB - too scary.  This is all pretty weird, no?  The new drive is still SATA0 - why would EFI try to boot off of SATA1 just because it's there?  If I try to 'legacy boot' off of SATA0, it doesn't see an OS at all.  There's an EFI setup utility in the BIOS that seems to show the root directories of the first partition on each drive - I'm afraid to explore beyond that...
    When I plug my old drive into SATA3, Windows boots and sees it as drive F:, but Linux (live CD) doesn't see it at all.  The BIOS doesn't see it either.  I don't see any options in the BIOS setup that would allow me to force it to see the drive as SATA3.
    Catch-22?
    I can 'legacy boot' live CD's from SATA2 with the old hard drive in either SATA1 or SATA3.

3. Does it have eSATA external ports?
    Don't think so.

4. What CPU?
    i5-2330, I think  (definitely i5, just not sure about the specific model - but it's the lowest-level one offered for the p7-1380t.

5. On board GPU or add in graphics card, and specifically what chipset?
    On board Intel HD2500

6. PSU size, in Watts?
    don't know

7. Amount of RAM... number of DIMM slots.
    2 DIMM slots - both full.  I think there are 6GB, but maybe only 4.  Windows 7 is the 64-bit version.

8. Do you currently have any SATA to USB or eSATA external hard drive cases?
    No.

One other oddity - the integrated graphics has 2 DVI connectors and nothing else.  The computer came with a DVI-to-VGA adapter, which I used to plug in my 23" 1920x1080 monitor (no DVI cable handy).  This 'works', except that Windows and Linux can't identify the monitor.  Windows still let me manually set the resolution to 1920x1080.  Ubu12.10 does not.  Mageia let me set it manually on the live CD, but won't apply it till I reboot - but I can restart X, and at that point xrandr lets me set the resolution, and it works.  I assume PCLOS will behave like Mageia - my PCLOS live CD is scratched and I've yet to make a new one.  Anyway, I think a DVI cable will solve that, but if you know the definitive answer...   Also, when I power down the PC, the monitor doesn't sleep - it keeps displaying a 'no VGA cable found' message.

Thanks for your help,
Rob

Have you tried plugging the old drive, with grub in the MBR, into the SATA0 port, and the drive that came with the computer into the SATA1 port? If you can then boot PCLinuxOS we have a good starting point from which to get Windows to boot.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: EFI on a Windows 7 PC?
« Reply #6 on: January 14, 2013, 09:18:08 PM »
I have a Windows 7 laptop with EFI and secure boot disabled.
It dual boots using GRUB on MBR just fine. I guess the problem will arise when secure boot is enabled. For now, you should be good.

And inside the Windows bootloader, I have setup an option using EasyBCD to boot PCLinuxOS. There were some reports of Windows update removing GRUB or something like that.

I do not know about GPT.
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline littlenoodles

  • Full Member
  • ***
  • Posts: 68
Re: EFI on a Windows 7 PC?
« Reply #7 on: January 15, 2013, 09:12:36 AM »
Quote
And inside the Windows bootloader, I have setup an option using EasyBCD to boot PCLinuxOS. There were some reports of Windows update removing GRUB or something like that.

I do not know about GPT.
Yeah, I think the windows bootloader is the culprit.  I installed EasyBCD and took a look at the boot menu settings for the windows boot loader.  Windows 7 is the last item in the list (though the only one with a check mark).  There's a generic 'hard drive' entry above the Windows 7 C: drive entry, and I'm thinking that that entry gets resolved at boot time and is what's picking up the SATA1 drive.  Didn't get a chance to try it, but I'm planning on moving the W7 entry to come before 'hard drive' to see if that solves the problem.

In any case, the new disk is set up for GPT, and I don't want to convert it to MBR - I don't know how to do that, and I think that might screw up other stuff.  It looks like EasyBCD is the way to go, and as long as the PCLOS installer is GPT-aware enough to shrink the Windows 7 partition to make room for some linux parititions, I ought to be okay with installing grub in the PCLOS root partition and letting EasyBCD take care of the rest.  It looks like the PCLOS partition tool understands GPT enough to do that - at least it shows me everything that's there and offers to resize and add partitions.  If anybody can verify that my dual-boot plan (once I get the SATA1-3 issue resolved) will work, I'd appreciate it.  Boy, this used to be easy...

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: EFI on a Windows 7 PC?
« Reply #8 on: January 15, 2013, 09:43:55 AM »
I am not sure about GPT support.
For shrinking of Windows partition, my advise is to do it from within Windows. Disable System Restore first, then do a full defragmentation then use Windows in-built disk management utility to shrink the partition and then re-enable System Restore. Since it is an OS bearing partition, it is always better to let Windows do it.
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline littlenoodles

  • Full Member
  • ***
  • Posts: 68
Re: EFI on a Windows 7 PC?
« Reply #9 on: January 16, 2013, 11:23:45 AM »
I am not sure about GPT support.
For shrinking of Windows partition, my advise is to do it from within Windows. Disable System Restore first, then do a full defragmentation then use Windows in-built disk management utility to shrink the partition and then re-enable System Restore. Since it is an OS bearing partition, it is always better to let Windows do it.
By 'Disable System Restore', are you talking about some facility in Windows 7 that remembers the 'last good configuration' or something and not the HP 'Restore' partition?  If so, how is that done (I've been living in Linux land too long)?  Also, if I leave the HP restore partition alone (it's at the top of the disk), will it continue to work after rejiggering the other partitions?  I think that's one of the advantages of EFI - partitions are accessed by name (or GUID), not by relative position.

Offline littlenoodles

  • Full Member
  • ***
  • Posts: 68
Re: EFI on a Windows 7 PC?
« Reply #10 on: January 16, 2013, 11:29:18 AM »
Have you tried plugging the old drive, with grub in the MBR, into the SATA0 port, and the drive that came with the computer into the SATA1 port? If you can then boot PCLinuxOS we have a good starting point from which to get Windows to boot.
Don't want to sound overly skeptical, how's PCLinuxOS going to help me solve my Windows boot problems?  I'm a little afraid to mess with the SATA0 drive until I've figured out the windows boot problems - chicken and egg, I know...

One specific question though.  Could the fact that the old drive in SATA1 has a partition marked as bootable be what's causing the Windows boot loader to try to boot it?  Maybe I could boot to the live CD and just reset the bootable flag in fdisk on the old drive.  If there's some safe (i.e. reversible) way to render the old drive not bootable, maybe that'd help.

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11538
  • ----IOFLU----
Re: EFI on a Windows 7 PC?
« Reply #11 on: January 16, 2013, 12:43:57 PM »
Have you tried plugging the old drive, with grub in the MBR, into the SATA0 port, and the drive that came with the computer into the SATA1 port? If you can then boot PCLinuxOS we have a good starting point from which to get Windows to boot.
Don't want to sound overly skeptical, how's PCLinuxOS going to help me solve my Windows boot problems?  I'm a little afraid to mess with the SATA0 drive until I've figured out the windows boot problems - chicken and egg, I know...

One specific question though.  Could the fact that the old drive in SATA1 has a partition marked as bootable be what's causing the Windows boot loader to try to boot it?  Maybe I could boot to the live CD and just reset the bootable flag in fdisk on the old drive.  If there's some safe (i.e. reversible) way to render the old drive not bootable, maybe that'd help.

You get two choices when choosing which hard drive is the boot drive... either you plug the drive you want to be the boot drive into the connector that is already set as the boot drive, or you change the hard drive boot order in BIOS. Take your pick.

If grub is the boot loader, it needs to know where each hard drive is in the boot chain in order to have the proper hard drive partitions entered into the boot stanza for each bootable OS.

Windows repairs tend to overwrite the MBR of the drive they are installed on when using traditional BIOS. What they do with EFI I really don't know, but it's always been safest to have Linux on its own hard drive and chainload to the Windows drive to boot Windows in the past. You haven't actually mentioned any problem with Windows booting, except in relation to grub, which currently isn't booting Linux either, hence the suggestion to change the port that the Linux drive is connected to, rather than mess around in the EFI BIOS for the moment.

I have no idea whether the particular EFI implementation on your machine sees all drives in a GPT context, or can differentiate between standard DOS partitioned drives and GPT drives, and use either as the boot drive. I can't see your machine. I can only suggest the steps I would take, if presented with what you are describing, on a machine that I had just purchased, to find out exactly what the machines capabilities are.

The whole purpose of EFI/GPT is to be one method of addressing hard drives greater than 2.1 TB in size. You don't currently have one of those, therefore there was no actual need for GPT partitioning, unless that particular EFI implementation has been crippled to not properly recognize and use DOS partitioned drives. That is what I wanted to find out, by having the older Linux drive connected to the port currently set as the boot drive port. If we don't know the capacities or limitations of that particular EFI implementation, it's hard to come up with proper suggestions as to what will work best on that machine.

My machine will use either GPT or DOS partitioned drives. All my drives, including two 2 TB capacity drives, are DOS partitioned, to avoid the added complexities of the GPT partitioning scheme. Both of the 2 TB drives use 4 KB sectors, as do all larger drives currently produced. (3 TB and 4 TB) Being as the 2.1 TB limit is based on sectors of only 512 bytes, using 4 KB sectors technically raises the limit for DOS partitioning to 16 TB. Linux, in its current form, can deal with that, while Windows does not seem to have that capacity.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline littlenoodles

  • Full Member
  • ***
  • Posts: 68
Re: EFI on a Windows 7 PC?
« Reply #12 on: January 16, 2013, 08:47:59 PM »
I assume my BIOS can handle either EFI or MBR disks - its loading and displaying the grub menu from the old MBR drive, and it's able to boot a gparted rescue system from a fat32 flash drive.

I tried resetting the boot flag on my old XP partition - that didn't help. Oddly enough, when I left the flash drive plugged in, selecting windows 7 from the windows boot loader caused it to boot from the USB drive. I got the gparted boot menu in a graphical version whereas I got a text based version when I explicitly asked the BIOS to boot from the flash drive.

So there's definitely some boot order setting involved, but it's coming into play after I tell the bios to run the windows boot loader and after I tell the wbl to boot windows 7. I'm sure it's something simple once you know where to look...

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: EFI on a Windows 7 PC?
« Reply #13 on: January 16, 2013, 11:11:10 PM »
Have you checked inside BIOS by hitting some designated key like F2 or Del or something like that as soon as the system turns on?
There will be a setting for boot order.
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline littlenoodles

  • Full Member
  • ***
  • Posts: 68
Re: EFI on a Windows 7 PC?
« Reply #14 on: January 17, 2013, 08:14:01 AM »
Have you checked inside BIOS by hitting some designated key like F2 or Del or something like that as soon as the system turns on?
There will be a setting for boot order.
Yeah, I've looked at all the BIOS settings I can think of.  Well not all - there's an EFI setup tool there that I don't know enough to dig around in (but maybe I ought to try).  I see how to set the legacy boot order, and it works the way old BIOS's used to work.  I can control that, but unfortunately legacy booting on SATA0 (the win7 drive) doesn't work.  The weird thing is that when I manually bring up the BIOS boot menu and select "Windows Boot Loader", I get a Windows boot menu that shows Windows 7 as the only choice.  When I select that, the windows boot loader then seems to choose a drive according to some rules that I assume are not part of the BIOS (well, maybe there are 'enabled' flags somewhere in the EFI setup that it's looking at).  In any case by the time I see that menu, I'm in some windows boot program, not the BIOS itself, and that program is choosing what to boot.  It may also have done some other hardware initializations prior to booting, since the gparted flash drive boots to a graphical menu when booted via the Windows boot loader and a text menu when booted by selecting the USB drive from the BIOS legacy boot options.  I assusme the ability to display a graphical gparted menu is made by the grub loader on the flash drive when it looks at my hardware.