How-to Install 9.10 karmic on fakeraid
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.
Re: How-to Install 9.10 on fakeraid
Thanks! Finally a guide that has all the steps listed in one location. The last time I did this I had to span a handful of websites to get all the information.
Re: How-to Install 9.10 on fakeraid
Hi Gilson,
Why dont you add the karmic entry to the wiki community docs?
Re: How-to Install 9.10 on fakeraid
Thanks for the suggestion danwood, I will as soon as I get a lil more feedback. Probably in the next few days.
Re: How-to Install 9.10 on fakeraid
I'm going to be testing this out tonight/tomorrow. If this works you'll be my next best friend.
I've been fighting this all day long, its been driving me crazy.
Thanks for putting in the effort.
Re: How-to Install 9.10 on fakeraid
Thanks for the post Gilson, unfortunately I get the same error as the Howto for Jaunty. I am using an Intel ICH9 FakeRaid.
On step 10
Quote:
10. grub --no-curses ##you will now be at the grub prompt##
grub> device (hdx) /dev/mapper/nvidia_cffbdeda ##note this is the hdd not a partition
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)
setup (hdx)
quit
I get "unspecified something something" before getting the grub prompt. And I also cannot do a find on stage 1, as I get "error: 15 file not found" even when the file is under /boot/grub ...
I would really like to get this solved soon, but I fear I may have to wait for Lucid Lynx.
Re: How-to Install 9.10 on fakeraid
I'm sorry to hear that jpichie. Can you post the output of ls /dev/mapper, your device.map, and the entire terminal session of the steps above. I'll review it and see what I can find.
Re: How-to Install 9.10 on fakeraid
Quote:
grub> device (hdx) /dev/mapper/nvidia_cffbdeda ##note this is the hdd not a partition
I suspect the device/mapper/nvidia_ field in the commads is incorrect for Intel ICH9 fake raid. Unfortunately, I don't know the correct device name but it could be a clue to guide your googling.
--wally.
Re: How-to Install 9.10 on fakeraid
Yes that would very much so cause his problem. Although I was just using that as an example, I may have to change it to make things a lil clearer.
Re: How-to Install 9.10 on fakeraid
I'm attempting to run this now, and I'm hitting a bit of a snag.
I'm getting to step 8, and something seems to be going wrong when I run 'sudo apt-get install grub'
Code:
root@ubuntu:/# sudo apt-get purge grub2 grub-pc
sudo: unable to resolve host ubuntu
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package grub2 is not installed, so not removed
The following packages will be REMOVED:
grub-pc*
0 upgraded, 0 newly installed, 1 to remove and 159 not upgraded.
After this operation, 1,786kB disk space will be freed.
Do you want to continue [Y/n]? y
Can not write log, openpty() failed (/dev/pts not mounted?)
(Reading database ... 116539 files and directories currently installed.)
Removing grub-pc ...
Purging configuration files for grub-pc ...
Processing triggers for man-db ...
root@ubuntu:/# sudo apt-get install grub
sudo: unable to resolve host ubuntu
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
grub-doc mdadm
The following NEW packages will be installed:
grub
0 upgraded, 1 newly installed, 0 to remove and 159 not upgraded.
Need to get 903kB of archives.
After this operation, 1,974kB of additional disk space will be used.
Get:1 http://au.archive.ubuntu.com karmic/main grub 0.97-29ubuntu59 [903kB]
Fetched 903kB in 4s (183kB/s)
Preconfiguring packages ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Selecting previously deselected package grub.
(Reading database ... 116356 files and directories currently installed.)
Unpacking grub (from .../grub_0.97-29ubuntu59_amd64.deb) ...
Processing triggers for man-db ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up grub (0.97-29ubuntu59) ...
If I then go to /boot/grub, there is nothing in there:
Code:
root@ubuntu:/boot# cd grub
root@ubuntu:/boot/grub# ls
root@ubuntu:/boot/grub#
Which makes me believe that something has gone wrong installing grub. Do I need to install dmraid or something when I'm under chroot?
Another quick question - Should step 9 read:
Code:
sudo chmod 777 /boot/grub/device.map
Since we're still under chroot? (or could it just be 'nano /boot/grub/device.map' without any change to the permissions?)
Either way, thanks for the help. I think my problem may lie in something going wrong with installing grub. I will continue my investigation, but appreciate any advise you may have.