增加根磁盘空间并访问现有硬盘

增加根磁盘空间并访问现有硬盘

我的 CentOS 机器上的根硬盘空间有问题。

df -h 返回

Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             126G     0  126G   0% /dev
tmpfs                126G  352M  126G   1% /dev/shm
tmpfs                126G   59M  126G   1% /run
tmpfs                126G     0  126G   0% /sys/fs/cgroup
/dev/mapper/cl-root   50G   50G  255M 100% /
/dev/mapper/cl-home  898G  887G   11G  99% /home
/dev/nvme0n1p2       976M  360M  550M  40% /boot
/dev/nvme0n1p1       599M  7.3M  592M   2% /boot/efi
tmpfs                 26G   72K   26G   1% /run/user/1001

然而,磁盘应用程序的屏幕截图显示我有额外的(未安装的?)驱动器: 在此输入图像描述

当我尝试格式化 8.0 TB 硬盘并尝试安装它时,CentOS 警告我该卷上的所有数据都将丢失 - 我不想丢失系统上的任何文件,因此对此不确定。

如何增加根目录的大小以及如何访问磁盘 GUI 中显示的 1TB 和 8TB 存储而不会有丢失文件的风险?

编辑:vgs 返回:

  VG #PV #LV #SN Attr   VSize   VFree
  cl   1   3   0 wz--n- 952.28g    0 

pvs 返回:

  PV             VG Fmt  Attr PSize   PFree
  /dev/nvme0n1p3 cl lvm2 a--  952.28g    0 

fdisk -l 返回:

Disk /dev/nvme0n1: 953.9 GiB, 1024209543168 bytes, 2000409264 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
Disklabel type: gpt
Disk identifier: 6C8024F1-6066-44CF-955B-F9869E79A4A9

Device           Start        End    Sectors   Size Type
/dev/nvme0n1p1    2048    1230847    1228800   600M EFI System
/dev/nvme0n1p2 1230848    3327999    2097152     1G Linux filesystem
/dev/nvme0n1p3 3328000 2000408575 1997080576 952.3G Linux LVM


Disk /dev/sda: 7.3 TiB, 8001563222016 bytes, 15628053168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 08429B71-E4F8-4794-9128-733FDAD3C5EF

Device       Start         End     Sectors  Size Type
/dev/sda1     2048     1230847     1228800  600M EFI System
/dev/sda2  1230848     3327999     2097152    1G Linux filesystem
/dev/sda3  3328000 15628052479 15624724480  7.3T Linux LVM


Disk /dev/mapper/cl-root: 50 GiB, 53687091200 bytes, 104857600 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/cl-swap: 4 GiB, 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/cl-home: 898.3 GiB, 964522147840 bytes, 1883832320 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

根据评论,你似乎还有另一个PV(如果那里没有信息)你可以添加到 VG:

vgextend cl /dev/sda3

之后您可以扩展 LV:

lvextend -L+2GB /dev/mapper/cl-root

(这会为root文件系统添加 2GB)

然后扩展root文件系统。该命令取决于您使用的文件系统

相关内容