There are admins who are thinking that exporting logical volumes from Volume groups is impossible.

Really? OK, lvexport command is not the solution because of its absence ;-)

 

Please do this only if you are know what you do. It can be destructive....

The goal is to make an LV available outside from VG.

First we create a VG with 3 disks, including an LV with 2 mirrors.

 

mkdir /dev/vgs

mknod /dev/vgs/group c 64 0x010000            ( use a free minor number !!)

pvcreate /dev/rdisk/disk21

pvcreate /dev/rdisk/disk24

pvcreate /dev/rdisk/disk25

vgcreate ...

lvcreate ...

lvextend -m 2 ...


 

vi /etc/lvmpvg

VG /dev/vgs
PVG pvg_0
/dev/disk/disk21
PVG pvg_1
/dev/disk/disk24
PVG pvg_2
/dev/disk/disk25

cp /etc/lvmpvg /etc/lvmpvg.old

 

vgdisplay -v vgs

--- Volume groups ---

VG Name /dev/vgs

VG Write Access read/write

VG Status available

Max LV 255

Cur LV 1

Open LV 1

Max PV 16

Cur PV 3

Act PV 3

Max PE per PV 17920

VGDA 6

PE Size (Mbytes) 4

Total PE 52921

Alloc PE 30

Free PE 52891

Total PVG 3

Total Spare PVs 0

Total Spare PVs in use 0

VG Version 1.0

VG Max Size 1120g

VG Max Extents 286720


 

--- Logical volumes ---

LV Name /dev/vgs/lvdata

LV Status available/syncd

LV Size (Mbytes) 40

Current LE 10

Allocated PE 30

Used PV 3

 

--- Physical volumes ---

PV Name /dev/disk/disk21

PV Status available

Total PE 17919

Free PE 17909

Autoswitch On

Proactive Polling On


PV Name /dev/disk/disk24

PV Status available

Total PE 17501

Free PE 17491

Autoswitch On

Proactive Polling On


PV Name /dev/disk/disk25

PV Status available

Total PE 17501

Free PE 17491

Autoswitch On

Proactive Polling On

 

--- Physical volume groups ---

PVG Name pvg_0

PV Name /dev/disk/disk21


PVG Name pvg_1

PV Name /dev/disk/disk24


PVG Name pvg_2

PV Name /dev/disk/disk25

 

Now the preparation is finished, let´s go....

 

lvsplit -s splitty -g pvg_0 /dev/vgs/lvdata

Logical volume "/dev/vgs/lvdatasplitty" has been successfully created with

character device "/dev/vgs/rlvdatasplitty".

Logical volume "/dev/vgs/lvdata" has been successfully split.


 

Check:

lvdisplay -v /dev/vgs/lvdatasplitty

--- Logical volumes ---

LV Name /dev/vgs/lvdatasplitty

VG Name /dev/vgs

LV Permission read/write

LV Status available/syncd

Mirror copies 0

Consistency Recovery MWC

Schedule parallel

LV Size (Mbytes) 40

Current LE 10

Allocated PE 10

Stripes 0

Stripe Size (Kbytes) 0

Bad block on

Allocation PVG-strict

IO Timeout (Seconds) default


 

--- Distribution of logical volume ---

PV Name LE on PV PE on PV

/dev/disk/disk21 10 10


 

make VG inactive

 

vgchange -a n vgs


vgexport -s -m vgs.map vgs

Physical volume "/dev/disk/disk21" has been successfully deleted from

physical volume group "pvg_0".

Physical volume "/dev/disk/disk24" has been successfully deleted from

physical volume group "pvg_1".

Physical volume "/dev/disk/disk25" has been successfully deleted from

physical volume group "pvg_2".

vgexport: Volume group "vgs" has been successfully removed.


Now we want to change the VG-ID of the PV´s  which contain the remaining LV.
 

vgchgid /dev/rdisk/disk24 /dev/rdisk/disk25                  # PV´s with /dev/vgs/lvdata


mkdir /dev/vgs

mknod /dev/vgs/group c 64 0x020000


 

vgimport -N -s -m vgs.map vgs

vgimport: Quorum not present, or some physical volume(s) are missing.


 

vgchange -a y -q n vgs

Activated volume group

vgchange: Couldn't re-synchronize stale partitions of the logical volume:

I/O error

Volume group "vgs" has been successfully changed.


 

vgdisplay -v vgs

--- Volume groups ---

VG Name /dev/vgs

VG Write Access read/write

VG Status available

Max LV 255

Cur LV 2

Open LV 2

Max PV 16

Cur PV 3

Act PV 1

Max PE per PV 17920

VGDA 2

PE Size (Mbytes) 4

Total PE 17919

Alloc PE 10

Free PE 17909

Total PVG 0

Total Spare PVs 0

