문제)
1. VM 디스크 1을 제외한 모든 디스크를 제거 하시오
2. VM 디스크 2 (10G) 를 생성하시오.
3. 다음 사양을 적용 할수 있도록 적당히 파티셔닝 하고 마운트 하시오
- swap 메모리를 500M 추가 하시오(파티셔닝 방법)
- ext4 2G /tmp/test1 에 마운트 되는 파일시스템 생성(논리 아님)
- xfs 1G /tmp/test2 에 마운트 되는 파일시스템 생성(논리 아님)
- 다음과 같은 논리 볼륨을 생성하시오 - 3G, 2G pv -> vgname 인 논리 볼륨그룹 생성
- /vgname/lvname1 1G (ext4 /mnt/lv1)
- /vgname/lvname2 2G (xfs /mnt/lv2)
-lvname1 을 1.5G로 확장하시오. 모든 내용은 재부팅 후에도 설정이 유지 되어야 한다.
풀이)
free
Swap: 2097148 0 2097148
sudo fdisk /dev/vdb
2G vdb1 파티셔닝
1G vdb2 파티셔닝
500M vdb3 파티셔닝
t 82
vdb4 extended
3G vdb5 8e
2G vdb6 8e
[user@localhost ~]$ sudo mkswap /dev/vdb3
Setting up swapspace version 1, size = 511996 KiB
no label, UUID=f9002007-81a5-48f3-b26c-55966145c95e
[user@localhost ~]$ sudo swapon /dev/vdb3
free
Swap: 2609144 0 2609144
[user@localhost ~]$ sudo vi /etc/fstab
UUID=f9002007-81a5-48f3-b26c-55966145c95e swap swap defaults 0 0
[user@localhost ~]$ sudo mount -a
[user@localhost ~]$sudo mkfs.ext4 /dev/vdb1
[user@localhost ~]$sudo mkfs -t xfs /dev/vdb2
[user@localhost ~]$ sudo mkdir /tmp/test1
[user@localhost ~]$ sudo mkdir /tmp/test2
[user@localhost ~]$ sudo mount /dev/vdb1 /tmp/test1
[user@localhost ~]$ sudo mount /dev/vdb2 /tmp/test2
vdb
├─vdb1 ext4 /tmp/test1
├─vdb2 xfs 99f0061f-adcd-420b-926d-93c285bdbf29 /tmp/test2
├─vdb3 swap f9002007-81a5-48f3-b26c-55966145c95e [SWAP]
└─vdb4
UUID=4a24d4ca-59aa-49ce-99c8-d9d35d9d4d62 /tmp/test1 ext4 defaults 0 0
/dev/vdb2 /tmp/test2 xfs defaults 0 0
vdb
├─vdb1 ext4 4a24d4ca-59aa-49ce-99c8-d9d35d9d4d62 /tmp/test1
├─vdb2 xfs 99f0061f-adcd-420b-926d-93c285bdbf29 /tmp/test2
├─vdb3 swap f9002007-81a5-48f3-b26c-55966145c95e [SWAP]
├─vdb4
├─vdb5
└─vdb6
[user@localhost ~]$ sudo pvcreate /dev/vdb5
Physical volume "/dev/vdb5" successfully created.
[user@localhost ~]$ sudo pvcreate /dev/vdb6
Physical volume "/dev/vdb6" successfully created.
[user@localhost ~]$ sudo pvcreate /dev/vdb5
Physical volume "/dev/vdb5" successfully created.
[user@localhost ~]$ sudo pvcreate /dev/vdb6
Physical volume "/dev/vdb6" successfully created.
[user@localhost ~]$ sudo vgcreate vgname /dev/vdb5 /dev/vdb6
Volume group "vgname" successfully created
[user@localhost ~]$ sudo lvcreate vgname -n lvname1 -L 1G
Logical volume "lvname1" created.
[user@localhost ~]$ sudo lvcreate vgname -n lvname2 -L 2G
Logical volume "lvname2" created.
[user@localhost ~]$ lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
vda
├─vda1 xfs 923745de-1bfd-4c7e-89a1-5895651ee0ec /boot
└─vda2 LVM2_me pwT7km-pGGa-6O1Y-k5UD-cg74-aZiV-oZ5b2J
├─centos-root xfs 1801dee2-e598-4d71-a398-9fb9f069df97 /
└─centos-swap swap 10362ce3-2c62-483b-8e06-18dad666a9b0 [SWAP]
vdb
├─vdb1 ext4 4a24d4ca-59aa-49ce-99c8-d9d35d9d4d62 /tmp/test1
├─vdb2 xfs 99f0061f-adcd-420b-926d-93c285bdbf29 /tmp/test2
├─vdb3 swap f9002007-81a5-48f3-b26c-55966145c95e [SWAP]
├─vdb4
├─vdb5 LVM2_me UcQ7l9-t12q-pVdX-14Uj-ukhK-Z8q3-2T0KRs
│ ├─vgname-lvname1
│ └─vgname-lvname2
└─vdb6 LVM2_me d1oakY-PDtK-gwnN-VrZW-A7HY-L2Wf-iHFL6W
└─vgname-lvname2
[user@localhost ~]$sudo pvcreate /dev/vdb5
[user@localhost ~]$sudo pvcreate /dev/vdb6
[user@localhost ~]$sudo vgcreate vgname /dev/vdb5 /dev/vdb6
[user@localhost ~]$sudo lvcreate vgname -n lvname1 -L 1G
[user@localhost ~]$ sudo lvcreate vgname -n lvname2 -L 2G
[user@localhost ~]$sudo mkdir /mnt/lv1
[user@localhost ~]$ sudo mkdir /mnt/lv2
[user@localhost ~]$sudo mkfs.ext4 /dev/mapper/vgname-lvname1
[user@localhost ~]$ sudo mkfs.xfs /dev/mapper/vgname-lvname2
[user@localhost ~]$ sudo mount /dev/mapper/vgname-lvname1 /mnt/lv1
[user@localhost ~]$ sudo mount /dev/mapper/vgname-lvname2 /mnt/lv2
[user@localhost ~]$ sudo lvmdiskscan
/dev/vda1 [ 1.00 GiB]
/dev/vda2 [ <19.00 GiB] LVM physical volume
/dev/vdb1 [ 2.00 GiB]
/dev/vdb2 [ 1.00 GiB]
/dev/vdb3 [ 500.00 MiB]
/dev/vdb5 [ 3.00 GiB] LVM physical volume
/dev/vdb6 [ 2.00 GiB] LVM physical volume
0 disks
4 partitions
0 LVM physical volume whole disks
3 LVM physical volumes
[user@localhost ~]$ sudo vi /etc/fstab
/dev/mapper/vgname-lvname1 /mnt/lv1 ext4 defaults 0 0
/dev/mapper/vgname-lvname2 /mnt/lv2 xfs defaults 0 0
[user@localhost ~]$ sudo lvextend -L 1.5G /dev/vgname/lvname1 -r
'리눅스' 카테고리의 다른 글
Linux Boot Process (부트 프로세스)/root 패스워드 복구 (0) | 2021.05.13 |
---|---|
Linux Sytemd (0) | 2021.05.13 |
Linux Swap 스왑메모리 /swap file 구성 (0) | 2021.05.12 |
Linux 논리 볼륨 관리 2 (0) | 2021.05.12 |
Linux 논리 볼륨 관리 1 (0) | 2021.05.12 |