전용 SSD 2개가 있는데 어떻게 1개로 그룹화하나요?

전용 SSD 2개가 있는데 어떻게 1개로 그룹화하나요?

KVM 위에 가상 머신을 구축하는 데 사용할 전용 서버가 있습니다(Virtualizor 덕분에). 문제는 머신이 대기업에서 임대되었기 때문에 머신에 물리적으로 액세스할 수 없다는 것입니다. 2개의 스토리지를 1개의 볼륨으로 그룹화하는 방법에 대해 설명합니다. 한 시스템이 다른 시스템보다 볼륨 그룹을 관리하기 쉽다고 생각하는 사람이 있으면 시스템을 변경할 수 있습니다. CentOS 7 또는 Ubuntu를 허용하는 OS 옵션(가상화 지원 및 전용 공급자)이 있습니다. 16.04( x86_64) 및 머신에 2개의 960GB SSD가 있습니다.

내가 직면한 문제(현재 CentOS 7을 사용 중)는 다음과 같습니다.

  1. 디스크를 사용하고 있어서 사용하면서 어떻게 관리해야 할지 모르겠어요
  2. 루트 디렉터리에는 디스크 공간이 거의 모두 있으며 60MB가 남습니다.
  3. 볼륨 그룹에서 설정하는 방법을 모르겠습니다.

루트 크기를 줄이는 방법에 대한 문서의 일부를 이해했다고 생각합니다. 그러나 프로세스가 무엇인지, 단계가 무엇인지, 무엇인지 더 명확하게 설명할 수 있다면 진심으로 감사하겠습니다. 따라서 루트 크기를 줄일 수 있다면 남은 것은 2개의 디스크를 볼륨 그룹으로 병합하는 것뿐입니다. 확장을 시도했지만 IDK가 누락되었을 수 있습니다.

[root@server]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p

Disk /dev/sda: 960.2 GB, 960197124096 bytes, 1875385008 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00023b47

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
[root@server]# vgs
  VG #PV #LV #SN Attr   VSize   VFree
  vg   1   3   0 wz--n- 894.25g 60.00m
[root@server]# df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/vg-root  876G  3.0G  828G   1% /
devtmpfs              63G     0   63G   0% /dev
tmpfs                 63G     0   63G   0% /dev/shm
tmpfs                 63G  9.6M   63G   1% /run
tmpfs                 63G     0   63G   0% /sys/fs/cgroup
/dev/sda1           1008M  143M  815M  15% /boot
/dev/mapper/vg-tmp   976M  2.6M  907M   1% /tmp
tmpfs                 13G     0   13G   0% /run/user/0
[root@server]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               vg
  PV Size               894.25 GiB / not usable 2.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              228928
  Free PE               15
  Allocated PE          228913
  PV UUID               kytvOh-HaSm-OOo3-l7OM-nbkk-QyQf-Mx1gCu
[root@server]# pvscan
  PV /dev/sdb1   VG vg              lvm2 [894.25 GiB / 60.00 MiB free]
  Total: 1 [894.25 GiB] / in use: 1 [894.25 GiB] / in no VG: 0 [0   ]
[root@server]# fdisk -l

Disk /dev/sdb: 960.2 GB, 960197124096 bytes, 1875385008 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0001c70b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  1875384319   937691136   8e  Linux LVM

Disk /dev/sda: 960.2 GB, 960197124096 bytes, 1875385008 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00023b47

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux

Disk /dev/mapper/vg-root: 954.8 GB, 954762002432 bytes, 1864769536 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/vg-swap: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/vg-tmp: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

답변1

가장 먼저 해야 할 일은 /dev/sda장치에 새 파티션을 만드는 것입니다. 을 생성한다고 가정하면 /dev/sda2다음 명령을 사용하여 이 작업을 수행할 수 있습니다.

fdisk /dev/sda
n - to create new partition
t -> 8e - to change partition type to Linux LVM
w - to write changes and exit

그런 다음 커널은 새 파티션이 생성되었음을 인식해야 합니다.

partprobe /dev/sda2

이 명령은 /dev/sda2LVM의 파티션을 초기화하고 이를 기존 볼륨 그룹에 추가합니다.

pvcreate /dev/sda2
vgextend vg /dev/sda2

그런 다음 기존 논리 볼륨을 확장하거나 lvextend새 논리 볼륨을 사용하거나 생성 할 수 있습니다 lvcreate. 선형, 스트라이프, RAID 등 여러 유형의 논리 볼륨을 생성할 수 있습니다. 공간을 어떻게 활용하는지는 당신에게 달려 있습니다.

기존 LV를 확장하기로 선택한 경우 파일 시스템( xfs_growfs또는 resize2fsEXT)의 크기도 조정해야 합니다. 새 LV를 생성하기로 선택한 경우 mkfs명령을 사용하여 LV에 파일 시스템을 생성해야 합니다.

관련 정보