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!

Sunday, November 6, 2011

Install (zet old) ubuntu on fakeraid

As far as I know Grub 2 doesn't work with RAID yet (February 16th, 2010). That's why we have to deal with setting up Grub Legacy here in the first place!
Source by gilson585
This is how I installed 9.10 karmic onto a stripped fakeraid Raid 0 array. These instructions may or may not work for a mirrored raid 1 array, I have gotten limited feedback on this. All you really need is the LiveCD and an internet connection. The steps outlined here are used after Ubuntu has been installed but fails to boot. Just load the LiveCD environment and follow these steps. Mind you this may be a daunting task to a person new to Ubuntu but if you have any command line experience you should be fine. I made this how-to cause I felt many others were lacking in some areas. I had searched around the net and found bits and pieces to make this work and thought how nice to have it all in one spot so here it is. ##Note this works on ext4 w/o any patch, 9.10 no longer requires install via Alternate CD as the LiveCD has dmraid included, also note fdisk does not work well with dmraid use gparted instead.
1. Open a terminal: Applications, Accessories, Terminal.
2. Create a mounting point
sudo mkdir /mnt/root
3. ls /dev/mapper
In this example the output would have shown "nvidia_cffbdeda, nvidia_cffbdeda1, nvidia_cffbdeda2" where nvidia_cffbdeda is the hdd. All the others listing a # on the end are the partitions. If you don't know what partition is the root of your installation check out gparted. I will use nvidia_cffbdeda1 in the following steps as an example for mounting and chrooting into the installation.
4. Mount the installation
sudo mount /dev/mapper/nvidia_cffbdeda1 /mnt/root
*If this fails use nautilus (thunar in xbuntu) to mount your Ubuntu root partition then use mount to find the mount location. This location will be used in place of /mnt/root in the following steps.
sudo mount --bind /dev /mnt/root/dev
sudo mount -t proc proc /mnt/root/proc
sudo mount -t sysfs sys /mnt/root/sys
sudo mount -t devpts devpts /mnt/root/dev/pts
sudo cp /etc/resolv.conf /mnt/root/etc/resolv.conf
5. Login into the installation
sudo chroot /mnt/root /bin/bash
6.Fetch most recent package lists
apt-get update
7. Remove GRUB2
apt-get purge grub2 grub-pc
rm -r /boot/grub
##The system will be unbootable until another bootloader is installed.
8. Install GRUB 0.97
apt-get install grub
grub-install /dev/mapper/xxx ##note please substitute your hdd in this line (mine would have been nvidia_cffbdeda)
9. At this point it may be a good idea to check the device.map
chmod 777 /boot/grub/device.map##For write access
nano /boot/grub/device.map
Mine was incorrect and I changed it to:
(fd0) /dev/fd0
(hd0) /dev/mapper/nvidia_cffbdeda ##was listed as /dev/sda which is incorrect
(hd1) /dev/sdc
Afterwards use this to restore file permissions
chmod 744 /boot/grub/device.map
If changes were made then re-run grub-install
10. grub --no-curses ##you will now be at the grub prompt##
grub> device (hdx) /dev/mapper/xxx ##note please substitute your hdd in this line
grub> find /boot/grub/stage1 ##make a note of the output it is used in the next step
grub> root (hdx,y) ##(hdx,y) where x is the drive (most likely 0) and y is the partition (first partition would be 0 NOT 1)
setup (hdx)
quit
update-grub
##When prompted to generate a menu.lst file say yes
13. Run these commands to keep it from upgrading automatically:
echo "grub hold" | sudo dpkg --set-selections
echo "grub-common hold" | sudo dpkg --set-selections
14. Reboot
As much as I have tried to make this guide complete it seems to not work for some people and anyhelp I can get in making this guide complete is much appreciated. Namely Raid 1 issues.
Step 10 problems arise when you don't specify the correct device for (hd0)
BIOS boot order can also affect this step so make sure it's correct
In some extreme cases it's necessary to remove other hard drives from the sys as some cheap motherboards lack the understanding of fakeraid and tell grub IDE devices boot first. Thus effectively installing grub to the wrong disk in some cases.
=======================
Install with this tuto by cedric.driard
https://help.ubuntu.com/community/Fa...20installer%29
MAKE SURE YOU BACK UP ANYTHING OF IMPORTANCE!!!
This Section shows you how to install Ubuntu using the Ubiquity graphical installer found on the Live CD.

  1. Modify the bios to boot on the Live CD
  2. Begin the install process
    • creat the raid partition for ubuntu.
    • 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).
    • After installer finishes, close ubiquity installer and reboot the machine.
  3. Start on the Live CD where you choose use Ubuntu without any change
  4. Open a terminal
  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_fivewe will be using the array /dev/mapper/isw_beeaakeeaa_five in this example.
      • We used /dev/mapper/isw_beeaakeeaa_five5 partition as Ubuntu root partition in this example.
  6. Install dmraid and grub in your new Ubuntu installation:
    1. $ sudo mkdir /mnt/root
    2. $ sudo mount /dev/mapper/isw_beeaakeeaa_five5 /mnt/root/
      • if this fails maybe the /target directory is already mounted if not then some debuging will be required.
    3. $ sudo mount --bind /dev /mnt/root/dev/
    4. $ sudo mount -t proc proc /mnt/root/proc/
    5. $ sudo mount -t sysfs sys /mnt/root/sys/
    6. $ sudo cp /etc/resolv.conf /mnt/root/etc/resolv.conf
    7. $ sudo chroot /mnt/root/
    8. # apt-get update
    9. # apt-get install -y dmraid
    10. # apt-get install -y grub
    11. # mkdir /boot/grub
    12. # cp /usr/lib/grub/i386-pc/* /boot/grub/
    13. # 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
          (hd0,4)
        • 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
          or
          • grub> setup (hd'x','x') to install grub on the partition.
            YOU WILL NEED ANOTHER BOOT MANAGER TO START YOUR COMPUTER
      5. grub> quit
    14. # update-grub
      • say yes to creating a menu.lst
    15. 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
        makeactive
        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.
    16. # update-grub
  7. 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
  8. Reboot
  9. Modify the bios to boot on your HDD
  10. Start and verify both Ubuntu and the existing Windows partition boot if Windows is installed.

