Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Thursday, September 23, 2010

fakeRAID and ubuntu

This Section shows you how to install Ubuntu using the Ubiquity graphical installer found on the Live CD.
  1. If you need more information about any given read any of the additional information below
  2. Boot the Live CD
  3. Open a terminal
  4. Enter the following commands
    • (skip the first one if you are doing RAID 0 or 1)
    1. $ sudo modprobe dm-raid4-5
    2. $ sudo apt-get install -y dmraid
    3. $ sudo swapoff -a
      • disables erroneous use of the backing swap partitions if you are reinstalling
    4. $ sudo dmraid -ay
  5. Now check that you can view the partitions in the raid array with this command
    1. $ ls -l /dev/mapper/
      • OUTPUT:
        control             isw_beeaakeeaa_five
        we will be using the array /dev/mapper/isw_beeaakeeaa_five in this example.
  6. Create partitions on your raid array with your preferred partition manager, or do so using the partitioning tool provided in ubiquity (partitioning with ubiquity installer have not been tested)
    1. $ sudo cfdisk /dev/mapper/isw_beeaakeeaa_five
  7. We used /dev/mapper/isw_beeaakeeaa_five5 partition as Ubuntu root partition in this example.
  8. Begin the install process
    1. If doing a guided install make sure you select the raid partition. if you are going to do a manual install make sure you do not create a partition on any of the disks that make up the raid partition.
    2. On the last step before installing, click the Advanced options and uncheck the install boot loader option. We will install grub (the boot loader later).
    3. After installer finishes, close ubiquity installer without rebooting the machine.
  9. Install dmraid and grub in your new Ubuntu installation:
    1. $ sudo mount /dev/mapper/isw_beeaakeeaa_five5 /target/
      • 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/isw_beeaakeeaa_five
      2.  grub> find /boot/grub/stage1 
        • OUTPUT:
          find /boot/grub/stage1
        • make a note of the output from this command it will be needed later. in my case I have my linux partition as the first extended 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
          • grub> setup (hd'x','x') to install grub on the partition.
      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') Replace the 'x' with the partition that was found earlier
      2. Add the Windows boot entry if need be.
        title                 Windows
          rootnoverify (hd0,0)   # use the correct partition for Windows, of course
          chainloader +1
      3. For all Ubuntu-related boot entries, such as
        title         Ubuntu ...
           root          (hd0,0)
        change (hd0,0) to (hd'x','x') (in my case, 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
  10. 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
  11. Reboot and verify both Ubuntu and the existing Windows partition boot if Windows is installed.

No comments: