Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: Windows 7 and partitions, on Ubuntu machine

  1. #11
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,100
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: Windows 7 and partitions, on Ubuntu machine

    Hello OldFred, yes. I agree it's easier to let Windows do what it likes, but if there's a reason for wanting to make it do what the computer owner wants then it is possible to force Windows to do the owner's bidding. At least in my computer that is.
    I am looking for my notes from my old Windows 7 experiments for the exact details. I do remember I really put Windows 7 RC through its paces and subjected it to every kind of cruelty I could think of. I must admit even if I'm not a Windows fan that the installation disk repair tools did a great job at repairing Windows 7 every time I trashed it. Sometimes I needed to run them a few times though, they would sometimes not always fix everything at once. If I can't easily find those old notes I'll repeat the experiment of making Windows 7 boot and run in a logical partition again myself just for the fun of it and let you know what happens.

  2. #12
    Join Date
    Mar 2005
    Location
    Ice cold Norway
    Beans
    519

    Re: Windows 7 and partitions, on Ubuntu machine

    Is there somewhere online you could put these notes on Windows 7 (and Linux)? A Ubuntu wiki, AskUbuntu or maybe some Stack Overflow place? Information wants to be free etc.

  3. #13
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Windows 7 and partitions, on Ubuntu machine

    Herman has his own site, which is very good if you want to understand how things work. Lots of technical info and he actually tests or experiments with all the info he posts. I refer to his site regularly (and have learned a lot) but it is more detailed and new users can get overwhelmed.

    http://members.iinet.net/~herman546/index.html
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  4. #14
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,100
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: Windows 7 and partitions, on Ubuntu machine

    Well from the series of experiments I have had time for so far it seems I'm wrong and the boot loader files for Windows 7 do need to be in a primary partition.

    To try to sum up what I have found out so far without being too wordy,

    • The primary partition for Windows 7 boot loader files can be in any partition number between 1 and 4 and the partition can be in any physical location on the hard disk.
    • The partition that contains the Windows 7 operating system files can be a logical or a primary partition and it can have any partition number and be in any physical partition on the hard disk or even in a different hard disk from the boot loader files.
    • The Window 7 boot loader files can be cut out of the boot loader partition and pasted into the operating system partition using Ubuntu and the installation can be easily fixed and made bootable with Windows 7's Startup Repair in the Windows 7 Installation Disk. (But only if the operating system is a primary partition).

    I spent some time copying and pasting the operating system partition around with GParted, reinstalling boot loader and also re-installing the entire operating system and that's how it seems to me so far.

    If an earlier version of Windows exists in the computer, even if it's in a different hard disk, Windows 7 will inject its boot loader files into that.
    I had Windows XP in the first partition in the first hard disk and tried to install Windows 7 in last place in the second hard disk in a logical partition number 7.
    It installed up just fine and I was able to boot either operating system via Windows 7 boot loader files in Windows XP.

    I and most other computer users do not like having one operating system dependant on the other. If Windows XP gets a virus or the hard disk fails it will bring down my Windows 7 installation, (if I was a serious Windows user doing real work I would be very concerned about that). After copying the boot loader files out and pasting them into Windows 7 I was not (easily) able to fix Windows 7.

    The fact that Windows 7 is tied to the MBRs disk signature added another level of complexity to the task and that was not needed for this experiment. I used a dd command to copy the first 446 bytes of each MBR to a file and then copied the mbr img files to opposite disks to cause the second hdd to have the 1st hdd's disk sig. That task would have been beyond most computer users abilities and dangerous for most users. I do not recommend anyone try that at home.
    Then I unplugged the first hdd containing Windows XP. This event has disabled the boot of my Windows XP installation but I'll fix that later.

    I have not so far managed to get Windows 7 to boot in a logical partition despite trying the commands given in the website I linked to earlier.
    Windows 7 's Startup Repair fixed Windows 7 perfectly well as soon as the entire operating system was copied and pasted to a primary partition using GParted.
    I intend to try again as I did depart from the instructions in the website by running Startup Repair after the suggested commands and maybe I shouldn't have.

    I have spent some time re-installing Windows 7 and copying it and pasting it around with GParted but these experiments are by no means exhaustive.
    I will try a few more experiments but it seems unlikely from now on I will learn anything very surprising.
    Last edited by Herman; January 20th, 2013 at 08:10 PM.

  5. #15
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,100
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: Windows 7 and partitions, on Ubuntu machine

    I'm back and I just did another experiment and I managed to find out something that surprised me.
    This experiment is a little 'outside the box' in more ways than one.

    I made some room at the back of a USB flash memory stick using GParted and I copied and pasted the 100 MiB Windows 7 boot loader partition to the USB drive.
    Then I deleted the original partition from the (second) hard drive).
    Finally, I ran update-grub and GRUB listed Windows 7 in the USB.

    Windows 7 was able to boot up as fresh as a daisy via GRUB to the last partition in the USB and from there to Win7 in the last (logical) partition in my second hard drive. (The bootloader partition in the USB drive is primary).

    The significance of this is, if a computer has a shortage of primary partitions they can still install and boot Windows 7. I don't think Windows 7 would be able to do this by itself though, you would need to have a primary partition of at least 100 MiB left vacant for it prior to installing and then re-arrange partitions after the fact.

    I am surprised that Windows 7 can boot via a USB drive. I don't think the operating system itself would boot if it was installed in a USB. I do remember using floppy boot disks for booting Windows 95. (Giving away my age a bit here).

    NOTE: I will not have time to keep on testing this arrangement to see if it's stable and reliable in the long term, it's just an experiment. It may help somebody but no guarantees.

  6. #16
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Windows 7 and partitions, on Ubuntu machine

    Good info Herman. I am really surprised that Windows booted from USB. But maybe that is allowed as if boot is damaged so you can get into system?

    I once downloaded the Windows repair ISO, but never figured out how to install to a flash drive directly from Ubuntu. I made the CD and used that to install itself to flash drive. But it only used 250 to 300KB so I used the procedure to install grub to the flash drive, made sure there was only one /boot with both grub files & the BCD and it booted Windows. I then created another partition and added several repair ISO to loopmount from grub and had a Windows repair CD plus Linux repair tools.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  7. #17
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,100
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: Windows 7 and partitions, on Ubuntu machine

    Hey that's a great idea, OldFred, a Grub over BCD boot disk!

    GRUB 2 supports the NT file system, so that would be entirely feasible. I have even installed GRUB inside Windows in the past. There are only two commands needed to turn it into a standalone GRUB/BCD boot disk. A boot disk like that could be made from the Ubuntu LiveCD before a person begins installing Ubuntu.

    Lets see now, in my Ubuntu installation the Windows 7 boot loader partition in the USB shows up automatically mounted as /media/System Reserved.
    This can either be verified by the ls /media command, or by navigating to the /media folder with the file manager and taking a look.

    Linux doesn't like white spaces, so I need to use GParted to change the label in that file system and replace the white space with an underscore or a hyphen. (requires nyfsprogs to be installed first).
    Now it's showing up as as /media/System_Reserved.

    Using the blkid command to check, the partition number is /dev/sdc2, so the MBR to install GRUB to will be /dev/sdc. I can use that in the following command to create GRUB/BCD boot disk,
    Code:
    sudo grub-install --root-directory=/media/System_Reserved /dev/sdc
    NOTE: To anyone wanting to try this, It is very important to check and make sure you will be installing GRUB to the correct MBR, (shown here as /dev/sdc for me in this computer), this varies between different computers and a mistake here could be disasterous for some people. You need to use the blkid command first to check.

    Now all I need to do is copy my current grub.cfg to the new boot disk,
    Code:
    sudo cp /boot/grub/grub.cfg /media/System_Reserved/boot/grub/grub.cfg
    I just tested the new boot disk and it appears to be working on the first test boot-up and has booted Windows 7 okay. I will likely get to test it a few more times as the next items on my agenda are to be risky for Windows 7. In fact I have already trashed the Windows 7 boot, I deleted my hard disk Windows 7 bootloader partition and 'm going to try that Booting Windows Vista/7 From a Logical Partition tutorial again.
    Last edited by Herman; January 21st, 2013 at 06:26 AM.

  8. #18
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,100
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: Windows 7 and partitions, on Ubuntu machine

    But maybe that is allowed as if boot is damaged so you can get into system?
    I don't know but it seems like it could be a handy trick.

    Microsoft themselves have a KB article advising people how to copy out their Windows XP ntldr ntdetect.com and create a boot floppy with its own boot.ini files, How to create a bootable floppy disk for an NTFS or FAT partition in Windows XP

    Not so many people use floppy disks these days, a USB is better. I'm not aware of any kb articles about BCD boot disks though. I haven't searched.

  9. #19
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Windows 7 and partitions, on Ubuntu machine

    I think it also may make a difference how you format NTFS partition. I once ran chkdsk from the Windows 7 repair flash and it converted partition boot sector - PBR to Windows 7 from Windows XP. I could see the difference with testdisk dump as backup showed ntldr and PBR showed bootmgr. Structure is also somewhat different.
    I do not know if just installing Windows 7 converts/reformats PBR or not, I guess it must to be able to boot, but with a logical partitions does it?
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  10. #20
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,100
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: Windows 7 and partitions, on Ubuntu machine

    I agree with you there's something different about the Windows 7 boot sector.
    I once installed Ubuntu in a netbook which had Windows XP in it. Windows XP wouldn't boot after Ubuntu was installed. Then I found out there was a peculiarity with that particular make and model of netbook and Windows XP needed a Windows 7 boot sector for some reason. The solution was to run CHKSDK from a Windows 7 DVD. I probably ran FIXBOOT too and after that I was relieved to be able to give the netbook back to its owner with both operating systems in good working order.

    I wasn't aware the Windows 7 boot sector would be unable to function in a logical partition.
    You were asking me in an earlier post whether or not all the Windows 7 startup repair and the console commands would work when Windows 7 is in a logical partition.
    The command bootrec /fixboot returns 'element not found'.
    The Startup Repair log ends with: ' Root Cause found: ----------------------- The partiiton does not have a valid System Partition.'
    Last edited by Herman; January 21st, 2013 at 10:00 PM.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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