tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[GSOC 2008] update: lvm project



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi folks,

Current NetBSD lvm status:

a) device-mapper driver status
I have implemented new proplib ioctl interface. With this new interface
I have been able to drop dm-ioctl.h header file(GPL2 licensed file), from
driver.

My driver is in current state able to create/remove logical volumes wtih lvm2tools.

b) lvm2tools and libdevmapper

I have ported these two linux software packages to NetSBSD. In libdevmapper, I have added two files libdm_netbsd.c and libdm-nbsd-iface.c. libdm_netbsd.c file translate linux struct dm-ioctl to proplib dictionary and back. In current state
lvm2tools and libdevmapper can manipulate logical volumes.


My current was committed to NetBSD cvs repository. I have created my own branch
haad-dm where I have tagged sys/ and external/ directories.

You can update your source to haad-dm with these commands

cd /usr/src

cvs up -dfP -r haad-dm sys/ external/

Add 'pseudo-device dm' to kernel config. Build new kernel. Build tools in external/gpl2 and install them. With lvm2tools and libdevmapper installed you can manipulate logical volumes.


How to manage lvm witl linux lvm tools short introducition.

More information can be found here [1], [2], [3].

Before you can create a logical-volume you have to mark you physical disk space as LVM
useable this is done with pvcreate utility.

lvm pvcreate /dev/rsd1a /dev/rsd0a etc..

When you have created Physical volumes you can add them to Volume Group.
For Volume Group creation there is vgcreate command.

lvm vgcreate {volume_group_name} [physical_volumes_paths /dev/rsd1a]

other volume group commands:
lvm vgextend
    vgremove

Logical volumes belongs to Volume Groups and can use only disk space available in their Volume group(adding new physical-volume to volume group is easy). For logical volume creating there is lvcreate command. It needs some parameters to create Logical Volume -n [name] -L[size] and Volume-group to which LV belongs.

lvcreate -L1G -n [Logical volume name] {volume_group_name}

After successful lvcreate run there should be /dev/{volume_group_name}/ [Logical volume name] device created. There should be 2 devices raw/block. Because of lacking support for disklabel
info ioctls, newfs have to be run with parameters -F and -s.

newfs -F -s [size] /dev/{volume_group_name}/r[Logical volume name]

mount /dev/{volume_group_name}/[Logical volume name] /mnt

and you can use it.

After reboot vgchange -a y command will read and enable all Logical volumes in system.
It must be run before you try to mount them!

I have created and uploaded NetBSD -current install CD for i386 with lvm and device-mapper
enabled GENERIC kernel. You can found this iso here [4].

My future plans:

a) I want to look at snapshot device-mapper target
b) Possible integration of our existing code to device-mapper.
(use code from raidframe to get mirror, stripe targets done, or call/ compile
raidframe source to device-mapper).
c) testing, testing and testing.

[1] http://people.redhat.com/agk/talks/FOSDEM_2005/
[2] http://people.redhat.com/agk/talks/LVM2-LinuxTag2006/
[3] http://www.tldp.org/HOWTO/LVM-HOWTO/index.html
[4] http://ftp.netbsd.org/pub/NetBSD/misc/haad/i386cd.iso


Regards

Adam.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFIfdHQlIxPgX3Go0MRAgccAKCCU/fThup+V2eVct7H0N5042f3lACeOiR3
PranIp7R77JZdnTdwBBGu/s=
=ZcPc
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index