1

As of now, I have a single 500GB hard disk with Windows installed first on one partition and Ubuntu installed on another partition. Since Ubuntu was installed second, it detected the Windows partition and Grub provided a dual boot. Sometimes, after installing Ubuntu, the Windows drive-letter C changes to D and Windows does not boot.

Problem is, when I wanted to install a newer version of Windows, I installed it, and now the system directly boots into Windows. No option of booting into Linux is provided.

So two questions:
1. In a situation where I want to reinstall Windows or Linux with a newer version, how can I prevent the dual boot option from getting ignored?
2. Is there a way to make the Windows partition and Linux partition completely unaware of each other? Perhaps by having a third party bootloader, which can detect which operating systems are on the disk and allow me to choose which I want to boot into, and also allow me to completely remove/replace one of the operating systems with a new one, and still be able to boot into either that OS (Windows) or into Linux OS which was un-touched?

1
  • Is there nothing available? Shucks, please point me to the right person, and I'd like to collaborate with them to modify an existing open source bootloader to be able to handle what I've mentioned in my question.
    – Nav
    Dec 6 '15 at 16:23
1

The problem with re-installing Windows is because it doesnt play all that well with others (other OS) it automatically overwrites the MBR to point to itself, that's why you have to re-install the bootloader so you can get dual-boot.

What about installing the bootloader to a USB stick? That way you can keep installing/updating windows without a bother, and when you want to boot Linux you just pop your USB stick in and it boots Linux. You could even change your fstab within Linux so it doesn't mount the windows partition.

Install Linux, then from inside the new Linux installation:

  1. Zero the USB

    dd if=/dev/zero of=/dev/sdd

  2. Create a 128 mb partion at the start of the USB

    fdisk /dev/sdd ... use 'n' to create a partition mkfs -t ext2 /dev/sdd1 mkdir /tmp/myusb mount /dev/sdd1 /tmp/myusb mkdir /tmp/myusb/boot

  3. Install grub to the USB, making sure the boot directory is on the USB drive:

    grub-install --boot-directory=/tmp/myusb/boot /dev/sdd

  4. Edit /etc/grub.d/40_custom and add the following (msdos1 being the first windows partition)

    menuentry "WINDOWS"{
    set root='(hd0,msdos1)' 
    chainloader +1
    }
    
  5. Update the grub config, outputting to the USB.

    update-grub --output=/tmp/myusb/boot/grub/grub.cfg

Most of this info was from the following blog: http://jarrodla.blogspot.co.uk/2014/04/hp-microserver-gen8-boot-from-5th-sata.html

2
  • Creative answer! But since I'd still prefer it to be on the hard disk rather than a USB stick/drive, perhaps I could add to your creativity by suggesting that a kind of a partition emulator could be created which would imitate the MBR section, so that when Windows is installed, it'd think it is overwriting the MBR, but it actually isn't.
    – Nav
    Jan 14 '16 at 16:50
  • I know what you're thinking, have bootloader on the MBR, windows and linux on seperate partitions. bootloader boots whichever one. I think windows will still be a problem as it writes its own bootloader to the MBR of the physical disk.
    – boopzz
    Jan 14 '16 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.