Search:  
Gentoo Wiki

HOWTO_LVM

This article is still a Stub. You can help Gentoo-Wiki by expanding it.

Contents

Introduction

LVM quick HOWTO. This is what I find the easiest and fastest way to set up LVM2 (without too much trouble) Also, check out the LVM howto in the gentoo-documentation:
http://www.gentoo.org/doc/en/lvm2.xml

Kernel Configuration

First off, we will need to add some stuff to the kernel.

Manual Configuration

Go to the source directory and get into the configuration.

# cd /usr/src/linux && make menuconfig
Linux Kernel Configuration: LVM Configuration
Device Drivers  --->
 Multi-device support (RAID and LVM)  --->
  <*>   Device mapper support 
     < >     Crypt target support 
     < >     Snapshot target (EXPERIMENTAL) 
     < >     Mirror target (EXPERIMENTAL) 
     < >     Zero target (EXPERIMENTAL)
     < >     Multipath target (EXPERIMENTAL) 
     < >     Bad Block Relocation Device Target (EXPERIMENTAL) 

If you would would rather like to compile it as a module, go ahead. Keep in mind, if your root filesystem is on a LVM, you'll need to put the modules in your initramfs. (Have fun with that) Recompile and then you will need to reboot if you compiled it into the kernel.

Tip: If you don't want to use the module (because initramfs gives you the creeps) but you don't fancy rebooting either. Do this: Compile it in the kernel first.

# cd /usr/src/linux && make

Let it finish. Go back into the configuration and change it to be compiled as module.

# cd /usr/src/linux && make modules
  CC [M]  drivers/md/dm.o
  CC [M]  drivers/md/dm-table.o
  CC [M]  drivers/md/dm-target.o
  CC [M]  drivers/md/dm-linear.o
  CC [M]  drivers/md/dm-stripe.o
  CC [M]  drivers/md/dm-ioctl.o
  CC [M]  drivers/md/dm-io.o
  CC [M]  drivers/md/kcopyd.o
  LD [M]  drivers/md/dm-mod.o
 Building modules, stage 2.
  MODPOST
  CC      drivers/md/dm-mod.mod.o
  LD [M]  drivers/md/dm-mod.ko

You can remove the module next time you rebooted :) (and change it in the configuration too) Next do the module installation.

Module installation

/usr/src/linux # make modules_install
 INSTALL drivers/md/dm-mod.ko
 [...]
/usr/src/linux # modprobe dm-mod

That should be it.

Genkernel Configuration

I don't know anything about this (evil) program.

Installing lvm user tools

This is quick:

# emerge lvm2

Getting some help

Next I would like to present a extreem nice piece of perl scripting called webmin. Just install it running

# emerge webmin
# /etc/init.d/webmin start

Check the setting in the file /etc/webmin/miniserv.conf

File: /etc/webmin/miniserv.conf
 # ...
 listen=10000
 # ...
 

Browse to https://localhost:10000 with your favorite Web browser. Login as root with your safe password.

Skip to the hardware section > Logical Volume Management

You can configure about anything from here. (Partitions can be made and changes using cfdisk or fdisk)

Retrieved from "http://www.gentoo-wiki.info/HOWTO_LVM"

Last modified: Mon, 08 Sep 2008 06:38:00 +0000 Hits: 9,628