• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

A guide to Windows/Linux dual boot on RAID

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Sydney

Member
Joined
Sep 28, 2009
Location
Reykjavík, Iceland
This is a guide explaining how to dual boot Windows and Linux off a single RAID array. It was tested with a RAID0 array but it should work with all types. I originally followed this guide but it didn't specify how to install both Linux and Windows on the same array.

Why "fake" raid?
There are three ways to control a RAID array, hardware, software and fake. Hardware is when you have a dedicated RAID card that does all the work, leaving no work for the CPU, therefore yielding the best performance, and since it is connected to the control card it has maximum mobility, that is: You can transfer the array between system worry-free. Software RAID let's the operating system take care of the RAID array, this should be the easiest to set up and is recommended unless you want to dual boot Linux and Windows off a single array. Fakeraid let's the southbridge control the array, and therefore both Windows and Linux can see and use the array.

There are more ways to install Linux on a fakeraid array, for example using the alternative CD, but I strongly prefer this method.

1. Set up your SATA configuration to RAID in BIOS, save and exit.

2. After the POST screen, a RAID configuration screen should be visible, opting you to press a key to enter the configuration (CTRL+I in my case). Set up your RAID configuration, this varies between motherboards, so I suggest you look into your motherboard manual if you have problems.

You should now have a working RAID array

Against the common procedure, we have to install Linux before Windows. This is because Windows partitions the array in a way Linux can't read, but Windows can read the Linux partitioning.

3. Put in your Linux live CD, I used Ubuntu 9.04, and this should also work on 9.10. I have yet to test it on other distributions, I would love some feedback.

4. Boot up the live session.

5. Open up a terminal and type in these commands
Code:
sudo apt-get update
sudo apt-get install dmraid
This will install dmraid, which is required to read the RAID array.

If you are using another kind of RAID than RAID0 or RAID1 you must execute this command
Code:
sudo modprobe dm-raid4-5

6. Now, execute this command
Code:
sudo dmraid -ay
If everything is right, your RAID array should show up. I got a message saying it was already enabled, which is good. My RAID array is /dev/mapper/isw_dejihacffa_raid, yours may vary, so in the rest of your guide, adjust "isw_dejihacffa_raid" to what yours is called.

7. Set up the partitioning using gparted (if gparted is not found you must do 'sudo apt-get install gparted' first)
Code:
sudo gparted

8. Now select your RAID array, isw_dejihacffa_raid. Right click on it and hit "new", this should opt you to create a partition table. Create the table as 'msdos', which will be selected by default. Now right click and "new" again and create an EXT3 or EXT4 partition that takes up half the disk. EXT4 might cause incompatibility with older distros, so you might want to use EXT3. I do NOT recommend having a separate boot partition, I couldn't get it to boot properly.

9. Now create a NTFS partition on the rest of the drive. If you have less than 4GB of RAM I recommend creating a 4GB SWAP partition at the end of the drive. Now your partitioning scheme should look like this.

[IMAGE]

10. Apply the settings and close gparted. Now start up ubiquity (install shortcut on desktop).

11. Install as you normally would, and when you get to the partitioning, click manual and edit the EXT3/EXT4. Use it as EXT3/EXT4, format it and set the root as / and if you crated a swap partition edit it and select use as swap.

12. At the last step click advanced and uncheck "Install GRUB". We will install grub manually later.

13. Finish installing, now put in your Windows installation CD/DVD.

14. If you are using Windows XP you will need a floppy with your RAID drivers, if you are using Vista you will need a floppy/USB/local folder with RAID drivers while Windows 7 might have your RAID drivers by default.

15. Select your language, click Install Now, and custom. Now select the second partition on your RAID array and install on it. It should install without problems because it was set up correctly as NTFS.

16. Finish installing windows.

17. Boot into the live CD again.

18. Once again
Code:
sudo apt-get update
sudo apt-get install dmraid

19. Now mount the new Linux install
Code:
sudo mount /dev/mapper/isw_dejihacffa_raid1 /mnt/

