| View previous topic :: View next topic |
| Author |
Message |
yarug Tux's lil' helper

Joined: 01 Dec 2004 Posts: 84
|
Posted: Wed Jun 04, 2008 9:51 pm Post subject: [SOLVED] Software RAID1 and LVM2 with 2 SATA disks kernel pa |
|
|
Hi,
I'm reinstalling an AMD64 Sun Fire X2100 and want to use a software RAID mirror (RAID1) on 2 SATA disks. I've followed the instructions from these resources:
http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?full=1
http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Software_RAID_mirror_and_LVM2_on_top_of_RAID
http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml
I'm using genkernel. I've compiled the genkernel using genkernel --install --lvm2 --dmraid all.
When it is time to reboot into the new installation, I get the following message at startup:
md: Autodetecting RAID arrays.
md: Scanned 0 and added 0 devices.
md: autorun ...
md: ... autorun DONE.
After which I get a kernel panic as the boot process cannot find a root partition (I believe it thinks my cd-rom drive is now /dev/sda).
My /etc/fstab:
| Code: | # /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency). It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#
# <fs> <mountpoint> <type> <opts> <dump/pass>
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/md1 /boot ext2 noauto,noatime 1 2
/dev/md2 none swap sw 0 0
/dev/md3 / reiserfs noatime 0 0
/dev/vg/usr /usr reiserfs noatime 0 0
/dev/vg/home /home reiserfs noatime 0 0
/dev/vg/opt /opt reiserfs noatime 0 0
/dev/vg/var /var reiserfs noatime 0 0
/dev/vg/tmp /tmp reiserfs noatime 0 0
/dev/dvd /mnt/dvd auto noauto,user,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
# NOTE: The next line is critical for boot!
proc /proc proc defaults 0 0
# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0 |
Here is my /boot/grub/grub.conf:
| Code: | default 0
timeout 9
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title=Gentoo Linux 2.6.24
root (hd0,0)
kernel /boot/kernel-genkernel-x86_64-2.6.24-gentoo-r8 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/md3 udev vga=0x318 video=vesafb:mtrr:3,ywrap dodmraid dolvm initrd /boot/initramfs-genkernel-x86_64-2.6.24-gentoo-r8
|
A few specific questions:
1) Is it dolvm or dolvm2 in the grub kernel command?
2) Should I include dodmraid or not?
3) Should I include doscsi?
4) Should I include any modules like md, raid1 or dm-mod in /etc/modules.autoload.d/kernel-2.6?
5) Is /dev/md3 the correct value for real_root?
Can anyone help me find out what I may have overlooked?
Many thanks,
Nes
Last edited by yarug on Thu Jun 05, 2008 6:55 pm; edited 1 time in total |
|
| Back to top |
|
 |
drescherjm Advocate

Joined: 05 Jun 2004 Posts: 2722 Location: Pittsburgh, PA, USA
|
Posted: Wed Jun 04, 2008 10:59 pm Post subject: |
|
|
| Quote: | | 1) Is it dolvm or dolvm2 in the grub kernel command? |
If the raid is not on top of lvm there is no need to do that.
| Quote: |
2) Should I include dodmraid or not? |
You do not have dmraid but do have mdraid.
Drop the --dmraid and replace it with --mdadm
| Quote: | | 4) Should I include any modules like md, raid1 or dm-mod in /etc/modules.autoload.d/kernel-2.6? |
This will not help. Compile the md, raid1 and the sata driver into the kernel.
| Quote: | | 3) Should I include doscsi? |
No.
| Quote: | | 5) Is /dev/md3 the correct value for real_root? |
Yes /dev/md3 is the real_root
Are your drives partitioned such that the type of the raid volumes is fd? _________________ John
My gentoo overlay
Instructons for overlay |
|
| Back to top |
|
 |
yarug Tux's lil' helper

