10.04 Updates to "Fake Raid How To" needed?

Asked by Bart Chandler on 2010-05-20

Can the "Fake Raid How To" documentation be updated for version 10.04?

I had to use a mix of solutions from the page https://help.ubuntu.com/community/FakeRaidHowto

Of course... fixing the installer so it can handle dmraid devices and partitions would be a plus ;)... as would fixing the GRUB install so that it correctly installs to the virtual device I defined..... would make all of the following headache go away. ;)

In general I had to follow these instructions for the live CD installation, for my NVIDIA Raid 5 array in order to dual boot with a pre-existing windows installation.

Ubuntu 10.04

The automatic installer may or may not work out of the box. When I tried it, it didn't work for a variety of reasons. The problem appears to be the installer not handling dmraid virtual disks correctly, as well as issues installing grub2 to the virtual disk.

Use the LiveCD method

* Boot the system with the Live CD
10.04 loads dmraid automatically so you should see a disk device via the df command, or "ls -l /dev/mapper. My NVIDIA showed up as:
     nvidia_ehcjahgf
     nvidia_ehcjahgf1 (My Windows XP Primary Partition)

* Run the partitioner program gpartd (System->Gpart)
;;Gpart did not see the NVIDIA RAID at all, and the System>Administration>Disk Utility could not read the architecture of My 750G Virtual Drive until I had created the partitions from the installer. So what I had to do was:
       1. Run the Live CD install until it failed attempting to format the ext4 partitions I created
       2. Quit the install and load System>Administration>Disk Utility
       3. Select The Disk that represented My NVIDIA RAID5 Array and format the new partitions correctly (ext4, and swap)
       4. Reboot the system with the live CD and restart the installation

if dmraid detected and can use a fakeraid partition

* Setup your partitions (as oulined in the preceding 4 steps) using whatever space your going to allocate for Ubuntu or the entire drive. Setup a minimum of 2 partitions (logical, or primary as per your needs keeping i mind the maximum of 4 total primary+extended partitions allowed per disk), the first will be formatted ext4 and the last swap. Set the type on the swap partition to swap. Format the all of your newly created partitions for the appropriate file systems (ext4, swap). REBOOT using the Live CD before continuing to the next step.

;; My NVIDIA Array now looks like this after the reboot.

        ~$ ls -l /dev/mapper
        total 0
        crw-rw---- 1 root root 10, 59 2010-05-20 05:08 control
        brw-rw---- 1 root disk 252, 0 2010-05-20 05:08 nvidia_ehcjahgf (The virtual disk)
        brw-rw---- 1 root disk 252, 1 2010-05-20 05:10 nvidia_ehcjahgf1 ( My windows Partition)
        brw-rw---- 1 root disk 252, 3 2010-05-20 05:08 nvidia_ehcjahgf2 (Ubuntu '/')
        brw-rw---- 1 root disk 252, 4 2010-05-20 05:08 nvidia_ehcjahgf5 (Ubuntu '/home')
        brw-rw---- 1 root disk 252, 5 2010-05-20 05:08 nvidia_ehcjahgf6 (Ubuntu 'swap')

* Run the installer. When it gets to it's partitioner, change the mount point on the first partition to / . If you created any other partitions you will need to define their mount points as well.
;;DO NOT format ANY partitions in the virtual disk! Do NOT make any partition changes! The installer partitioner DOES NOT understand, and can not format dmraid partitions properly!!

* In the installer summary screen right before the copy process starts, click the Advanced button. Change the boot device (this is the MSDOS-style "parent" partition not the Linux partitions) to "/dev/mapper/nvidia_ehcjahgf" (or whatever dmraid lists as your fakeraid device) Make sure the checkbox is clicked to boot from this disk. note that the installer will modify grub2 to point to the correct logical partition /dev/mapper/nvidia_ehcjahgf2 or whatever partition '/' is on in your particular case.

;; The installer attempted and failed to install GRUB to /dev/sda (one of the physical RAID drives) regardless of whether i selected /dev/mapper/nvidia_ehcjahgf (the virtual disk), /dev/mapper/nvidia_ehcjahgf1 (the windows boot partition) , or /dev/mapper/nvidia_ehcjahgf2 (the Ubuntu '/' partition). I saw the same results using both primary and logical partitions.

;; The failed attempt to install grub on /dev/sda did not damage my RAID Array, but did result in a fatal installation error and an opportunity to finish the install without installing GRUB. You will need to select this option, and install the boot loader manually before rebooting the system.

* When the installer finishes DO NOT REBOOT, the new system will be mounted on /target. If you rebooted then run the terminal screen and mount the /dev/mapper/nvidia_ehcjahgf2 (root) partition (this is the target the installer put the root on) on some convenient directory (/tmp/tmp or some such)