20. Bind your /dev, /proc and /sysfs and copy over the resolv.conf then chroot into it.
Code:
sudo mount --bind /dev /mnt/dev/
sudo mount -t proc proc /mnt/proc/
sudo mount -t sysfs sys /mnt/sys/
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf 
sudo chroot /mnt

21. Now install dmraid and grub
Code:
apt-get update
apt-get install dmraid grub

22. Create the GRUB directory
Code:
mkdir /boot/grub/

23. Copy over the GRUB files to the new grub folder
Code:
cp /usr/lib/grub/x86_64-pc/* /boot/grub/
(Replace x86_64-pc with your architecture if you are using something else than AMD64)

24. Now run grub
Code:
grub
And type these commands
Code:
device (hd0) /dev/mapper/isw_dejihacffa_raid1
find /boot/grub/stage1
root (hd0,0) 
setup (hd0)
This is assuming that your RAID array is the first drive in the BIOS, and will override your MBR.
If 'fine /boot/grub/stage1' shows something else than 0,0, for example 1,0, then do 'root (hd1,0)

25. Now you can create a menu.lst by running
Code:
update-grub

And assuming that you set up windows as the second partition on the RAID array you can add it to GRUB by editing menu.lst
Code:
nano /boot/grub/menu.lst

And at the bottom of the file, add
Code:
  title                 Windows
  rootnoverify (hd0,1)
  makeactive
  chainloader +1

And if you are running a different RAID than 0 or 1 do this
Code:
echo dm-raid4-5 >> /etc/initramfs-tools/modules
update-initramfs -u

Then add
Code:
dm-raid4-5
to /etc/modules
Code:
nano /etc/modules

You should now be able to boot into both Linux and Windows residing on the same RAID array when prompted in GRUB.

This guide was heavily based on the ubuntu community fakeraid guide
https://help.ubuntu.com/community/FakeRaidHowto

I will update this guide as necessary, and any suggestions are welcome.

If you have any questions feel free to ask them in this thread, and I will do my best to help you.
 
Last edited:
I'm trying to get this working but when I type in

sudo dmraid -ay

RAID set "isw_ddihjegdgj_Windows7" was not activated

Is there any way to activate it.
 
If you have already formatted the partition in Windows, Linux can't see it. You need to format all partitions from Linux.

To get dual booting working, you need to erase everything of the RAID and start fresh.
 
Wow, I read your guide several times from the Google search result but I did not realize just how old the guide was until I found this thread and its date lol. So, please forgive me for bringing it back to life but I feel I have no choice but to revive it considering Ubuntu 14.04 has made some changes regarding FakeRAID.

OK, here goes. I have a R3E (since your a member of an overclocking forum I am going to assume you know what that is) and a Xeon Hexa-Core Gulftown X5650 running at 4ghz as my daily driver. I also have 12gb of tri channel Ripjaws, and two Samsung 840 Pro's in RAID0 on the ICH10R. I spent the last week trying to get Ubuntu to install into the pre-formatted ext4 partition (created by miniTools Partition Wizard) that I already created for it, but until today I was not aware it wasn't possible. So, after a perfect Windows install (days of work) it looks like I have to re-do the entire thing just to get Ubuntu sharing the same array as Windows. But I have a few questions since it appears you probably already know the answers.

1. I have read some people say that Ubuntu on FakeRAID sharing the same array can slow down the Windows OS. Is this True?

2. Is Intels FakeRAID just as fast in Ubuntu as it is for Windows? My Windows 8.1 install is screaming fast, instant at just about everything I ask of it.

3. Ubuntu 14.04 LTS has replaced dmraid (now deprecated) with mdadm (now has FakeRAID support). Does this effect the steps in your Guide, and if so do you know what we would need to do differently for 14.04? This guy Dean managed to get it working with FakeRAID but what he says and what I have on my screen sound differently. Will his guide work and why did GRUB fail him?

I contacted you simply because at the bottom of your guide you said you did not mind having people asking questions on this. Well, I would REALLY love some one-on-one help, overclocker to overclocker. I consider using Ubuntu in RAID mode as overclocking it, haha...

Any tips would be much appreciated as I am growing angry at Ubuntu for making this so difficult and wasting so much of my time this week but at the same time its the only distro I care to run. Thank you Sydney :thup:
 
If you have already formatted the partition in Windows, Linux can't see it. You need to format all partitions from Linux.

To get dual booting working, you need to erase everything of the RAID and start fresh.

Oh, and by the way, Ubuntu 14.04 see's all the FakeRAID partitions by default, which I was not expecting, but I was able to see the files and even use them the moment the Live USB booted to its desktop. Even the 62GB EXT4 partition that I formatted from Windows was usable from within the Live session. It just would not install to it without wanting to destroy the all the partitions and starting from scratch.

EDIT: OK, some good news. Well I tried this guide and several others but my hardware config refuses to work exactly like yours did. I did manage to get Ubuntu installed though after a gazillion tries, but now I am left with a unallocated partition for Windows. Every time I install Windows and then go back to the live session nothing works as above, not even close. Boot-repair also does not work while I am in the live session, not properly anyway. I tried using EasyBCD but that destroyed several installation attempts in the last few days.

So, is it still possible to install Windows on the unused partition? I mean I know it is, but can it be fixed after the install? I've already tried it and I keep failing, so what am I doing wrong?

Oh and one last thing, Windows 8.1 refuses to use a NTFS formatted partitions that was done by gparted. I was forced to delete the partition gparted created and let Windows recreate it itself. That was the ONLY way Windows would install on the second partition, otherwise it threw up a Warning message that it was corrupt or invalid or something, lol. Man this is difficult haha
 
Last edited:
First, Thanks to Sydney for posting this! I have successfully installed Ubuntu 14.04 and Win7 on a new build with a RAID-1 pair of 1TB drives. I updated the original posting for what I was able to do (Email me if you want the PDF version):

My system is based on an ASUS motherboard which came with the AMD RAID controller. The information below is from my experience with this setup – your experience may vary.

Code:
This is a guide explaining how to dual boot Windows and Linux off a single RAID array. The original author did this on a RAID-0 array and I did this on a RAID-1 array but it should work with all types. 

A. 	Set up your SATA configuration to RAID in BIOS, save and exit.

1. 	After the POST screen, a RAID configuration screen should be visible, prompting you to press a key to enter the configuration (CTRL+I/CTRL+F, etc). Set up your RAID configuration - this varies between motherboards, so I suggest refer to your motherboard manual.
You should now have a working RAID array. Mine was simply pairing two 1TB drives into a RAID-1 configuration.

B.	Define disk partitions

Against the common procedure, we have to install Linux before Windows. This is because Windows partitions the array in a way Linux can't read, but Windows can read the Linux partitioning.

   1.	Boot from Ubuntu 14.04 Installation CD.

   2. 	Select ‘Try Ubuntu”.  This is also referred to as the ‘Live CD’.

   3. 	Open up a terminal and enter this command:
        [B]sudo apt-get update[/B]
       (If you are using another kind of RAID than RAID0 or RAID1 you may need to execute this command: 
        [B]sudo modprobe dm-raid4-5)[/B]

   4. 	Identify your RAID’s unique Linux device id by entering this command:
        [B]sudo dmraid -ay[/B]
 	
If everything is right, your RAID array should show up. I got a message saying it was already enabled, which is good.  

Your RAID array will be identified as “/dev/mapper/<your-RAID-id>”.  In the rest of your guide, substitute what yours is called where you see “<your-RAID-id>”.

   5. 	Prepare a plan for the disk partitions.  An example for a 1TB storage space:
        (1)	100MB Windows boot loader (NTFS)
        (2)	200GB EXT4 for Ubuntu installation
        (3)	16GB swap drive (see table above)
        (4)	200GB Windows (NTFS)
        (5)	Remainder of drive set up for data set to NTFS and ultimately sharable by both OSes

   6. 	Set up the partitioning using gparted:
        [B]sudo gparted[/B]
	In the top right field, choose your RAID id.  I do not believe this process will work if you choose any other device.

    7. 	Now select your RAID array, <your-RAID-id>. Right click on it and hit "new", this should prompt you to create a partition table. Create the table as 'msdos', which will be selected by default. Now right click and "new" again and create an EXT3 or EXT4 partition for your Ubuntu installation. Others have NOT recommended setting up a separate boot partition - they couldn't get it to boot properly. 
 
	Also, setup a swap partition based on these recommended sizes:

	RAM 	                Rec. swap space 	               Rec. swap space if allowing for hibernation
        <=2GB 	        2 times the amount of RAM 	3 times the amount of RAM
        >2GB & <=8GB 	Equal to the amount of RAM 	2 times the amount of RAM
        >8GB & <=64GB 	At least 4 GB                	1.5 times the amount of RAM
        > 64GB       	At least 4 GB               	Hibernation not recommended

Check current practices for placement of the Linux swap partition – I was successful with this partition adjacent to the Ubuntu partition.

    8. 	Now create an NTFS partition on the rest of the drive (or multiple partitions as per your plan).  I created a 100MB PRIMARY partition before the Extended partition.

    9. 	Apply the settings and close gparted. 

C.	Install Ubuntu

    1. 	Start the Ubuntu installation by clicking the desktop icon.

    2.	Install as you normally would, and when you get to the partitioning, choose ‘Something Else’ to select partitions.  Select the EXT4 you intend to use for Ubuntu, select ‘Change’, and select the button to format it and set it the root (/).  Also, check your intended swap partition to insure it is designated as ‘linux swap’ – change this if necessary.

    3.	If at any time you are asked to "Install GRUB", unselect it. We will install grub manually later.  During my installation of Ubuntu 14.04, I did not encounter this.

    4. 	Finish installing Linux.  

D.	Install Windows

    1.	Boot from the Windows installation CD/DVD.
    2. 	You must specify where you want Windows installed – do not accept the default installation location.  When the installation process asks, select the partition on your RAID array that you setup for Windows. It should install without problems because it was set up correctly as NTFS.
	I encountered an error during Windows 7 installation during a couple of my attempts that said the Windows installer could not find or create a ‘system partition’.  If you encounter this error, use the Windows installer’s partition manager to delete this 100MB partition and define a new at the same location.  Your installation will continue to completion.

E.	Install & Repair the grub boot loader

	Caveat: I was unable to get my machine to boot successfully to the ‘grub’ menu  at the conclusion of steps 1 – 10 as written here but as you see in step 11, using ‘boot-repair’ did give me a system that booted to the ‘grub’ menu and did successfully start both Ubuntu and Windows 
7.  I’m not sure of the value of these steps but suggest you follow them until someone else can share a better experience. 

   1.	When Windows has finished installing, boot the Ubuntu installation CD/DVD and again select “Try Ubuntu”.

   2. 	Fetch the latest updates:
    	[B]sudo apt-get update[/B]

   3. 	Now mount the new Linux install.  Note that here, and later, you specify the partition id, which will be your RAID-identifier with a number after it.  In the partition map shown earlier, my partition number was ‘1’.
       [B]sudo mount /dev/mapper/<your-RAID-id&partition#> /mnt/[/B]

   4. 	Bind your /dev, /proc and /sysfs, copy over the resolv.conf, then chroot into it.
        [B]sudo mount --bind /dev /mnt/dev/
        sudo mount -t proc proc /mnt/proc/
        sudo mount -t sysfs sys /mnt/sys/
        sudo cp /etc/resolv.conf /mnt/etc/resolv.conf 
        sudo chroot /mnt[/B]

   5. 	Now install grub
        [B]apt-get update
        apt-get install grub[/B]  <NOTE: Might not be required – will say if already installed>

   6. 	Create the GRUB directory
        [B]mkdir /boot/grub/[/B]  <NOTE: Might not be required – will say if already created>

   7. 	Copy over the GRUB files to the new grub folder
        [B]cp /usr/lib/grub/x86_64-pc/* /boot/grub/[/B]
        (Replace x86_64-pc with your architecture if you are using something else than AMD64)
   
    8. 	Now run grub
    	[B]grub[/B]

        And type these commands
        [B]device (hd0) /dev/mapper/<your-RAID-id&partition#>
        find /boot/grub/stage1
        root (hd0,0)
        setup (hd0)[/B]
    	
        This is assuming that your RAID array is the first drive in the BIOS, and will override your MBR.  Everytime I tried this sequence of commands, an error message came up during the 'setup'.  I forged ahead.

	  If 'find /boot/grub/stage1' shows something else than 0,0, for example 1,0, then do 'root (hd1,0)

    9. 	Now you can create a menu.lst by running
        [B]update-grub[/B]

  10. 	And assuming that you set up windows as the second partition on the RAID array you can add it to GRUB by editing menu.lst
        [B]nano /boot/grub/menu.lst[/B]

        And at the bottom of the file, add:
        [B]title                 Windows
 	rootnoverify (hd0,1)
 	makeactive
        chainloader +1[/B]

    If you are running a different RAID than 0 or 1 do this
    	[B]echo dm-raid4-5 >> /etc/initramfs-tools/modules
    	update-initramfs -u[/B]
    	Then add dm-raid4-5 to /etc/modules:
    	[B]nano /etc/modules[/B]

  11.	After running these steps, the ‘grub’ menu would not appear after booting – I would see Windows only.  Recommendations I found suggested trying ‘boot-repair’, a simple and graphical tool to fix grub issues.  I did this and my system successfully booted to the grub menu.  

	Install boot-repair with these commands in a Ubuntu terminal (from the installation CD/DVD):

        [B]sudo add-apt-repository ppa:yannubuntu/boot-repair
        sudo apt-get update
        sudo apt-get install -y boot-repair
        boot-repair[/B]

        Do all that boot-repair suggests.

  12.	After fixing the booting process with boot-repair, I found that one entry on my grub menu was booting to a dead screen (with two odd characters displayed).   I loaded ‘grub-customizer’ and was easily able to remove the bad menu item.  It can also offer other tools to help you customize your grub installation safely.  Follow these steps to install grub-customizer:

        [B]sudo add-apt-repository ppa:danielrichter2007/grub-customizer
        sudo apt-get update
        sudo apt-get install grub-customizer[/B]


You should now be able to boot into both Linux and Windows residing on the same RAID array when prompted in GRUB.
 
Last edited by a moderator:
Thanks for following up. Can you please please please format this better use [/code] tags and other tools such as headings, different font sizes etc. As it stands now your reply is very hard to read

Thanks
 
Done. I originally pasted from a Word document I was using to document my successes (and failures...) and this didn't bring over the document's format very well. I also have this in a PDF doc - is there a way to upload the PDF doc and attach it to this entry?

Thanks!
 
Personally I dont get why you guys are bothering to RAID an OS disk.. There is a reason most commercial servers have a single internal disk speciffically for the OS and the rest are external hot-swap drives. If you are going to bother to RAID two disks they 1) should never be RAID 0 unless you are doing it for fun. Lose one disk and lose the data on both (Striping is fun..) and 2) if you are bothering to RAID the disks, put your OS on a non RAID disk and your data on the array and again NO RAID 0. It is far easier to reload the OS on a single disk and the OS IS NEVER considered critical data. Dont want to lose that TB worth of games? RAID 1 (or 5 for data integrity) and put it in its own array.
And please dont tell me a software RAID is faster... Unless you are spinning 10/15k disks you are not going to see marked improvement. Also pointless: RAID array SSD for speed...
Maybe I just work with servers too much..
 
Personally I dont get why you guys are bothering to RAID an OS disk..
Maybe I just work with servers too much..

Servers are the key reason to have RAID on the OS disk. If you need up time you raid your OS disks otherwise you blow an OS disk and there is down time associated.

I know I know there are config management tools to help you rebuild things but in the event where you need to have up time, this doesn't cut it. If you are a small operation and dont have spare disks kicking around and/or the loss of the OS means you send people home for the afternoon while you reinstall your OS, launch the config management tool(s), validate the data and bring things back up... thats a HUGE cost compared to an extra $300 to RAID-1 your OS... seems like a no brainer to me
 
Zakarro Banned from thread. :(

I have cleaned up the mess that this thread became, through no fault than he who has been banned from it. Thank you all for your impressive patience dealing with it. If you see similar posting in other threads, don't hesitate to report it.
 
Back