티스토리 뷰

반응형

준비물

- hdd 1T /dev/sda

- hdd 1T /dev/sdb

 

 

1. fdisk /dev/sda, fdisk /dev/sdb 명령으로 각각 파티션 생성

 

2. `pvcreate /dev/sda1`, `pvcreate /dev/sdb1` 명령으로 각각 pv 생성

[root@kube4 ~]# pvcreate /dev/sda1
  Physical volume "/dev/sda1" successfully created.
[root@kube4 ~]# pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created.
[root@kube4 ~]# pvscan
  PV /dev/sdc2   VG centos_cluster-test   lvm2 [<446.13 GiB / 4.00 MiB free]
  PV /dev/sdb1                            lvm2 [931.51 GiB]
  PV /dev/sda1                            lvm2 [931.51 GiB]
  Total: 3 [<2.26 TiB] / in use: 1 [<446.13 GiB] / in no VG: 2 [<1.82 TiB]

 

3. `vgcreate centos_kube4-hdd /dev/sda1 /dev/sdb1` 명령으로 vg 생성

[root@kube4 ~]# vgcreate centos_kube4-hdd /dev/sda1 /dev/sdb1
  Volume group "centos_kube4-hdd" successfully created
[root@kube4 ~]# vgscan
  Reading volume groups from cache.
  Found volume group "centos_cluster-test" using metadata type lvm2
  Found volume group "centos_kube4-hdd" using metadata type lvm2

 

4. `lvcreate -l 100%FREE -i2 -n home2 centos_kube4-hdd` 명령으로 lv 생성

- `-i2` 옵션은 스트라이프 볼륨을 생성하기 위한 옵션이다.(자세한 내용은 여기 참조)

`-i2` 옵션의 값은 최대 물리 디스크의 개수를 넘을 수 없다.

[root@kube4 /]# lvcreate -l 100%FREE -i2 -n home2 centos_kube4-hdd
  Using default stripesize 64.00 KiB.  Using default stripesize 64.00 KiB.
  Logical volume "home2" created.

[root@kube4 /]# lvdisplay /dev/centos_kube4-hdd/home2
  --- Logical volume ---
  LV Path                /dev/centos_kube4-hdd/home2
  LV Name                home2
  VG Name                centos_kube4-hdd
  LV UUID                PBKy9d-7A19-uXU3-Lero-ncZm-prST-RfUHN6
  LV Write Access        read/write
  LV Creation host, time kube4, 2019-08-12 15:45:55 +0900
  LV Status              available
  # open                 0
  LV Size                <1.82 TiB
  Current LE             476932
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     512
  Block device           253:2

 

5. `mkfs.xfs /dev/centos_kube4-hdd/home2` 명령으로 fs 지정 및 포멧

[root@kube4 /]# mkfs.xfs /dev/centos_kube4-hdd/home2
meta-data=/dev/centos_kube4-hdd/home2 isize=512    agcount=32, agsize=15261808 blks
              =                       sectsz=4096  attr=2, projid32bit=1
              =                       crc=1        finobt=0, sparse=0
data       =                       bsize=4096   blocks=488377856, imaxpct=5
              =                       sunit=16     swidth=32 blks
naming   =version 2        bsize=4096   ascii-ci=0 ftype=1
log          =internal log     bsize=4096   blocks=238465, version=2
               =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime  =none               extsz=4096   blocks=0, rtextents=0

 

6. `mount /dev/centos_kube4-hdd/home2 /home2` 명령으로 /home2에 마운트

 

7. 추가

- lvremove(요기 참조)

[root@kube4 /]# lvremove /dev/centos_kube4-hdd/home2
Do you really want to remove active logical volume centos_kube4-hdd/home2? [y/n]: y
  Logical volume "home2" successfully removed

 

반응형
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함