PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Volume Group verkleinern



Grex
12.10.12, 19:52
Hallo,

Ich habe zwei Partitionen:
sda2: 8GB
sdb2: 30GB

Ich habe eine Voloumegroup namens vg_server:


--- Volume group ---
VG Name vg_server
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 37.50 GiB
PE Size 4.00 MiB
Total PE 9601
Alloc PE / Size 9601 / 37.50 GiB
Free PE / Size 0 / 0
VG UUID xxx


Auf der Volume Group werden 5GB verwendet.
Ich möchte nun sdb2 nun wieder aber aus der Gruppe raus haben.
Das Problem ist, dass sdb2 größer als sda2 ist, daher keine Chance mit pvmove.
Ich muss die sdb2 nun kleiner bekommen, aber wie, ich kann sie ja nicht unmounten, da sie ja verwendet wird.
Es sind (schon) Daten auf dieser Festplatte oben.

Ich brauche eure Hilfe, ich muss die sdb2 wieder aus der vg_server rausbekommen.


pvdisplay -m:


--- Physical volume ---
PV Name /dev/sda2
VG Name vg_server
PV Size 7.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 1922
Free PE 0
Allocated PE 1922
PV UUID R1rHzH-83IY-Ke6i-Mu3Z-XL1h-vshc-lY6eRy

--- Physical Segments ---
Physical extent 0 to 1546:
Logical volume /dev/vg_server/lv_root
Logical extents 0 to 1546
Physical extent 1547 to 1921:
Logical volume /dev/vg_server/lv_swap
Logical extents 0 to 374

--- Physical volume ---
PV Name /dev/sdb2
VG Name vg_server
PV Size 30.00 GiB / not usable 2.01 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 7679
Free PE 0
Allocated PE 7679
PV UUID xxx

--- Physical Segments ---
Physical extent 0 to 7678:
Logical volume /dev/vg_server/lv_root
Logical extents 1547 to 9225


lvdisplay:


--- Logical volume ---
LV Path /dev/vg_server/lv_root
LV Name lv_root
VG Name vg_server
LV UUID xxxx
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 36.04 GiB
Current LE 9226
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---
LV Path /dev/vg_server/lv_swap
LV Name lv_swap
VG Name vg_server
LV UUID xxx
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 1.46 GiB
Current LE 375
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1


Wäre für jede Hilfe dankbar.

medhefgo
13.10.12, 16:47
Schon mal die GParted Live CD (http://gparted.sourceforge.net/livecd.php) bemüht?

quinte17
16.10.12, 08:34
mh, du hättset schon ein paar möglichkeiten also vielleicht...
1. zuersteinmal musst du rausfinden ob dein rootfs überhaupt verkleinerbar ist. also ob das dateisystem diese operation überhaupt unterstützt.
2. das dateisystem dann um 20gb kleiner machen.
3. das lv um 19gb kleiner machen.
4. neues lv anlegen. ruhig etwas kleiner.
5. root auf neues lv umziehen
6. großes lv löschen
7. evtl mit pvmove und konsorten die große platte aus dem verbund hauen.

im laufenden betrieb ist sowas schon möglich, allerdings sollte da ein wenig erfahrung mitgebracht werden.

quinte17
16.10.12, 08:57
mh noch eine möglichkeit..
1. swap entfernen swapoff -a und fstab anpassen
2. swap lv formatieren und große teile des root-fs übertragen damit später ein offline-resize des restlichen teils möglich wird.

und dann noch ein paar schritte um ein lv auf der kleinen platte zu erzeugen welches dann nur da drauf liegt...

diese variante ist mit erfahrung und ein paar mal booten möglich. sollte auch sicherer sein als die zuvor genannte