Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: Using a newer version of dmraid/mdadm with genkernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
danomac
l33t
l33t


Joined: 06 Nov 2004
Posts: 818
Location: Vancouver, BC

PostPosted: Sun Aug 07, 2011 12:55 am    Post subject: HOWTO: Using a newer version of dmraid/mdadm with genkernel Reply with quote

HOWTO: Using a newer version of dmraid/mdadm with genkernel

After a lot of head-scratching I discovered that mdadm kept marking my arrays as faulty. I wound up having to use genkernel to build an initramfs with new versions of mdadm/dmraid as genkernel is using moldy old versions (2007!) I never did find any documentation on how to do this with genkernel, so I figured I'd post it in here.

Known Issues / Notes

1. dmraid-1.0.0-16-r3 is broken at the time of this writing.


Prerequisites

You'll need to install the new versions on your install first:

Code:

echo "sys-kernel/genkernel ~amd64" >> /etc/portage/package.keywords
echo "sys-kernel/dmraid ~amd64" >> /etc/portage/package.keywords
echo ">=sys-fs/dmraid-1.0.0_rc16-r3" >> /etc/portage/package.mask
echo "sys-fs/mdadm **" >> /etc/portage/package.keywords
emerge -a dmraid mdadm
cp /usr/portage/distfiles/dmraid-1.0.0.rc16.tar.bz2 /var/cache/genkernel/src
cp /usr/portage/distfiles/mdadm-3.2.1.tar.bz2 /var/cache/genkernel/src


That should install dmraid-1.0.0.rc16 and (at the time of this writing) mdadm-3.2.1.

Building the new kernel

Start by editing /etc/genkernel.conf:

Code:

MENUCONFIG="yes"
MAKEOPTS="-j7"
DMRAID="yes"
DMRAID_VER="1.0.0.rc16"
MDADM_VER="3.2.1"


(Set MAKEOPTS to something suitable for your processor!)

Then emerge a new kernel (make sure you've got the required stuff already built in to the kernel):

Code:

# genkernel all


It'll pop up menuconfig, make sure these are built-in to the kernel (NOT modules):

Code:

CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_LINEAR=y
CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y
CONFIG_MD_RAID10=y
CONFIG_MD_RAID456=y
CONFIG_MD_MULTIPATH=y
CONFIG_BLK_DEV_DM=y
CONFIG_DM_SNAPSHOT=y
CONFIG_DM_MIRROR=y
CONFIG_DM_ZERO=y
CONFIG_DM_MULTIPATH=y


It should build with no issues.

Finishing up

Add your new entry to /boot/grub/grub.conf. Don't forget the dodmraid option!


Last edited by danomac on Sun Aug 07, 2011 12:58 am; edited 1 time in total
Back to top
View user's profile Send private message
danomac
l33t
l33t


Joined: 06 Nov 2004
Posts: 818
Location: Vancouver, BC

PostPosted: Sun Aug 07, 2011 12:56 am    Post subject: Reply with quote

Hopefully this helps someone. It took me almost four weeks of on and off experimenting to get my raid working. :(
Back to top
View user's profile Send private message
Double
Apprentice
Apprentice


Joined: 23 Apr 2004
Posts: 250
Location: Kislovodsk, Russia

PostPosted: Mon Dec 05, 2011 1:00 pm    Post subject: Use RAID and genkernel Reply with quote

Thanks for your notices, but now it's seem little easy:
Code:

echo "sys-kernel/genkernel ~amd64" >> /etc/portage/package.keywords
echo "sys-kernel/dmraid ~amd64" >> /etc/portage/package.keywords
echo ">=sys-fs/dmraid-1.0.0_rc16-r3" >> /etc/portage/package.mask
echo "sys-fs/mdadm **" >> /etc/portage/package.keywords
emerge -a dmraid mdadm
cp /usr/portage/distfiles/dmraid-1.0.0.rc16.tar.bz2 /var/cache/genkernel/src
cp /usr/portage/distfiles/mdadm-3.2.1.tar.bz2 /var/cache/genkernel/src

Now it's not needed.
I`am use mdadm and configure genkernel only :
Code:

cat /etc/genkernel.conf
....
# Add DMRAID support.
# DMRAID="no"
....
MDADM="yes"
....
MDADM_CONFIG="/etc/mdadm.conf"
....
MDADM_VER="3.1.4"
....
# Specify a default for real_root=
REAL_ROOT="/dev/md2"


Code:

emerge mdadm
genkernel all

:)
Back to top
View user's profile Send private message
danomac
l33t
l33t


Joined: 06 Nov 2004
Posts: 818
Location: Vancouver, BC

PostPosted: Tue Dec 06, 2011 7:56 pm    Post subject: Reply with quote

I'm aware the devs do change the version from time to time. This article is about using a newer version of mdadm/dmraid that's not currently being used by genkernel.

Back when I needed to use a newer version they were using a much older version.

For example you can use these directions for using newer mdadm ebuilds > 3.1.4, which do exist but are not used by default in genkernel.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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