Custom Search

Kamis, 26 Juni 2008

Logical Volume Manager

Logical Volume Manager ato sering disebut dengan LVM adalah fasilitas dari sistem operasi Linux untuk membuat sebuah partisi virtual, dengan partisi virtual itu kita bisa menggabungkan beberapa hardisk menjadi 1 partisi yang sangaaaaat besaaar, ato bisa mengubah ukuran partisi tanpa menghapus isi file dari partisi tersebut (kalo volumenya ditambah ya ukurannya bukan dikurangi) saat system masih berjalan.

Umumnya LVM ini digunakan untuk memartisi hardisk server tapi buat desktop juga gpp :P . Misal kita punya hardisk 2 buah yang tiap hardisk bervolume 111GB jadi total sizenya 222GB..trus kita biikn partisi pake LVM..gini caranya:

# Bikin physical volume LVM buat nggabungin dua hardisk dulu…
user@filserver:~$ sudo pvcreate /dev/hdc1 /dev/hdd1
Password:
Physical volume “/dev/hdc1″ successfully created
Physical volume “/dev/hdd1″ successfully created

#Untuk melihat hasilnya
user@filserver:~$ sudo pvdisplay
— NEW Physical volume —
PV Name /dev/evms/hdc1
VG Name
PV Size 111.79 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 1jjY6f-adDR-9zLO-ynrW-SLUO-csYc-wtGFGc

— NEW Physical volume —
PV Name /dev/evms/hdd1
VG Name
PV Size 111.79 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 0jGeBq-WHB0-OKuG-MXoJ-Obty-IkJd-p15fqV

#Bikin Volume Group dari gabungan drive LVM dengan nama fileserver
user@filserver:~$ sudo vgcreate fileserver /dev/evms/hdc1 /dev/evms/hdd1
Volume group “fileserver” successfully created

#Lihat VolumeGroup yang tadi dibuat
user@filserver:~$ sudo vgdisplay
— Volume group —
VG Name fileserver
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 223.57 GB
PE Size 4.00 MB
Total PE 57234
Alloc PE / Size 0 / 0
Free PE / Size 57234 / 223.57 GB
VG UUID 32MYKU-I1w2-nj9l-JPlB-jTWQ-d31q-GS2ADv

#Bikin Logical Volume
user@filserver:~$ sudo lvcreate –name Supervisor –size 10G fileserver
Password:
Logical volume “Referensi” created
user@filserver:~$ sudo lvcreate –name TI –size 70G fileserver
Logical volume “TI” created
user@filserver:~$ sudo lvcreate –name Keuangan –size 10G fileserver
Logical volume “Keuangan” created
user@filserver:~$ sudo lvcreate –name Manager –size 10G fileserver
Logical volume “Pengajaran” created
user@filserver:~$ sudo lvcreate –name Karyawan –size 30G fileserver
Logical volume “Dosen” created
user@filserver:~$ sudo lvcreate –name Public –size 10G fileserver
Logical volume “Public” created
user@filserver:~$ sudo lvcreate –name Multimedia –size 50G fileserver
Logical volume “Multimedia” created

#untuk melihat Hasil dari pembuatan Logical Volumenya
user@filserver:~$ sudo lvdisplay
— Logical volume —
LV Name /dev/fileserver/Supervisor
VG Name fileserver
LV UUID eoiCQr-pjoJ-4tt0-J12I-fNv3-yDE1-gftJDQ
LV Write Access read/write
LV Status available
# open 0
LV Size 10.00 GB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:5

— Logical volume —
LV Name /dev/fileserver/TI
VG Name fileserver
LV UUID LqBSv2-PIFO-ASqr-EcuK-0km2-BgfS-4YSnAC
LV Write Access read/write
LV Status available
# open 0
LV Size 70.00 GB
Current LE 17920
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:6

— Logical volume —
LV Name /dev/fileserver/Keuangan
VG Name fileserver
LV UUID zQSVhu-lfxV-iDiF-IA6n-dLTB-yLu4-gfqkGf
LV Write Access read/write
LV Status available
# open 0
LV Size 10.00 GB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:7

— Logical volume —
LV Name /dev/fileserver/Manager
VG Name fileserver
LV UUID qkqrgk-xVsn-wijl-W6s9-8WSB-iZHn-T3MgCG
LV Write Access read/write
LV Status available
# open 0
LV Size 10.00 GB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:8

— Logical volume —
LV Name /dev/fileserver/Karyawan
VG Name fileserver
LV UUID BSuQb8-bipx-5HaB-v73F-kNb1-e7HK-0q1Tr2
LV Write Access read/write
LV Status available
# open 0
LV Size 30.00 GB
Current LE 7680
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:9

— Logical volume —
LV Name /dev/fileserver/Public
VG Name fileserver
LV UUID rvMWgd-W8CN-keuX-mDg2-pPda-jsjA-miKdgh
LV Write Access read/write
LV Status available
# open 0
LV Size 10.00 GB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:10

— Logical volume —
LV Name /dev/fileserver/Multimedia
VG Name fileserver
LV UUID pUJ8UJ-S99V-gtvJ-fFyD-Felw-PrCc-fQ8VjA
LV Write Access read/write
LV Status available
# open 0
LV Size 50.00 GB
Current LE 12800
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:11

#untuk mendelete logical volume yang telah dibuat
user@filserver:~$ sudo lvremove “LV Name”

#Untuk menambah volume logical partisi mjd 1.5GB
user@filserver:~$ sudo lvextend -L 1.5GB “LV Name”

#Untuk menurunkan volume logical partisi mjd 1.5GB
user@filserver:~$ sudo lvreduce -L 1.5GB “LV Name”

#untuk memformat partisi LVM ke ext3
user@filserver:~$ sudo mkfs.ext3 “LV Name”

#buat ngemount partisi yang udah dibuat ke system setelah diformat ke ext3
user@filserver:~$ sudo mount “LV Name” /media/harddisk/




Dukungan Sponsor