=======================
I have successfully installed Ubuntu x64 9.10 (Karmic Koala) on a fakeraid 1 (mirror) volume following this thread. Thank you very much for this clear and easy How-to.
Despite of this, I have some comments to do:
Introduction: use gparted to create the partitions on your fakeraid volume (I've used ext4); run the installation; on the advanced options select "No grub installation"; after installation you can begin the process.
1. No comments.
2. No comments.
3. No comments.
4. No comments.
5. No comments.
6. No comments.
7. No comments.
8. After installing legacy GRUB 0.97, you will need to copy the stage files to the /boot/grub directory. If you do not, point 10 will fail. Thus,
apt-get install grub
cp /usr/lib/grub{/architecture}/stage1 /boot/grub
cp /usr/lib/grub/{architecture}/stage2 /boot/grub
cp /usr/lib/grub/{architecture}/{partition_type}_stage1_5 /boot/grub

9. Check /boot/grub/device.map. The file permissions should be 644.
grub-install /dev/mapper/{fakeraid_volume}
10. Don't know why, but I had to manually edit /boot/grub/menu.lst to point correctly to the booting partition.
13. Here "sudo" is not needed.
echo "grub hold" | dpkg --set-selections
echo "grub-common hold" | dpkg --set-selections

14. No comments.
------------------------
Worked for me (mb = xfx sli 750a, fakeraid 1)
- assumes you configure an internet link off your live cd/usb
1) Create RAID array via BIOS (I've only tested this with RAID-1 but RAID-0 should also work)
2) Boot the live 9.10 CD
3) Terminal -> 'sudo dmraid -r' and 'sudo dmraid -s' both report the mirror looks OK.
4) Run through installer, installed OS onto RAID-1 array
- manually created 2 partitions, swap and /
- unchecked the install boot loader via advanced options on the last screen
5) Mount your install and login,
Terminal,
sudo mkdir /mnt/root
ls /dev/mapper

