You are not logged in.
I have two disks, /dev/sda which is my SSD and /dev/sdc which is my 500gb storage unit you could say. (/dev/sdb is a 3TB storage unit but as it uses GPT it is irrelevant I guess)
I want to set up windows on /dev/sda1 with windows's BOOTMGR installed on /dev/sda (for the sake of using the partition physically in a virtual machine rather than using an image file)
but I want to have linux set up on /dev/sda2 naturally as that is my main OS, so can I set up windows on /dev/sda1, then set up linux with grub and all on /dev/sda2, then run grub-install /dev/sdc and boot from /dev/sdc into /dev/sda2's grub setup?
In short is this possible?:
MBR on dev/sdc -> grub on /dev/sda2
Last edited by rabcor (2014-06-05 15:03:48)
Offline
Am I mistaken in thinking that grub lives in the MBR?
The GRand Unified Bootloader (GRUB) is the de facto standard bootloader for GNU/Linux, and users are recommended to install it on the MBR to allow booting from any partition, whether it be primary or logical.
However since you specify disk and partition for every boot option you can as far as I know boot every disk and partition you like from any grub set up in any disk's MBR on the same machine. So just set up your grub in /dev/sdc's MBR and tell it to boot /dev/sda2
We are exactly the people our parents always warned us about.
Offline
well no the way I understand it works (not from reading but just from using it)
Is that grub lives in /boot/grub/
And the
grub-installcommand just writes something to the MBR to make it boot from there. There is a similar situation with windows (they have a 100mb system reserved boot partition usually)
I know that grub can boot from any hard drive partition, but I'm asking if it must be installed on the hard drive of which' MBR it's been written to. Testing it would be fairly easy for me but I don't want to write anything to the MBR of my hard drive if this doesn't work (cleaning out the MBR requires a complete format of the rdive and I'm just not up for that right now)
Last edited by rabcor (2014-06-05 11:28:22)
Offline
Hi rabcor,
I think that this is possible. Then you have to change the boot priority for switching the use bootloader / os.
Offline
I am not 100% sure but this is what I think.
1. You can do it with Grub, you can't do it with Syslinux.
2. You can backup and restore the MBR with this: https://wiki.archlinux.org/index.php/Ma … estoration . Careful though.
Offline
I had a similar situation. The default grub setup (sda) let me boot to Linux (sdb, sde), if I wanted to boot Windows (sdc) with its original MBR on another disk (sdd), I selected sdd as boot disk from BIOS during startup (my BIOS had that option to select to boot from USB devices, optical drives and a specific hdd, basically what _pheinrich_ refers to). So I did not use any bootloader for this process (grub was used to select kernels and other Linux distributions).
That worked flawlessly since neither grub nor windows boot partitions were touched, they were completely unaware of each other. The system partitions were scattered across several hdds. So if your BIOS/UEFI has that feature, I recommend using it.
Offline
Similar yes, but not the same, I want windows and linux both installed on the same drive with BOOTMGR installed on the MBR of that drive (meaning I can't load grub booting from this drive.
My BIOS does support UEFI but when I last tried to use it all it gave me was a blank screen so I gave up on it after several hours of trying.
Seems like this is getting me nowhere though, I'm just gonna try this.
Edit: This worked! Flawlessly too!
i.e. I installed linux as I normally would on "/dev/sda2" (with grub and the kernel on the same partition in the "/boot" directoy, basically just a one partition install with windows on /dev/sda1) and then instead of running "grub-install /dev/sda" I ran "grub-install /dev/sdc" and then told my BIOS to boot /dev/sdc and it booted into the grub installed on /dev/sda2 just as I had hoped ![]()
This is quite glorious as it means I can now just passthrough my /dev/sda1(windows) partition to a virtual machine as the MBR of /dev/sda is set for the windows bootmgr, saving me the trouble and dangers of doing it any other way.
Edit 2: This really confused Windows's disk management utility(utilities) it scrambled the order of the devices (i.e. disk 0, disk 1 and disk 2. After I did this disk 0(/dev/sda) was moved as if it were disk 2(where /dev/sdc used to be) /dev/sdc fell back one number down to disk 1 and what was /dev/sdb (should have been disk 1) fell back one number down to being disk 0)
So if you're going to do this, install windows on /dev/sda first, and then install linux and install grub to another drive, not before you set up windows
Also, windows will install it's BOOTMGR to the MBR of /dev/sdc even if the rest of the system is on /sda
Update: Now that I think of it, I need to passthrough the MBR itself for virtualization, luckily for me this means I can use that strange thing that happened before
So basically what I should do here is
1: Install /dev/sda's grub on /dev/sdc
2: Install Windows afterwards so that it will install it's bootloader on /dev/sdc's MBR
3: set up linux so that grub will be installed on /dev/sda's MBR
4: Passthrough /dev/sdc to the virtual machine and then the /dev/sda partitions windows is installed on, that way I can avoid this mess. (granted that I don't need to mount /dev/sdc on linux)
Unfortunately when I figured this out like that, I already had everything set up with the MBRs switched. I'm wondering if some startup repair voodoo black magic can install windows's mbr back on /dev/sdc again but at least now I do have an MBR that I can copy to pass through, so no real harm.
Last edited by rabcor (2014-06-12 02:10:13)
Offline