PDA

View Full Version : [SOLVED] booting installation to hardware raid



deesto
September 13th, 2010, 09:57 PM
I've just finished booting my system via Live CD, and installing 10.04-1 to existing partitions on a hardware RAID. The install went fine but when I rebooted I didn't get past the BIOS output screens.

I used four existing partitions for the install: /home (MyRAID3, which was kept as-is), / (MyRAID2, which was reformatted) , /boot (MyRAID1, also reformatted) and swap.


ubuntu@ubuntu:/$ ls -l /dev/mapper/
total 0
crw-rw---- 1 root root 10, 59 2010-09-13 20:06 control
brw-rw---- 1 root disk 252, 0 2010-09-13 20:40 isw_eagjcbhhdi_MyRAID
brw-rw---- 1 root disk 252, 1 2010-09-13 20:38 isw_eagjcbhhdi_MyRAID1
brw-rw---- 1 root disk 252, 2 2010-09-13 20:06 isw_eagjcbhhdi_MyRAID2
brw-rw---- 1 root disk 252, 3 2010-09-13 20:06 isw_eagjcbhhdi_MyRAID3
brw-rw---- 1 root disk 252, 4 2010-09-13 20:06 isw_eagjcbhhdi_MyRAID5
brw-rw---- 1 root disk 252, 5 2010-09-13 20:06 isw_eagjcbhhdi_MyRAID6

ubuntu@ubuntu:/$ sudo fdisk /dev/mapper/isw_eagjcbhhdi_MyRAID

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): p

Disk /dev/mapper/isw_eagjcbhhdi_MyRAID: 1500.3 GB, 1500299395072 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003e2da

Device Boot Start End Blocks Id System
/dev/mapper/isw_eagjcbhhdi_MyRAID1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/mapper/isw_eagjcbhhdi_MyRAID2 64 26173 209715200 83 Linux
/dev/mapper/isw_eagjcbhhdi_MyRAID3 26173 39227 104857600 83 Linux
/dev/mapper/isw_eagjcbhhdi_MyRAID4 39228 50454 90180847 5 Extended
/dev/mapper/isw_eagjcbhhdi_MyRAID5 39228 40011 6291456 82 Linux swap / Solaris
/dev/mapper/isw_eagjcbhhdi_MyRAID6 40012 50454 83883366 83 Linux
ubuntu@ubuntu:/$ cat /myraid/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd2,2)'
search --no-floppy --fs-uuid --set 10946159-42ff-4fca-a24e-76ae337ca5f3
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set 93733999-1ed6-4daa-a78d-d6bec9909629
set locale_dir=($root)/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set 93733999-1ed6-4daa-a78d-d6bec9909629
linux /vmlinuz-2.6.32-24-generic root=UUID=10946159-42ff-4fca-a24e-76ae337ca5f3 ro quiet splash
initrd /initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set 93733999-1ed6-4daa-a78d-d6bec9909629
echo 'Loading Linux 2.6.32-24-generic ...'
linux /vmlinuz-2.6.32-24-generic root=UUID=10946159-42ff-4fca-a24e-76ae337ca5f3 ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.32-24-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set 93733999-1ed6-4daa-a78d-d6bec9909629
linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set 93733999-1ed6-4daa-a78d-d6bec9909629
linux16 /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###



I've read through some tutorials on getting the raid picked up on boot, but I keep getting stuck:


ubuntu@ubuntu:/$ sudo apt-get install dmraid
Reading package lists... Done
Building dependency tree
Reading state information... Done
dmraid is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
ubuntu@ubuntu:/$ sudo dmraid -ay
RAID set "isw_eagjcbhhdi_MyRAID" already active
RAID set "isw_eagjcbhhdi_MyRAID1" already active
RAID set "isw_eagjcbhhdi_MyRAID2" already active
RAID set "isw_eagjcbhhdi_MyRAID3" already active
RAID set "isw_eagjcbhhdi_MyRAID5" already active
RAID set "isw_eagjcbhhdi_MyRAID6" already active


What else do I need to do in order to get grub to boot from my RAID-ed boot partition?

Thanks!

ronparent
September 14th, 2010, 02:07 AM
You didn't say where you wanted the grub bootloader. Unless you have another hd on the computer, in your case it would have to go on /dev/mapper/isw_eagjcbhhdi_MyRAID. Often, with 10.04, even if you know where to put it and select that location in step 8 of 8 during the installation will fail anyhow. This is fixable. See this reference: https://help.ubuntu.com/community/Grub2#Reinstalling GRUB 2

The easiest way and the one that usually works ins to start the live cd and open a terminal. In the terminal, on your system, you would enter in order:


sudo mount /dev/mapper/isw_eagjcbhhdi_MyRAID1 /mnt
or ...MYRAID2 if that was your install if you hadn't used a boot partition.

sudo grub-install --root-directory=/mnt/ /dev/mapper/isw_eagjcbhhdi_MyRAID

On reboot everything should boot fine. Good luck.):P

deesto
September 14th, 2010, 01:56 PM
Thanks ron! This got me started, and the grub install completed without errors from the live CD, but rebooting brought me directly to the grub rescue shell. I see this in the wiki page you linked:

Grub shows rescue prompt (and does not continue to boot)
You may have a buggy bios and the location of your /boot/* files is not under the 1024 cylinder boundary. Create a small partition on the beginning of the disk, ... and here I think I'm stuck, as I can't repartition the RAID.

Also played around with the shell, and saw that (hd0,1)/ contains boot/, grub/, and the kernel and image files, where I think grub expects to find them instead in (hd0,1)/boot/grub/. When I do a `set prefix=(hd0,1)/boot/grub/` and then `ls boot` the results are empty, but `ls (hd0,1)/boot/grub/` returns a list of many modules and files, so maybe I just have the syntax wrong?

ronparent
September 14th, 2010, 05:30 PM
(hd0,1)/ is the /boot for your system. Therefore what would normally be /boot/grub in a normal install, in your case becomes /grub on (hd0,1).

It would have been simpler in your case to have not had the /boot in a separate partition since there is no particular reason you need it.

And I do think I errored. The instruction to mount the filesystem to MyRAID1 I think resulted in /boot/grub being written to (hd0,1). As a simple remedy you might try copying all the files in /boot/grub to /grub on that drive. If I am correct, that should allow you to boot to the grub menu.

v1ad
September 14th, 2010, 05:43 PM
sounds like a fake raid. google fakeraid howto

ronparent
September 14th, 2010, 05:46 PM
V1ad - Last I checked, the fakeraid howto had not been updated for 10.04 and wasn't much help. Your right, it is a fakeraid.

deesto
September 14th, 2010, 08:29 PM
(hd0,1)/ is the /boot for your system. Therefore what would normally be /boot/grub in a normal install, in your case becomes /grub on (hd0,1).
OK; thanks. But something still isn't right:

> ls
(hd0) (hd0,6) (hd0,5) (hd0,3) (hd0,2) (hd0,1) (fd0)
> ls (hd0,1)/grub
[... lots of output]
> ls (hd0,2)/
[... lots of output]
> set prefix=(h0,1)/grub
> set root=(h0,2)
> ls /boot
[empty output]
> ls /
[... lots of output]

It would have been simpler in your case to have not had the /boot in a separate partition since there is no particular reason you need it.Quite possible. But after raiding the disks, I installed Fedora, and thus eventually ended up with a separate /boot partition, as their installer requires a bit more space than usually needed in boot in order to install/upgrade. I don't want to lose my current /home partition. But maybe I should re-install and let Ubuntu's installer delete /boot and install everything in `/`?


And I do think I errored. The instruction to mount the filesystem to MyRAID1 I think resulted in /boot/grub being written to (hd0,1). As a simple remedy you might try copying all the files in /boot/grub to /grub on that drive. If I am correct, that should allow you to boot to the grub menu.Will try that; thanks. Perhaps that's why the above grub instructions aren't working.

Edit: unfortunately, that didn't work: I copied both /boot and /boot/grub from the boot partition to the root partition, but both times a reboot ended up back at the grub console.


sounds like a fake raid. google fakeraid howto
Yes, that's here (and one of the articles from which I'd started before posting to the forum):
https://help.ubuntu.com/community/FakeRaidHowto


V1ad - Last I checked, the fakeraid howto had not been updated for 10.04 and wasn't much help. Your right, it is a fakeraid.
Right: last update was for that how-to was for 9.10, and I got stuck while using it yesterday.

deesto
September 14th, 2010, 09:46 PM
I gave in: re-installed Ubuntu, during which I deleted the /boot and / partitions on the raid and created a new / in their place. It boots just fine now, no problems. Would be nice to understand why the grub edits didn't work, but certainly not critical now. Thanks.

ronparent
September 15th, 2010, 02:38 AM
Glad to hear that the immediate problem is solved. I'll have to look into implications of how the separate boot works - could need it someday.

Have fun.

deesto
September 15th, 2010, 09:57 PM
Glad to hear that the immediate problem is solved. I'll have to look into implications of how the separate boot works - could need it someday.Me too, and with my luck, I'll need it sooner than later ;) Thanks.