In this example the output would have shown "nvidia_cffbdeda, nvidia_cffbdeda1, nvidia_cffbdeda2" where nvidia_cffbdeda is the hdd. All the others listing a # on the end are the partitions. If you don't know what partition is the root of your installation check out gparted. I will use nvidia_cffbdeda1 in the following steps as an example for mounting and chrooting into the installation.
sudo mount /dev/mapper/nvidia_cffbdeda1 /mnt/root
*If this fails use nautilus (thunar in xbuntu) to mount your Ubuntu root partition then use mount to find the mount location. This location will be used in place of /mnt/root in the following steps.
sudo mount --bind /dev /mnt/root/dev
sudo mount -t proc proc /mnt/root/proc
sudo mount -t sysfs sys /mnt/root/sys
sudo mount -t devpts devpts /mnt/root/dev/pts
sudo cp /etc/resolv.conf /mnt/root/etc/resolv.conf
sudo chroot /mnt/root /bin/bash
6) Install Grub2 from Lucid
apt-get purge grub2 grub-pc
apt-get update
apt-get dist-upgrade
mv /etc/apt/sources.list /etc/apt/sources.bak
echo deb http://archive.ubuntu.com/ubuntu lucid main
greatherthensymbolhere /etc/apt/sources.list
apt-get update
apt-get install grub-common
apt-get install grub-pc

- select default options, pick your RAID array for the boot device in the last screen of the setup
upgrade-from-grub-legacy
7) Confirm grub version...
grub-install -v
(should report back 1.98)
8) Hold packages
echo "grub-common hold" | debconf-set-selections
echo "grub-pc hold" | debconf-set-selections

9) Restore sources.list
mv /etc/apt/sources.list.bak /etc/apt/sources
apt-get update

10) Reboot

Nice to know this is/will be worked out for 10.04.
------------------------
Everything worked GREAT on my ASRock ION 330 HT-BD with just following two changes / corrections:
8. Hold packages
echo "grub-common hold" | dpkg --set-selections
echo "grub-pc hold" | dpkg --set-selections
9) Restore sources.list
mv /etc/apt/sources.bak /etc/apt/sources.list
apt-get update
------------------------
Code:
sudo update-grub
While will create the menu.list

Also you need to run:
Code:
grub-install /dev/mapper/nvidia_dhfedfae5
Which looks like it will fail, but will generate the device.map for you to edit.
updated my device.map to be the follwing configuration:
Code:
root@ubuntu:/boot/grub# cat device.map
(fd0) /dev/fd0
(hd0) /dev/mapper/nvidia_dhfedfae #was /dev/sda
(hd1) /dev/sdb
Which looks to be correct.
If I attemt to run grub-install, I get:
Code:
/boot/grub# sudo grub-install /dev/mapper/nvidia_dhfedfae
/dev/mapper/nvidia_dhfedfae does not have any corresponding BIOS drive.
  went back to the original FakeRaidHowTo guide
