Recently, I wanted to set up an old PC with a Dual Boot using Debian 12 and Window 7 Pro. Because I’m never sure what combination of OS I will want over time, I decided to install Debian on one SSD drive and Windows 7 on another. I figured it would not be that difficult to use Clonezilla to image the partitions on those drive and then clone the partitions to a third drive that I would then patch a GRUB bootloader on. Many hours later, and I got it working. This is what I learned.
1. Make Clonezilla your friend. Clonezilla has no mouse support so get used to using Tab to jump around along with the up/down arrows to get to a menu item and the spacebar to select the item. Honestly, if you simple select the default item on each Clonezilla screen you are 90% of the way there. The other 10% is selecting where the image is and where you want it to go. I imaged the Entire Drives on the drive with the initial 40Gb windows installation and the second drive with the 30Gb Debian install. Later, I selected to Restore Partitions (not the entire drive) to a third drive dual boot drive. I used the default -k0 setting to avoid creating a partition table as I had the third drive partitioned and ready to go as discussed below.
2. Windows likes to be on the first partition. I tried putting Linux Debian on /dev/sda1 (first partition) but try as I might, could never get Windows to boot. There are some very useful tools like SuperGRUB2 and Boot-Repair that you can download an image ISO for and install on a USB stick using Belcher-Ancher but even these tools couldn’t convince Windows to take second chair.
3. No matter what, you will have to repair the boot on Windows whenever to clone it to another drive. After cloning, I tried booting up the Windows 7 DVD, pressed Shift-F10 at the “Install Now” prompt to open a command line window, and then entered the two commands bootrec /fixmbr and bootrec/fixboot but Windows did not boot. I then re-boot the Windows DVD and click Repair Your PC and clicked Repair and Restart after a “problem” was found. This worked.
If you are curious, you can enter “bcdedit” in the command window before and after to see what changes. In my case, Windows Repair added a path \bootmgr to the Windows Boot Manager section of the bcd. Knowing this, I could have entered the command bcdedit /set {default} path \bootmgr and saved myself the troubling of booting up the Windows 7 DVD twice, but this is for someone else to try.
4. Make your initial OS partitions small. When cloning, I decided to put Windows on a smaller partition using Expert Mode and selecting the -icds switch. This works fine for Windows but I could not ever figure out how to get Clonezilla to clone a Linux partition onto a smaller partition, so I make sure to set up a small 30Gb partition for Linux – more below. I read about using a -C switch in Clonezilla command line mode but this was more than I wanted to get into.
5. Install Linux Debian on a single partition. Initially, I allowed a Swap partition along with the /root partition to be created during the Debian setup. Even though later, I changed the “sda” portion of the img.gz file name from “sda1” to “sda2” and modified the contents of the “Parts” file in the Clonezilla image folder (changed sda1 to sd2 and likewise for the swap partition), I could never get the swap file to clone onto the third drive. Making these changes is required to clone a partition imaged in one position on one drive to a different partition on another drive – see Clonezilla’s FAQ. The root partition cloned but the extended swap partition setup by Debian at the end of the drive would not - in spite of setting up the same partition layout on the dual boot drive.
During setup, I select to have the Entire Drive used and to have all the partitions like swap and root combined. I then deleted that one large drive and created a single, Primary, ext4, “/” root drive with the boot flag on. Debian installed just fine on this single partition in spite of complaining that my 4Gb of RAM may not be enough to get the job done. Later, I upgraded to 16Gb and from what I have read, a swap partition is not needed.
6. Use GParted. The first apt I install after loading Debian is GParted by issuing the command sudo apt install gparted in the Debian command line window. I think other OS like Ubuntu have it pre-installed.
I used GParted to set up the Windows partition before installation so that Windows did not create a second boot partition and make cloning it to another drive with additional partitions for Linux and such more difficult. One partition for one OS is my rule for making this task much easier. I set up the initial Windows Primary partition as NTFS and flagged it “boot” using Gparted. I did the same for the third drive before cloning Windows onto the first partition /dev/sda1.
As mentioned above, I created a 30Gb Primary ext4 partition flagged “boot” during Debian setup. Later, I used Gparted to create the same on my dual boot drive before cloning Debian onto that drive. By the way, 30Gb is entered as 30720Mb because there are 1024Mb in every gigabyte.
7. After cloning Debian to the dual boot drive, you will need to fix GRUB. I like to use GRUB for the boot menu since I only rarely boot Windows. To do this, you can download and write the Boot-Repair image on a USB drive and simply click to have GRUB repaired. By the way, make sure to get the 32 bit version if your using an old PC like me.
However, I like to stick with the OS software whenever I can. So downloaded a Debian Live iso and wrote it to a USB stick. After booting up Debian Live i386, I followed the excellent direction on Reinstall GRUB Step-by-Step on fosslinux.com. This included mounting the partition to the /mnt directory so I could “chroot” into it and eventually issue the “grub-install” command. Anyway, I followed the directions and it worked great even on my BIOS (not UEFI) PC.
8. Add Windows to GRUB. After booting up Debian, un-remark line (remove #) GRUB_DISABLE_OS_PROBER=false. Now run sudo update-grub in terminal and then remark the PROBER line. You will now have a Windows 7 in your GRUB menu during bootup.
Reinstalling GRUB
https://www.fosslinux.com/115031/troubl ... -linux.htm
1. Make Clonezilla your friend. Clonezilla has no mouse support so get used to using Tab to jump around along with the up/down arrows to get to a menu item and the spacebar to select the item. Honestly, if you simple select the default item on each Clonezilla screen you are 90% of the way there. The other 10% is selecting where the image is and where you want it to go. I imaged the Entire Drives on the drive with the initial 40Gb windows installation and the second drive with the 30Gb Debian install. Later, I selected to Restore Partitions (not the entire drive) to a third drive dual boot drive. I used the default -k0 setting to avoid creating a partition table as I had the third drive partitioned and ready to go as discussed below.
2. Windows likes to be on the first partition. I tried putting Linux Debian on /dev/sda1 (first partition) but try as I might, could never get Windows to boot. There are some very useful tools like SuperGRUB2 and Boot-Repair that you can download an image ISO for and install on a USB stick using Belcher-Ancher but even these tools couldn’t convince Windows to take second chair.
3. No matter what, you will have to repair the boot on Windows whenever to clone it to another drive. After cloning, I tried booting up the Windows 7 DVD, pressed Shift-F10 at the “Install Now” prompt to open a command line window, and then entered the two commands bootrec /fixmbr and bootrec/fixboot but Windows did not boot. I then re-boot the Windows DVD and click Repair Your PC and clicked Repair and Restart after a “problem” was found. This worked.
If you are curious, you can enter “bcdedit” in the command window before and after to see what changes. In my case, Windows Repair added a path \bootmgr to the Windows Boot Manager section of the bcd. Knowing this, I could have entered the command bcdedit /set {default} path \bootmgr and saved myself the troubling of booting up the Windows 7 DVD twice, but this is for someone else to try.
4. Make your initial OS partitions small. When cloning, I decided to put Windows on a smaller partition using Expert Mode and selecting the -icds switch. This works fine for Windows but I could not ever figure out how to get Clonezilla to clone a Linux partition onto a smaller partition, so I make sure to set up a small 30Gb partition for Linux – more below. I read about using a -C switch in Clonezilla command line mode but this was more than I wanted to get into.
5. Install Linux Debian on a single partition. Initially, I allowed a Swap partition along with the /root partition to be created during the Debian setup. Even though later, I changed the “sda” portion of the img.gz file name from “sda1” to “sda2” and modified the contents of the “Parts” file in the Clonezilla image folder (changed sda1 to sd2 and likewise for the swap partition), I could never get the swap file to clone onto the third drive. Making these changes is required to clone a partition imaged in one position on one drive to a different partition on another drive – see Clonezilla’s FAQ. The root partition cloned but the extended swap partition setup by Debian at the end of the drive would not - in spite of setting up the same partition layout on the dual boot drive.
During setup, I select to have the Entire Drive used and to have all the partitions like swap and root combined. I then deleted that one large drive and created a single, Primary, ext4, “/” root drive with the boot flag on. Debian installed just fine on this single partition in spite of complaining that my 4Gb of RAM may not be enough to get the job done. Later, I upgraded to 16Gb and from what I have read, a swap partition is not needed.
6. Use GParted. The first apt I install after loading Debian is GParted by issuing the command sudo apt install gparted in the Debian command line window. I think other OS like Ubuntu have it pre-installed.
I used GParted to set up the Windows partition before installation so that Windows did not create a second boot partition and make cloning it to another drive with additional partitions for Linux and such more difficult. One partition for one OS is my rule for making this task much easier. I set up the initial Windows Primary partition as NTFS and flagged it “boot” using Gparted. I did the same for the third drive before cloning Windows onto the first partition /dev/sda1.
As mentioned above, I created a 30Gb Primary ext4 partition flagged “boot” during Debian setup. Later, I used Gparted to create the same on my dual boot drive before cloning Debian onto that drive. By the way, 30Gb is entered as 30720Mb because there are 1024Mb in every gigabyte.
7. After cloning Debian to the dual boot drive, you will need to fix GRUB. I like to use GRUB for the boot menu since I only rarely boot Windows. To do this, you can download and write the Boot-Repair image on a USB drive and simply click to have GRUB repaired. By the way, make sure to get the 32 bit version if your using an old PC like me.
However, I like to stick with the OS software whenever I can. So downloaded a Debian Live iso and wrote it to a USB stick. After booting up Debian Live i386, I followed the excellent direction on Reinstall GRUB Step-by-Step on fosslinux.com. This included mounting the partition to the /mnt directory so I could “chroot” into it and eventually issue the “grub-install” command. Anyway, I followed the directions and it worked great even on my BIOS (not UEFI) PC.
8. Add Windows to GRUB. After booting up Debian, un-remark line (remove #) GRUB_DISABLE_OS_PROBER=false. Now run sudo update-grub in terminal and then remark the PROBER line. You will now have a Windows 7 in your GRUB menu during bootup.
Reinstalling GRUB
https://www.fosslinux.com/115031/troubl ... -linux.htm
Statistics: Posted by Deb12User — 2025-01-15 15:03 — Replies 0 — Views 26