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.
Editors Note: This guide is for intermediate to advanced users, already comfortable with installing linux and issuing commands in a terminal
Why “fake” raid?
There are three ways to control a RAID array: by 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. 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 lets 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 lets the southbridge control the array, and therefore both Windows and Linux can see and use the array.
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, prompting 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.
Editors note: This guide uses apt-get commands assuming your using Ubuntu, or an apt based distribution.
4. Boot up the live session.
5. Open up a terminal and type in these commands:
~$ 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
~$ sudo modprobe dm-raid4-5
6. Now, execute this command:
~$ 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):
~$ 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 4 GB of RAM, I recommend creating a 4 GB SWAP partition at the end of the drive. Now your partitioning scheme should look like this:
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 created 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; 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:
~$ sudo apt-get update
~$ sudo apt-get install dmraid
19. Now mount the new Linux install:
~$ 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:
~$ 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:
~$ apt-get update
~$ apt-get install dmraid grub
22. Create the GRUB directory:
~$ mkdir /boot/grub/
23. Copy over the GRUB files to the new grub folder:
~$ cp /usr/lib/grub/x86_64-pc/* /boot/grub/
(Replace x86_64-pc with your architecture if you are using something other than AMD64)
24. Now run grub:
~$ grub
And type these commands, replacing isw_dejihacffa_raid1 with the name of your RAID:
grub> device (hd0) /dev/mapper/isw_dejihacffa_raid1
grub> find /boot/grub/stage1
grub> root (hd0,0)
grub> 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:
~$ 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:
~$ nano /boot/grub/menu.lst
And at the bottom of the file, add:
title Windows
rootnoverify (hd0,1)
makeactive
chainloader +1
And if you are running a different RAID than 0 or 1 do this:
~$ echo dm-raid4-5 >> /etc/initramfs-tools/modules
~$ update-initramfs -u
Then add [code]dm-raid4-5[/code] to /etc/modules:
~$ 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.
Sydney @ Overclockers Forums
No comments:
Post a Comment