fwrun2011
August 12th, 2018, 02:25 PM
Hi;
This is a long post, but I hope that you will read it through, and appreciate my reason for making such a long post.
I would like to thank you in advance for reading me.
I have an older (2012 non-UEFI) system which I have upgraded several times over the years.
The hardware config is:
MSI P67A C43 (B3) mobo with Intel i5 2500 @ 3.4Ghz. This mobo does not support UEFI boot.
16 GIB DDR3 @ 1600 Mhz (overclocked)
Gigabyte NVidia GeForce 750 ti 2GIB DDR5 on PCIE
Primary / boot: SSD: 500GIB Samsung 850 EVO. 4 partitions:
/dev/sda1 = 253.70 GiB; NTFS; Windows 7 Ultimate sp1 (x64)
/dev/sda2 = 53.67 GiB; ext4; Ubuntu 18.04 (new install)
/dev/sda3 = 158.28 GiB; NTFS; Windows 10
/dev/sda4 = 110.0 MiB; ext4; currently not used. Want to create a dedicated partition for Grub2
Other Storage (HDD)
/dev/sdb1 = 503.02 GiB; NTFS; data storage
/dev/sdb2 = 428.50 GiB; NTFS; data storage
/dev/sdc1 = 149.05 Gib; NTFS; old HDD used for backup
/dev/sdd1 = 416.93 GiB; NTFS; data storage
/dev/sdd2 = 48.83 Gib; extended
/dev/sdd5 = 48.83 Gib; ext4; Ubuntu 18.04 (old install)
Windows 7 was installed (onto /dev/sda1) first, and as the only OS. At that time, there were only 2 partitions (of nearly equal size) on the SSD. The 2nd partition was left empty until I installed Win 10.
Windows 10 was installed (onto the 2nd partition of the SSD, which is now /dev/sda3).
This created a dual-boot system using the Windows bootloader that was installed by Windows 10.
At some point, I decided to install Ubuntu 18.04. I installed it onto one of the hard drives (not the SSD), which is now /dev/sdd5 on the extended /dev/sdd2 partition.
Grub 2 was installed during this installation. I am only assuming that the Grub2 stage 1 was installed in the MBR on /dev/sda1; the Windows 7 partition, as it is the first partition on the boot drive.
After the install of Ubuntu 18.04 was complete, the system booted into the Grub2 menu, from which I could select Ubuntu or Windows. If I selected Windows, then I would be presented with the second (Windows) menu where I would choose between Windows 7 and 10.
Then I decided I wanted to have Ubuntu 18.04 on the faster SSD. That is when I created the 3rd and 4th partitions. The 4th partition (110 MiB) is going to be my dedicated Grub 2 install when I do it.
Unfortunately, when I resized and moved the Windows 10 partition (now /dev/sda3) to create space for the new Ubuntu and Grub partitions, Windows 10 would no longer load.
When I tried to boot into Windows 10, the "automatic repair" operation began, but was unable to fix the problem. The next time I tried to boot (from Grub2 menu) into Windows, there was no second (Windows) boot menu, and it just booted into Windows 7, which was still working fine. So at that point I had the Grub2 menu from which I could boot into Ubuntu or Windows 7.
In my attempt to repair the Windows 10 OS (which I wasn't using much; I was mainly using Windows 7 or Ubuntu), I booted into Windows 7 and ran EasyBCD.
I found that Windows 10 had no drive letter associated with it. I assigned it letter D, since that was the drive it was on before (from within Windows 7).
I saved the new BCD and rebooted.
Now, the system booted directly into the Windows boot menu. Grub2 was gone! But at least I had both Windows 7 and 10 working.
I tried many ways to restore Grub2, including booting Ubuntu 18.04 from a USB flash drive. But I really didn't know what I was doing. So I decided to re-install Ubuntu (which I figured would also re-install Grub2).
I installed another copy of Ubuntu 18.04 onto the SSD (where I really wanted it) into /dev/sda2.
Then a funny thing happened:
When I rebooted, I did indeed have the Grub2 menu back, but when I booted into Ubuntu, I found that it wasn't the new install, but the old one.
That made sense, since Windows 10 had not wiped out the Ubuntu partition; it had only overwritten the MBR where Grub2 stage 1 was located. Reinstalling Ubuntu re-wrote Grub2 stage 1 onto the MBR, and found all of the OS's that were installed.
I'm a bit hazy on what happened to the Grub2 menu, but I don't think I saw an entry for the new Ubuntu install; only the old one; perhaps it was hidden.
I recovered the entire Grub2 menu by going into Grub Customizer, which I installed on the old Ubuntu.
I found that I had 2 "environments" which had Grub installed. One was the old /dev/sdd5, and the other was the new /dev/sda2.
During the process of switching back and forth between these Grub environments, I must have modified the Grub config file. When I rebooted again, I had both of the Ubuntu installs, as well as Windows (which takes me into the Windows boot menu so I can choose 7 or 10).
So, that's what I have now. Everything is working fine. But I really want to have a dedicated Grub2 partition. That is why I created the 110 MiB partition on the SSD.
Am I correct to assume that once I have a dedicated Grub2 partition, any changes I make to any OS will not destroy that partition, and I will always be able to boot into the other OS's?
Saying that, I assume that this dedicated Grub2 partition will contain not only the stage 1, but also other Grub files that allow it to display the boot menu?
From what I understand now, Grub2 installs onto the MBR of the boot partition (which is not necessarily the same partition that Ubuntu is installed on).
When the BIOS (not UEFI) boots, it finds the MBR and starts Grub2 - stage 1.
Once Grub2 stage 1 has completed, it hands off to Grub2 stage 2, which I understand is located in the /boot (or /boot/grub) directory on the primary Ubuntu install. That is where the Grub2 menu is located, right?
If the above is true, then losing that primary install of Ubuntu (or other Linux) will result in Grub2 failing to complete its booting process, and the system will be rendered unbootable.
Having a dedicated Grub2 partition will eliminate the above possibility by placing not only stage 1, but also stage 2 files into the dedicated partition, thus making Grub2 OS independent.
And finally, will Grub2 boot properly if it is not located in the 1st partition on the SSD? Since I created this Grub2 partition as the 2nd partition (as shown in the graphic of GParted).
If not, then I guess I will need to move the Windows 7 partition (/dev/sda1) over and place the Grub2 partition in front of it. Doing that is probably going to break Windows 7 (at least until I get the new Grub2 partition set up and it has run "prober" and found all of the OS's).
Am I on the right track, or am I a total train wreck?
If I am a train wreck, can someone point me to a good website or book (even if I need to purchase it) on all of this. I really want to fully understand Grub2, Ubuntu, MBR, UEFI, BIOS, and everything, so that when something goes terribly awry in my system, I won't be flailing with it and making it worse.
I have always been rather impatient when it comes to computer failures, leading me to take "shots in the dark", usually resulting in a more broken system than what I started with.
By having a good understanding of the whole process, I should be able to resolve any problems without much fuss and frustration.
Thanks for reading.
FW
This is a long post, but I hope that you will read it through, and appreciate my reason for making such a long post.
I would like to thank you in advance for reading me.
I have an older (2012 non-UEFI) system which I have upgraded several times over the years.
The hardware config is:
MSI P67A C43 (B3) mobo with Intel i5 2500 @ 3.4Ghz. This mobo does not support UEFI boot.
16 GIB DDR3 @ 1600 Mhz (overclocked)
Gigabyte NVidia GeForce 750 ti 2GIB DDR5 on PCIE
Primary / boot: SSD: 500GIB Samsung 850 EVO. 4 partitions:
/dev/sda1 = 253.70 GiB; NTFS; Windows 7 Ultimate sp1 (x64)
/dev/sda2 = 53.67 GiB; ext4; Ubuntu 18.04 (new install)
/dev/sda3 = 158.28 GiB; NTFS; Windows 10
/dev/sda4 = 110.0 MiB; ext4; currently not used. Want to create a dedicated partition for Grub2
Other Storage (HDD)
/dev/sdb1 = 503.02 GiB; NTFS; data storage
/dev/sdb2 = 428.50 GiB; NTFS; data storage
/dev/sdc1 = 149.05 Gib; NTFS; old HDD used for backup
/dev/sdd1 = 416.93 GiB; NTFS; data storage
/dev/sdd2 = 48.83 Gib; extended
/dev/sdd5 = 48.83 Gib; ext4; Ubuntu 18.04 (old install)
Windows 7 was installed (onto /dev/sda1) first, and as the only OS. At that time, there were only 2 partitions (of nearly equal size) on the SSD. The 2nd partition was left empty until I installed Win 10.
Windows 10 was installed (onto the 2nd partition of the SSD, which is now /dev/sda3).
This created a dual-boot system using the Windows bootloader that was installed by Windows 10.
At some point, I decided to install Ubuntu 18.04. I installed it onto one of the hard drives (not the SSD), which is now /dev/sdd5 on the extended /dev/sdd2 partition.
Grub 2 was installed during this installation. I am only assuming that the Grub2 stage 1 was installed in the MBR on /dev/sda1; the Windows 7 partition, as it is the first partition on the boot drive.
After the install of Ubuntu 18.04 was complete, the system booted into the Grub2 menu, from which I could select Ubuntu or Windows. If I selected Windows, then I would be presented with the second (Windows) menu where I would choose between Windows 7 and 10.
Then I decided I wanted to have Ubuntu 18.04 on the faster SSD. That is when I created the 3rd and 4th partitions. The 4th partition (110 MiB) is going to be my dedicated Grub 2 install when I do it.
Unfortunately, when I resized and moved the Windows 10 partition (now /dev/sda3) to create space for the new Ubuntu and Grub partitions, Windows 10 would no longer load.
When I tried to boot into Windows 10, the "automatic repair" operation began, but was unable to fix the problem. The next time I tried to boot (from Grub2 menu) into Windows, there was no second (Windows) boot menu, and it just booted into Windows 7, which was still working fine. So at that point I had the Grub2 menu from which I could boot into Ubuntu or Windows 7.
In my attempt to repair the Windows 10 OS (which I wasn't using much; I was mainly using Windows 7 or Ubuntu), I booted into Windows 7 and ran EasyBCD.
I found that Windows 10 had no drive letter associated with it. I assigned it letter D, since that was the drive it was on before (from within Windows 7).
I saved the new BCD and rebooted.
Now, the system booted directly into the Windows boot menu. Grub2 was gone! But at least I had both Windows 7 and 10 working.
I tried many ways to restore Grub2, including booting Ubuntu 18.04 from a USB flash drive. But I really didn't know what I was doing. So I decided to re-install Ubuntu (which I figured would also re-install Grub2).
I installed another copy of Ubuntu 18.04 onto the SSD (where I really wanted it) into /dev/sda2.
Then a funny thing happened:
When I rebooted, I did indeed have the Grub2 menu back, but when I booted into Ubuntu, I found that it wasn't the new install, but the old one.
That made sense, since Windows 10 had not wiped out the Ubuntu partition; it had only overwritten the MBR where Grub2 stage 1 was located. Reinstalling Ubuntu re-wrote Grub2 stage 1 onto the MBR, and found all of the OS's that were installed.
I'm a bit hazy on what happened to the Grub2 menu, but I don't think I saw an entry for the new Ubuntu install; only the old one; perhaps it was hidden.
I recovered the entire Grub2 menu by going into Grub Customizer, which I installed on the old Ubuntu.
I found that I had 2 "environments" which had Grub installed. One was the old /dev/sdd5, and the other was the new /dev/sda2.
During the process of switching back and forth between these Grub environments, I must have modified the Grub config file. When I rebooted again, I had both of the Ubuntu installs, as well as Windows (which takes me into the Windows boot menu so I can choose 7 or 10).
So, that's what I have now. Everything is working fine. But I really want to have a dedicated Grub2 partition. That is why I created the 110 MiB partition on the SSD.
Am I correct to assume that once I have a dedicated Grub2 partition, any changes I make to any OS will not destroy that partition, and I will always be able to boot into the other OS's?
Saying that, I assume that this dedicated Grub2 partition will contain not only the stage 1, but also other Grub files that allow it to display the boot menu?
From what I understand now, Grub2 installs onto the MBR of the boot partition (which is not necessarily the same partition that Ubuntu is installed on).
When the BIOS (not UEFI) boots, it finds the MBR and starts Grub2 - stage 1.
Once Grub2 stage 1 has completed, it hands off to Grub2 stage 2, which I understand is located in the /boot (or /boot/grub) directory on the primary Ubuntu install. That is where the Grub2 menu is located, right?
If the above is true, then losing that primary install of Ubuntu (or other Linux) will result in Grub2 failing to complete its booting process, and the system will be rendered unbootable.
Having a dedicated Grub2 partition will eliminate the above possibility by placing not only stage 1, but also stage 2 files into the dedicated partition, thus making Grub2 OS independent.
And finally, will Grub2 boot properly if it is not located in the 1st partition on the SSD? Since I created this Grub2 partition as the 2nd partition (as shown in the graphic of GParted).
If not, then I guess I will need to move the Windows 7 partition (/dev/sda1) over and place the Grub2 partition in front of it. Doing that is probably going to break Windows 7 (at least until I get the new Grub2 partition set up and it has run "prober" and found all of the OS's).
Am I on the right track, or am I a total train wreck?
If I am a train wreck, can someone point me to a good website or book (even if I need to purchase it) on all of this. I really want to fully understand Grub2, Ubuntu, MBR, UEFI, BIOS, and everything, so that when something goes terribly awry in my system, I won't be flailing with it and making it worse.
I have always been rather impatient when it comes to computer failures, leading me to take "shots in the dark", usually resulting in a more broken system than what I started with.
By having a good understanding of the whole process, I should be able to resolve any problems without much fuss and frustration.
Thanks for reading.
FW