EnderUNIX Team.


EnderUNIX İpucu

Arkadaşıma gönder , Ana Sayfa

[ LVM ]

"Kullanimdaki diski devre dışı bırakmak" - Remzi AKYÜZ - (2008-11-07 19:29:18)   [4674]

Kullanimdaki bir diski cikartmak ;

Öncelikle yeni bir disk takiyoruz, diskin tamamini veya bir kismini kullanabiliriz.
Bu örnekte bir kismini kullanalim. Bunun icin bir bolum olusturuyoruz ve tipini Linux LVM (8e) yaparak, bunu fiziksel bolum olmasini sagliyoruz.

[root@el-esp2 ~]# fdisk -l /dev/sda

Disk /dev/sda: 119 MB, 119537664 bytes
255 heads, 63 sectors/track, 14 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 13 104391 8e Linux LVM
[root@el-esp2 ~]# pvcreate /dev/sda1
Physical volume \"/dev/sda1\" successfully created
[root@el-esp2 ~]#

oluşan fiziksel bolumu, volum grubumuza dahil ediyoruz.

[root@el-esp2 ~]# vgextend mail /dev/sda1
Volume group \"mail\" successfully extended



root@el-esp2 ~]# pvdisplay
--- Physical volume ---
PV Name /dev/hda2
VG Name VolGroup00
PV Size 6.89 GB / not usable 19.81 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 220
Free PE 0
Allocated PE 220
PV UUID cI16GO-xnDp-ODao-uoHr-DnSG-s3KM-C6SXOz

--- Physical volume ---
PV Name /dev/hdb
VG Name mail2
PV Size 512.00 MB / not usable 4.00 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 127
Free PE 102
Allocated PE 25
PV UUID CKlr86-fH85-50tp-y0RQ-fibx-2C1a-vTqzXb

--- Physical volume ---
PV Name /dev/hdd
VG Name mail2
PV Size 112.00 MB / not usable 4.00 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 27
Free PE 27
Allocated PE 0
PV UUID DSBiF6-1Uwn-ctaM-UwXy-20lE-9TE2-zeBzf6

--- Physical volume ---
PV Name /dev/sda1
VG Name mail2
PV Size 101.94 MB / not usable 1.94 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 25
Free PE 25
Allocated PE 0
PV UUID XJCITn-wgUz-fX2h-IKvI-EcY9-DHk9-uBGluq



Sonra kullanımda olan diskte bulunan fizeksel bölüm içindeki bilgileri yeni disk(ler)e taşıyoruz.

Burada hdb diskindeki bilgiler hdd ye taşınacak, hdd yetmez ise sda1 taşınacak.


[root@el-esp2 ~]# pvmove -v /dev/hdb /dev/hdd /dev/sda1
Wiping cache of LVM-capable devices
Finding volume group \"mail2\"
Archiving volume group \"mail2\" metadata (seqno 4).
Creating logical volume pvmove0
Moving 25 extents of logical volume mail2/test
Found volume group \"mail2\"
Updating volume group metadata
Creating volume group backup \"/etc/lvm/backup/mail2\" (seqno 5).
Found volume group \"mail2\"
Found volume group \"mail2\"
Suspending mail2-test (253:2) without device flush
Found volume group \"mail2\"
Creating mail2-pvmove0
Loading mail2-pvmove0 table
Resuming mail2-pvmove0 (253:3)
Found volume group \"mail2\"
Loading mail2-pvmove0 table
Suppressed mail2-pvmove0 identical table reload.
Loading mail2-test table
Resuming mail2-test (253:2)
Checking progress every 15 seconds
/dev/hdb: Moved: 100.0%
Found volume group \"mail2\"
Found volume group \"mail2\"
Loading mail2-test table
Suspending mail2-test (253:2) without device flush
Suspending mail2-pvmove0 (253:3) without device flush
Found volume group \"mail2\"
Found volume group \"mail2\"
Found volume group \"mail2\"
Resuming mail2-pvmove0 (253:3)
Found volume group \"mail2\"
Resuming mail2-test (253:2)
Found volume group \"mail2\"
Removing mail2-pvmove0 (253:3)
Found volume group \"mail2\"
Removing temporary pvmove LV
Writing out final volume group after pvmove
Creating volume group backup \"/etc/lvm/backup/mail2\" (seqno 7).

Artik volum grubumuzdaki ilk diski sanal volumumuzden cikartabiliriz.
Cunku tamamen icindekki datalar diger disklere tasinmistir.

[root@el-esp2 ~]# pvdisplay /dev/hdb
--- Physical volume ---
PV Name /dev/hdb
VG Name mail2
PV Size 512.00 MB / not usable 4.00 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 127
Free PE 127
Allocated PE 0
PV UUID CKlr86-fH85-50tp-y0RQ-fibx-2C1a-vTqzXb

Öncelikle volum grubundan /dev/hdb yi ayiracagiz.

[root@el-esp2 ~]# vgreduce mail2 /dev/hdb
Removed \"/dev/hdb\" from volume group \"mail2\"
[root@el-esp2 ~]#

sonrada fiziksel volumlerden kaldiracagiz.


pvremove /dev/hdb


Artık /dev/hdb diskini sunucumuzdan tamamen (fiziksel olarak alabiliriz.)


Arkadaşıma gönder , Ana Sayfa