LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   lvm 2 device-mapper (http://www.linuxquestions.org/questions/linux-newbie-8/lvm-2-device-mapper-129549/)

Kroenecker 12-28-2003 01:46 PM

lvm 2 device-mapper
 
I have tried to compile the lvm device-mapper both into my 2.6.0 kernel and as a module, but I dont have /proc/lvm when I am finished.

I can see the modules being made when I run make in the source directory.

I cant find dm-table, dm-linear, etc when everything is done.

Anyone else struggled with LVM using the new kernel?

hw-tph 12-28-2003 01:52 PM

Mmm, this is just a longshot as I haven't tried it with the 2.6 series yet, but have you inserted the modules (and are they active when you do an lsmod?)?

Sorry if I offended you by asking this, but it's hard to tell the level of acquantaince posters have with stuff. :)

Håkan

Kroenecker 12-28-2003 07:37 PM

I was going to ask you about how to make the /dev/mapper/control which is missing everytime I try to use LVM2, but then I took a second to google ;) and found this:

http://www.redhat.com/archives/fedor.../msg01117.html

I suppose that this is my solution since when I try to make logical volumes I get the error:

/dev/mapper/control: open failed: No such file or directory
Is device-mapper driver missing from kernel?

Anyway when you try LVM2, I hope that this link helps. I havent tried it yet, but it looks like my solution.

hw-tph 12-29-2003 08:04 AM

Thanks! I'm rebuilding my old desktop as a server and I'm popping in a handful of old HD's that I have scattered around my apartment. It should come in handy. :)

Håkan

Kroenecker 12-29-2003 12:19 PM

hw-tph,

YO. I finally found the solution (let me say it again...i think ;)

You see I was getting the following error whenever I tried to make a logical volume on one of my volume groups...

" /dev/mapper/control : open failed : No such file or directory .
Is device mapper mapped to kernel ? "

So anyway I found the info below in the sistina pipermail forums. If it is any help to anyone else trying out LVM2, thats cool!

#############################################

Did you compile device mapper as a module or into the kernel?

Here I have compile them into the kernel directly. You must add this =
line into your /etc/modules.conf:

post-install dm-mod /etc/rc.d/init.d/devmap_mknod.sh

And the script /etc/rc.d/init.d/devmap_mknod.sh is next:

#! /bin/sh

# Startup script to create the device-mapper control device
# on non-devfs systems.
# Non-zero exit status indicates failure.

# These must correspond to the definitions in device-mapper.h and dm.h
DM_DIR=3D"mapper"
DM_NAME=3D"device-mapper"

set -e

DIR=3D"/dev/$DM_DIR"
CONTROL=3D"$DIR/control"

# Check for devfs, procfs
if test -e /dev/.devfsd ; then
echo "devfs detected: devmap_mknod.sh script not required."
exit
fi

if test ! -e /proc/devices ; then
echo "procfs not found: please create $CONTROL manually."
exit 1
fi

# Get major, minor, and mknod
MAJOR=3D$(sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices)
MINOR=3D$(sed -n "s/^ *\([0-9]\+\) \+$DM_NAME\$/\1/p" /proc/misc)

if test -z "$MAJOR" -o -z "$MINOR" ; then
echo "$DM_NAME kernel module not loaded: can't create $CONTROL."
exit 1
fi

mkdir -p --mode=3D755 $DIR
test -e $CONTROL && rm -f $CONTROL

echo "Creating $CONTROL character device with major:$MAJOR =
minor:$MINOR."
mknod --mode=3D600 $CONTROL c $MAJOR $MINOR

With that everything works fine. If you use them as a module, I'm not =
sure, but I think that you will have to add it into your rc.local, or =
create a startup script for devmap_mknod.sh, but I'm not really sure =
about that.
:p :p

###########################################

So I am almost positive that this is it because I have not compiled devfs into my kernel. I specifically remember not selecting it since we can always use lspci. Well, I might try compiling it in now just to see if it fixes things or maybe I will go ahead and use the above. Let you know. (Im a geek. Free time during the holidays...what do you expect?)

Later


All times are GMT -5. The time now is 07:42 PM.