Навигация
Главная
Поиск
Новости
Статьи
ЧаВо
- - - - - - -
Файловый архив
Ссылки
Авторизация
Кто он-лайн

 

 
Главная arrow Статьи arrow FreeBSD, Linux, ... arrow GEOM класс для поддержки LVM2 во FreeBSD
GEOM класс для поддержки LVM2 во FreeBSD Версия для печати
Написал Ярослав Гасов   
16.03.2010

Share this!

Информация от 2008-02-12: 

 

Andrew Thompson разработал GEOM модуль geom_lvm для доступа к LVM2 (Logical Volume Manager, менеджер логических томов Linux) разделам из FreeBSD. Код сразу был включен в состав FreeBSD-HEAD.

 

В настоящее время geom_lvm поддерживает чтение метаданных для линейных "stripe" разделов, сегменты которых разнесены на разные диски. Создание и изменение LVM2 разделов не реализовано. После загрузки geom_lvm (geom_lvm_load="YES" в loader.conf или пересборка ядра с "options GEOM_LVM"), LVM2 разделы отображаются в виде устройств /dev/lvm/группа-логический_раздел, например, /dev/lvm/vg0-home. Список доступных разделов можно посмотреть командой "geom lvm list".

 

 

 

Опция для ядра:

 

options         GEOM_LINUX_LVM

 

 

(ДАЛЕЕ РЕДАКТИРОВАНИЕ МАТЕРИАЛА НЕ ЗАКОНЧЕНО...)

 

Remove invalid LVM volumes and mappings:

 

If you do not remove invalid LVM volumes, the "multipath -F" command will not release the invalid /dev/mapper/mpath* ones.

Before, you must move the /var/lib/multipath/bindings to another place. The file is useful for cluster setups, mostly, when all hosts must have same bindings to avoid confusion.
If you do not move it, old parameters will be read again,

# mv /var/lib/multipath/bindings /var/lib/multipath/bindings.bak
The following command, will remove the LVM mappings that do not exist anymore, and are inactive, allowing "multipath -F" to release them and allowing re-mappings.
Clean the LVM ghost mappings similarly to the example:
# dmsetup remove grupo1-labpostfix--exp--02
 
Configure /etc/lvm/lvm.conf :

Search for a similar snippet as the example below. But adapt it for your host, as it may have another local volumes outside the SAN.

# This is an example configuration file for the LVM2 system. 
# By default we accept every block device: 
# AFM 16oct2009 trying to filter duplicate volumes allowing only dm 
#filter = [ "a/.*/" ] 
#    filter  = [ "a|/dev/dm(\-[0-9])|", "r/sd.*/"   , "r|.*|" ] 
# AFM 22oct2009 use correct multipath devices instead of dm-X     filter = [ "a|^/dev/mapper/mpath.*|" , "r|.*|" ]

There are some useful commands to identify and remove invalid LVM volumes.

STUDY the man pages. You must use them ONLY if there are invalid mappings, and being extremely careful with such powerfull commands.

# vgreduce --test --removemissing vg01 
# dmsetup ls --tree 
# dmsetup info grupo1-lvstripe14 
# dmsetup info mpath0 
# dmsetup targets 
# dmsetup table --target multipath mpath0 
# dmsetup table --target striped grupo1-lvstripe14

Immediately after, you must generate a new initrd boot image.

# update-initramfs -u
 
 
 
The multipath tools daemon command line is too slow for correct mappings of all devices at the device-mapper.
Therefore, is not enough to execute:
debian:~:# invoke-rc.d multipath-tools restart

or

[centos]:# service multipathd restart

You MUST execute the following sequence:

debian:~# invoke-rc.d multipath-tools stop 
debian:~# multipath -F 
debian:~# reboot

or

# service multipathd stop Stopping multipathd daemon:                                [  OK  ] 
# multipath -F 
# ls /dev/mapper/ control 
# reboot
 
 
Verify the mappings:
 
debian:~# multipath -v2 -ll
 
 
Последнее обновление ( 16.03.2010 )
 
< Пред.   След. >
 
 

Производственный кооператив "Геолог" - геологоразведовательные работы, разведка месторождений, подсчет запасов, бурение скважин, геологический отчет...


GASOV.COM © 2024