¸®´ª½º °ü·Ã °Ô½ÃÆÇ

2014/12/01(14:21) from 210.93.7.52
ÀÛ¼ºÀÚ : ÁÖÀÎÀå Á¶È¸¼ö : 7467 , ÁÙ¼ö : 175
[CentOS] lvm °ü·Ã ¸í·É¾î
1. Ãß°¡ÇÑ Disk È®ÀÎ

$ fdisk -l
[root@localhost ~]# fdisk -l

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d00f9

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          39      307200   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              39         561     4194304   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3             561        3264    21711872   83  Linux

Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


2. pv È®ÀÎ

$ pvscan
 No matching physical volumes found


3. pv ¸¸µé±â, È®ÀÎ

$ pvcreate /dev/sdb
 Physical volume "/dev/sdb" successfully created

$ pvremove /dev/sdb
 Labels on physical volume "/dev/sdb" successfully wiped

$ pvdisplay
 "/dev/sdb" is a new physical volume of "100.00 GiB"
 --- NEW Physical volume ---
 PV Name               /dev/sdb
 VG Name               
 PV Size               100.00 GiB
 Allocatable           NO
 PE Size               0   
 Total PE              0
 Free PE               0
 Allocated PE          0
 PV UUID               iq3Hpo-fKhB-8WSn-d17R-OnLQ-RyrI-Q4fQRP


$ pvscan
 PV /dev/sdb         lvm2 [100.00 GiB]
 Total: 1 [100.00 GiB] / in use: 0 [0   ] / in no VG: 1 [100.00 GiB]



4. vg ¸¸µé±â

$ vgdisplay
 No volume groups found

$ vgcreate datavg /dev/sdb
 Volume group "datavg" successfully created
$ vgdisplay
 --- Volume group ---
 VG Name               datavg
 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               100.00 GiB
 PE Size               4.00 MiB
 Total PE              25599
 Alloc PE / Size       0 / 0   
 Free  PE / Size       25599 / 100.00 GiB
 VG UUID               UtfBx1-yqHd-jgdj-P7bp-pVe7-KdYb-lF4b84



5. lv ¸¸µé±â & »èÁ¦Çϱâ (1G)

$ lvcreate -n oracle_lv -L 1G datavg
 Logical volume "oracle_lv" created

$ umount /home2
$ lvremove /dev/datavg/home2_lv       (umount¸¦ ÇÏ°í, lv path¸¦ ÀÔ·ÂÇØÁà¾ß ÇÑ´Ù.)



6. lv Á¤º¸ È®ÀÎ

$ lvdisplay
 --- Logical volume ---
 LV Path                /dev/datavg/oracle_lv
 LV Name                oracle_lv
 VG Name                datavg
 LV UUID                u2ZMUn-Icn7-GycH-jdw7-OJ3W-EJOM-QJOs2L
 LV Write Access        read/write
 LV Creation host, time localhost.localdomain, 2014-12-01 14:17:56 +0900
 LV Status              available
 # open                 0
 LV Size                1.00 GiB
 Current LE             256
 Segments               1
 Allocation             inherit
 Read ahead sectors     auto
 - currently set to     256
 Block device           253:0



7. ext4·Î Æ÷¸Ë

$ mkfs.ext4 /dev/datavg/oracle_lv
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
       32768, 98304, 163840, 229376

Writing inode tables: done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

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



8. tune2fs Á¡°Ë¾øÀ½¼³Á¤ (Á¡°Ë°£°Ý 0, Á¡°Ë¾øÀ½ -1)

$ tune2fs -i 0 -c -1 /dev/datavg/oracle_lv
tune2fs 1.41.12 (17-May-2010)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds



9. Mount Æ÷ÀÎÆ® ¸¸µé±â

$ mkdir /home1


10. Mount Çϱâ

$ mount /dev/datavg/oracle_lv /home1
$ df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/sda3                      21G  1.3G   19G   7% /
tmpfs                         939M     0  939M   0% /dev/shm
/dev/sda1                     291M   36M  241M  13% /boot
/dev/mapper/datavg-oracle_lv 1008M   34M  924M   4% /home1

Modify Delete Post Reply Backward Forward List
Powered by Kang Jul Ki