;;Because of the failed GRUB install the new system may be mounted 'read only'. If this is the case you will need to unmount /dev/mapper/nvidia_ehcjahgf2 (root) and remount it to a convenient directory (/tmp/tmp or some such)

;; from this point on, I had to follow the instructions for manually installing GRUB as Follows:

-------------- Install dmraid and grub in your new Ubuntu installation:

   1. $ sudo mount /dev/mapper/nvidia_ehcjahgf2 /target/ (or some other convenient directory)
;; if this fails maybe the /target directory is already mounted if not then some debuging will be required. If any more information can be provided related to this issue place add your knowledge to this document

   2. $ sudo mount --bind /dev /target/dev/

   3. $ sudo mount -t proc proc /target/proc/

   4. $ sudo mount -t sysfs sys /target/sys/

   5. $ sudo cp /etc/resolv.conf /target/etc/resolv.conf

   6. $ sudo chroot /target/

   7. # apt-get update

   8. # apt-get install -y dmraid

   9. # apt-get install -y grub

  10. # mkdir /boot/grub

  11. # cp /usr/lib/grub/x86_64-pc/* /boot/grub/

  12. # grub --no-curses you will now be at the grub prompt grub>
         1. grub> device (hd0) /dev/mapper/nvidia_ehcjahgf

         2. grub> find /boot/grub/stage1
                * OUTPUT:
                  find /boot/grub/stage1
                  (hd0,1)
                * make a note of the output from this command it will be needed later. in my case I have my linux (root) partition as the second primary partition. You most likely will have different results (remember that grub starts partition numbers in zero, so partition 5 for linux is partition 4 for grub).

         3. grub> root (hd'x','x')
                * replace 'x' with the partition number from the previous step

         4. Install grub on your disk (or partition if you prefer boot your computer with another boot manager)
               1. grub> setup (hd'x')
                      * replace 'x' with the values gathered in the previous step
                  or
               1. * grub> setup (hd'x','x') to install grub on the partition.
                        YOU WILL NEED ANOTHER BOOT MANAGER TO START YOUR COMPUTER

         5. grub> quit

  13. # update-grub
          * say yes to creating a menu.lst
  14. now open the newly created menu list and make the following changes. Any editor can be used it is not required that you use nano # nano /boot/grub/menu.lst
         1. Change
                # groot=(hd0,0) TO # groot=(hd0,'x')
                  root option in the boot entries to root (hd0,'x') Replacing the 'x' with the partition that was found earlier
         2. Add the Windows boot entry if need be.
              title Windows (whatever version you have)
              rootnoverify (hd0,0) # use the correct partition for Windows, of course
              makeactive
              chainloader +1

         3. For all Ubuntu-related boot entries, such as

               title Ubuntu ...
               root (hd0,1)
               ...

            change (hd0,0) to (hd'x','x') (in my case (hd0,1), as my Linux partition was not the first one, and without these changes I would get grub "Error 17" after reboot). You can use the uuid of the mapped raid partition in a grub menu.lst uuid field instead of the root (hd'x','x') field; look in /dev/disk/by-uuid with 'ls -l'.
         4. Save and exit nano. or what ever text editor you are using.

  15. # update-grub

-------------------- make sure the new install of Ubuntu loads the raid module kernel

   1. # echo dm-raid4-5 >> /etc/initramfs-tools/modules

   2. # update-initramfs -u

   3. # nano /etc/modules
          * and add 'dm-raid4-5' if not exists

------------- Reboot and verify both Ubuntu and the existing Windows partition boot if Windows is installed.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2010-05-20
Last reply:
2010-05-20
Tom (tom6) said : #1

Hi :)

It seems that you know quite a lot about this so it would be really great if you go up to the top right-hand side of the page & click on "Login to Edit" and then edit the page yourself. It uses the same login as your Launchpad account. There are some guides available and when you go to the bottom of the page and click on "Show Editing Options" you will seee a couple of links to some of those help pages. Don't worry too much tho because people do keep checking what the latest edits have been and might even help tidy-up to keep your edits in style.

Good luck and regards from
Tom :)

Tom (tom6) said : #2

Hi again :)

Err i just realised which page you were asking about. There are quite a few pages about dealing with Raided Drives and it would be good to see some of these linking to each other. Usually there are 2 sections at the bottom of pages "Links" & "External Links", hmm well usually something like that, usually just 1 section dealing with all links.

Also notice the search feature in the very top right. I got these results for a search about Raid
https://help.ubuntu.com/search.html?cof=FORID%3A9&cx=004599128559784038176%3Avj_p0xo-nng&ie=UTF-8&q=Raid&sa=Search

Good luck and regards from
Tom :)

Can you help with this problem?

Provide an answer of your own, or ask Bart Chandler for more information if necessary.

To post a message you must log in.