Joined: 01 Dec 2004 Posts: 84
|
Posted: Wed Jun 04, 2008 11:13 pm Post subject: |
|
|
Hi drescherjm, thank you for your reply. Here are the answers to your questions (and some more questions from me):
| Quote: | If the raid is not on top of lvm there is no need to do that.
|
The LVM2 is on top of the RAID1. I.e. /dev/md4 is used by LVM2.
| Quote: | You do not have dmraid but do have mdraid.
Drop the --dmraid and replace it with --mdadm |
You mean when running genkernel? I.e. the genkernel command should be genkernel --install --lvm2 --mdadm --menuconfig all? Then use menuconfig to make sure MD, RAID1 and SATA are compiled into the kernel?
| Quote: | | Are your drives partitioned such that the type of the raid volumes is fd? |
Yes, all 4 partitions (incl. swap) are fd.
I will try with the new genkernel command!
Regards,
Nes |
|
| Back to top |
|
 |
drescherjm Advocate

Joined: 05 Jun 2004 Posts: 2722 Location: Pittsburgh, PA, USA
|
Posted: Thu Jun 05, 2008 3:00 am Post subject: |
|
|
| Quote: | I.e. the genkernel command should be genkernel --install --lvm2 --mdadm --menuconfig all? Then use menuconfig to make sure MD, RAID1 and SATA are compiled into the kernel?
|
First make sure you have a valid /etc/mdadm.conf
Then
| Code: | | genkernel --install --lvm2 --mdadm --menuconfig all |
And make the md, raid1 and sata driver compiled into the kernel.
BTW, I assume when it does not boot you get a prompt that says you can not mount root and asks you for the root or shell
if you type shell you can
cat /etc/partitions
and cat /proc/mdstat
to see what drives are available. This has helped me dozens of times fix these kinds of problems. _________________ John
My gentoo overlay
Instructons for overlay |
|
| Back to top |
|
 |
yarug Tux's lil' helper

Joined: 01 Dec 2004 Posts: 84
|
Posted: Thu Jun 05, 2008 11:17 am Post subject: |
|
|
Yes, I have a valid (I hope!) /etc/mdadm.conf. I installed the new genkernel, but won't be able to reboot until I get to the datacenter tonight (need to take the live cd out). Fingers crossed.
ps: It didn't fall back (or provide an option to fall back) to a prompt when the boot process stopped at kernel panic.
Thanks again. Will let the forum know how it went.
Nes |
|
| Back to top |
|
 |
drescherjm Advocate

Joined: 05 Jun 2004 Posts: 2722 Location: Pittsburgh, PA, USA
|
Posted: Thu Jun 05, 2008 12:55 pm Post subject: |
|
|
Is your initrd line in grub on a second line and not on the same line as the kernel?
It should be:
| Code: | efault 0
timeout 9
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title=Gentoo Linux 2.6.24
root (hd0,0)
kernel /boot/kernel-genkernel-x86_64-2.6.24-gentoo-r8 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/md3 udev vga=0x318 video=vesafb:mtrr:3,ywrap dodmraid dolvm
initrd /boot/initramfs-genkernel-x86_64-2.6.24-gentoo-r8 |
The video part is on the same line as the kernel but wrapped here. _________________ John
My gentoo overlay
Instructons for overlay |
|
| Back to top |
|
 |
yarug Tux's lil' helper

Joined: 01 Dec 2004 Posts: 84
|
Posted: Thu Jun 05, 2008 6:54 pm Post subject: |
|
|
It was all on one line!
Thank you so much. I would never have spotted that.
The corrected grub.conf:
| Code: | default 0
timeout 9
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title=Gentoo Linux 2.6.24
root (hd0,0)
kernel /boot/kernel-genkernel-x86_64-2.6.24-gentoo-r8 root=/dev/ram0 init=/linuxrc ramdisk=8192 udev real_root=/dev/md3 dolvm lvmraid=/dev/md1,/dev/md2,/dev/md3,/dev/md4 vga=0x318 video=vesafb:mtrr:3,ywrap
initrd /boot/initramfs-genkernel-x86_64-2.6.24-gentoo-r8
|
That, together with the lvm2 and mdadm options for the genkernel and compilling in mdadm and lvm2 got the system going:
| Code: | | genkernel --install --lvm2 --mdadm --menuconfig all |
I can boot into the machine now. A few minor things to clean up, but I can continue now.
Many thanks for your support!
All the best,
Nes |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|