Hi guy’s berikut Step by step dalam konfigurasi LVM pada linux, semoga membantu.

1. check partisi OS :

# fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
 255 heads, 63 sectors/track, 9729 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes

Device         Boot    Start         End            Blocks      Id       System
 /dev/sda1       *         1          33            265041      83       Linux
 /dev/sda2                34        2710          21503002+     83       Linux
 /dev/sda3              2711        4112          11261565      83       Linux
 /dev/sda4              4113        9729          45118552+      5       Extended
 /dev/sda5              4113        4431           2562336      82       Linux swap / Solaris

Disk /dev/sdb: 5124 MB, 5124317184 bytes
 158 heads, 62 sectors/track, 1021 cylinders
 Units = cylinders of 9796 * 512 = 5015552 bytes

Device      Boot   Start      End     Blocks   Id    System
 /dev/sdb1             1     1021    5000827   8e    Linux LVM

Disk /dev/sdc: 5124 MB, 5124317184 bytes
 158 heads, 62 sectors/track, 1021 cylinders
 Units = cylinders of 9796 * 512 = 5015552 bytes

2. pastikan partisinya mempunyai partisi type LVM (8e)

Device Boot Start End Blocks Id System
 /dev/sdb1 1 1021 5000827 8e Linux LVM

3. Membuat Physical Volume :

# pvcreate /dev/sdb1
 Physical volume "/dev/sdb1" successfully created

4. Menampilkan(PV) Physical Volume:

# pvdisplay
 "/dev/sdb1" is a new physical volume of "4.77 GB"
 --- NEW Physical volume ---
 PV Name /dev/sdb1
 VG Name 
 PV Size 4.77 GB
 Allocatable NO
 PE Size (KByte) 0
 Total PE 0
 Free PE 0
 Allocated PE 0
 PV UUID WUITN9-jdJ5-x2n9-2O3K-OLsl-IiJO-uIGI3y

5. Membuat (VG) Volume Group

 vgcreate vgtraining /dev/sdb1
 Volume group "vgtraining" successfully created

6. Menampilkan (VG) volume group:

# vgdisplay -v

Finding all volume groups
 --- Volume group ---
 VG Name vgtraining
 System ID 
 Format lvm2
 Metadata Areas 1
 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 1
 Act PV 1
 VG Size 4.77 GB
 PE Size 4.00 MB
 Total PE 1220
 Alloc PE / Size 0 / 0 
 Free PE / Size 1220 / 4.77 GB
 VG UUID Swsqz2-KQSG-30si-ZIcC-1pKu-kSA9-oW01RM
 
 --- Physical volumes ---
 PV Name /dev/sdb1 
 PV UUID WUITN9-jdJ5-x2n9-2O3K-OLsl-IiJO-uIGI3y
 PV Status allocatable
 Total PE / Free PE 1220 / 1220
 
 Finding volume group "vgtraining"

7. Membuat (LVM) Logical Volume Manager :

 lvcreate -l +510 -n lvtest vgtraining
 Logical volume "lvtest" created

8. Menampilkan (LV) logical volume manager:

# lvdisplay
Finding all logical volumes
 --- Logical volume ---
 LV Name /dev/vgtraining/lvtest
 VG Name vgtraining
 LV UUID pAC5eA-zaOF-DyH0-Fb32-0FWZ-FjBF-jDnyAa
 LV Write Access read/write
 LV Status available
 # open 0
 LV Size 1.99 GB
 Current LE 510
 Segments 1
 Allocation inherit
 Read ahead sectors auto
 - currently set to 256
 Block device 253:0


9. format file system:

# mke2fs -j /dev/vgtraining/lvtest
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
261120 inodes, 522240 blocks
26112 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
16320 inodes per group
Superblock backups stored on blocks:  
    32768, 98304, 163840, 229376, 294912

Writing inode tables: 0/16 1/16 2/16 3/16 4/16 5/16 6/16 7/16 8/16 9/1610/1611/1612/1613/1614/1615/16done 
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

4 × 1 =