Total Spare PVs in use 0

VG Version 1.0

VG Max Size 1120g

VG Max Extents 286720


--- Logical volumes ---

LV Name /dev/vgs/lvdata

LV Status available/stale

LV Size (Mbytes) 40

Current LE 10

Allocated PE 20

Used PV 0


LV Name /dev/vgs/lvdatasplitty

LV Status available/syncd

LV Size (Mbytes) 40

Current LE 10

Allocated PE 10

Used PV 1

 

--- Physical volumes ---

PV Name /dev/disk/disk21

PV Status available

Total PE 17919

Free PE 17909

Autoswitch On

Proactive Polling On


 

remove ghosted LV
 

lvremove /dev/vgs/lvdata

The logical volume "/dev/vgs/lvdata" is not empty;

do you really want to delete the logical volume (y/n) : y

Logical volume "/dev/vgs/lvdata" has been successfully removed.

vgcfgbackup: /etc/lvmtab is out of date with the running kernel:Kernel indicates 3 disks for "/dev/vgs"; /etc/lvmtab has 1 disks.

Cannot proceed with backup.


 

remove ghosted PV


vgreduce -f vgs

PV with key 1 sucessfully deleted from vg vgs

PV with key 2 sucessfully deleted from vg vgs

Repair completed, please perform the following steps..:

1. vgscan -k -f vgs

2. vgcfgbackup


 

cool down the kernel

 

vgscan -k -f vgs

 

Check.


 

vgdisplay -v vgs

--- Volume groups ---

VG Name /dev/vgs

VG Write Access read/write

VG Status available

Max LV 255

Cur LV 1

Open LV 1

Max PV 16

Cur PV 1

Act PV 1

Max PE per PV 17920

VGDA 2

PE Size (Mbytes) 4

Total PE 17919

Alloc PE 10

Free PE 17909

Total PVG 0

Total Spare PVs 0

Total Spare PVs in use 0

VG Version 1.0

VG Max Size 1120g

VG Max Extents 286720


 

--- Logical volumes ---

LV Name /dev/vgs/lvdatasplitty

LV Status available/syncd

LV Size (Mbytes) 40

Current LE 10

Allocated PE 10

Used PV 1

--- Physical volumes ---

PV Name /dev/disk/disk21

PV Status available


Jetzt wird das zu exportierende LV in eine eigene VG gebracht


mkdir /dev/vgss

mknod /dev/vgss/group c 64 0x030000

vgimport -m vgs.map vgss /dev/dsk/c8t0d0 /dev/dsk/c8t2d0 # ---> vgs.map für VG vgss !!!

vgimport: Warning: Volume Group contains "3" PVs, "2" specified. Continuing.

Warning: A backup of this volume group may not exist on this machine.

Please remember to take a backup using the vgcfgbackup command after activating the volume group.


vgchange -a y -q n vgss

Activated volume group

Volume group "vgss" has been successfully changed.


lvremove /dev/vgss/lvdatasplitty

The logical volume "/dev/vgss/lvdatasplitty" is not empty;

do you really want to delete the logical volume (y/n) : y

Logical volume "/dev/vgss/lvdatasplitty" has been successfully removed.


vgcfgbackup: /etc/lvmtab is out of date with the running kernel:Kernel indicates 3 disks for "/dev/vgss"; /etc/lvmtab has 2 disks.

Cannot proceed with backup.


vgreduce -f vgss

PV with key 0 sucessfully deleted from vg vgss

Repair completed, please perform the following steps..:

1. vgscan -k -f vgss

2. vgcfgbackup


vgscan -k -f vgss


Neue, schöne Mapfiles bauen


vgexport -p -s -m vgs.map vgs

vgexport -p -s -m vgss.map vgss


 

vi /etc/lvmpvg

VG /dev/vgs

PVG pvg_1

/dev/dsk/c8t1d0

VG /dev/vgss

PVG pvg_0

/dev/dsk/c8t0d0

PVG pvg_2

/dev/dsk/c8t2d0


 

Wenn alles schön ist, kann split entfernt werden…

 

 

Useful for older servers like L- class

 

mknod /dev/tty1p0 c 1 0x010000

/usr/lib/uucp/Systems needs the following entry:


gspiport Any;5 gspiport,f 9600 - ""\r\d\r\d\r ogin:-BREAK-ogin:
uucp asswrd: uucp-BREAK-ogin: uucp asswrd: uucp

It needs to be exactly as shown.

/usr/lib/uucp/Devices needs the following entry:

gspiport tty1p0 - 9600 direct

Now we can start:

cu -l /dev/tty1p0

To terminate the cu session, use ~.
[return] 

Es war mal wieder an der Zeit die alte Homepage neu zu gestalten.

Nach einigen Jahren mit Website Baker kommt nun Joomla dran.