And realised you could NOT do a grub-install. So instead, copied over the files from cp /usr/lib/grub/{your-cpu-arch}-pc/
From there I could run through the grub console section perfectly.
The only change I needed to make was in my menu.lst, it had set up Ubuntu under (hd0,0), when in fact, it is (hd0,4). Easy enough to fix.
----------------------------------
Pretty hacker workaround
-I ran the Ubuntu Alternate installer (regular one doesn't work with my video card)
-Got to the point where it drops out of the install due to grub2 install failure.
-Went thru steps in post one, but as installer is running, chrooting to /target
-moved my /etc/apt/sources.list to /etc/apt/sources.bak
-created new sources.list with
deb http://cz.archive.ubuntu.com/ubuntu lucid main
-apt-get update
-apt-get install grub-pc

Worked like a charm, I was able to select my nvidia raid instance instead of /dev/sd0 /dev/sd1. Secret is grub2 that comes with 9.10 is 1.97beta4 or something, lucid had 1.98 stable =)
----------------------------------
I've read somewhere that the ICH10R chipset and its built-in raid is somewhat flaky in linux. Not sure why it had worked in 9.04 but not 9.10 in your case. I'm gonna take a wild guess here but I would like to believe dmraid can't make sense out of the metadata defining your array. The only way to prove that would be start the array from scratch. I'm sure you dont want to backup all your data and try that just to get linux, I don't blame you. Maybe wait a lil while longer for 10.04 and see if that works for you. It may also be that the command used for device is not english on your sys try typing help at the GRUB CMD line.
-----------------------------------
SOLVED! Use cedric.driard instructions in post #40 instead of post #1.
http://ubuntuforums.org/showpost.php...2&postcount=40
Just skip part 7 if you are on 10.04 A2.
And also Run these commands to keep it from upgrading automatically:
echo "grub hold" | sudo dpkg --set-selections
echo "grub-common hold" | sudo dpkg --set-selections
-----------------------------------
Grub v1.98 has been released for ubuntu 10.04 - it fixes various RAID issues.
burg is another possibilty
for a quick chat on burg and RAID
http://ubuntuforums.org/showthread.php?t=1378951
and burg in general
http://ubuntuforums.org/showthread.php?t=1195275 Section 8
or http://ubuntuforums.org/showthread.php?t=1371288
=====================
If windows doesn't boot, try to make a fixmbr (I do it many times during trying install Ubuntu in fakeraid and it worked all the time and take 5 minutes)
Boot on windows CD
choice installation
F6 to install raid driver
choice R for repair
at the terminal
choice your HDD where is windows
write : fixmbr
write a new mbr, say yes
======================
I executed the following with no apparent problem:
# grub --no-curses
1. jon grub  shell:
device (hd0) /dev/mapper/{my-raid-device-root-partition}
--------------------------------------
Succesfull multiboot installation of 9.10 and windows 7 on a RAID 1. This after 3 days of installing all kind of combinations of installations of 9.4 CD, 9.4 alternate CD, 9.10 and 9.10 alternate and W7.
My procedure:
1. I have a MSI P45 Neo 3 MB with 2 harddisc
2. In the Bios I setup a fakeraid 1 for these 2 drives giving 40 GB of space.
3. I installed W7 in a 20 GB partition and after several reboots checked that it was working OK
4. I started the Ubuntu 9.10 Desktop version as a life CD, This CD was downloaded today.
5. On the desktop I started the icoon Install Ubuntu
6. In the partitioning windows I specified Manual
  In the Freespace under the line /dev/mapper/isw.... I added
  15 GB Ext4 mountpoint /
   4 GB swap Note that /dev/mapeer/isw.. is show automatically, eg the raid 1 disk is recognized and treated properly in the installer
7. I complete the installation of 9.10
8. After the reboot Grub (and not Grub2) presented itself without W7
9.  In a Terminal sudo update-grub made no difference, file /boot/grub/menu/lst was not changed.
10. In a Terminal sudo gedit. With File, Open I went to map Filesystem/boot/grub.
      I opened menu.lst, copied from examples the # lines for windows to the end of the file -1 line, removed the # and filled in the partition number so :
title Windows 95/98/NT/2000
root (hd0,2)
makeactive
chainloader +1
### END DEBIAN AUTOMAGIC KERNELS LIST


Note that the partition number must be the 100 MB partition not the W7 installation partition

11. After saving and reboot I can now start or Ubuntu of W7

No comments: