我只能使用带有 LVM 和 RAID 的 2x1TB 磁盘中的 100GB

我只能使用带有 LVM 和 RAID 的 2x1TB 磁盘中的 100GB

我有以下磁盘 lsblk

  lsblk
  lsblk
  NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
  loop0                       7:0    0  63,9M  1 loop /snap/core20/2182
  loop1                       7:1    0  63,9M  1 loop /snap/core20/2264
  loop2                       7:2    0    87M  1 loop /snap/lxd/27948
  loop3                       7:3    0    87M  1 loop /snap/lxd/27428
  loop4                       7:4    0  39,1M  1 loop /snap/snapd/21184
  loop5                       7:5    0  38,7M  1 loop /snap/snapd/21465
  sda                         8:0    1   931G  0 disk
  ├─sda1                      8:1    1     1G  0 part /boot/efi
  ├─sda2                      8:2    1     2G  0 part /boot
  └─sda3                      8:3    1 927,9G  0 part
    └─ubuntu--vg-ubuntu--lv 253:0    0   100G  0 lvm  /
  sr0                        11:0    1  1024M  0 rom

为什么 sda1-3 的总和超过 100GB 时却显示我的 LV 只有 100GB?

lspci -knn | grep 'RAID bus controller'
01:00.0 RAID bus controller [0104]: Adaptec Series 8 12G SAS/PCIe 3 [9005:028d] (rev 01)

lsscsi
[0:0:0:0]    disk    ASR8405  Raid1 Mirror     V1.0  /dev/sda
[0:1:0:0]    disk    ATA      PNY 1TB SATA SSD 215a  -
[0:1:1:0]    disk    ATA      PNY 1TB SATA SSD 215a  -
[2:0:0:0]    cd/dvd  ASUS     DRW-24D5MT       2.00  /dev/sr0

希望你能帮助我,不幸的是我对这些东西一无所知 :-(

我尝试过分开

(parted) print all
Model: ASR8405 Raid1 Mirror (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  1128MB  1127MB  fat32              boot, esp
 2      1128MB  3276MB  2147MB  ext4
 3      3276MB  1000GB  996GB


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 107GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End    Size   File system  Flags
 1      0,00B  107GB  107GB  ext4


(parted) resizepart 3 996G
Warning: Shrinking a partition can cause data loss, are you sure you want to continue?
Yes/No? No
(parted)

但为了不丢失数据,我也不敢继续,因为我不知道这是否是我面临的问题。

好的现在我试过了

lvdisplay
  --- Logical volume ---
  LV Path                /dev/ubuntu-vg/ubuntu-lv
  LV Name                ubuntu-lv
  VG Name                ubuntu-vg
  LV UUID                1lveHV-7kL0-UcbK-3AoX-Oczm-3l1t-rFVpY3
  LV Write Access        read/write
  LV Creation host, time ubuntu-server, 2024-02-12 19:05:57 +0100
  LV Status              available
  # open                 1
  LV Size                100,00 GiB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

lvextend -L +996G /dev/ubuntu-vg/ubuntu-lv
  Insufficient free space: 254976 extents needed, but only 211951 available

lvextend -L +211951 /dev/ubuntu-vg/ubuntu-lv
  Rounding size to boundary between physical extents: 206,98 GiB.
  Size of logical volume ubuntu-vg/ubuntu-lv changed from 100,00 GiB (25600 extents) to 306,98 GiB (78588 extents).
  Logical volume ubuntu-vg/ubuntu-lv successfully resized.

好的,这对我有用

lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
  Size of logical volume ubuntu-vg/ubuntu-lv changed from 306,98 GiB (78588 extents) to 927,93 GiB (237551 extents).
  Logical volume ubuntu-vg/ubuntu-lv successfully resized.

但 df -h 根本没有改变

Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              6,3G  3,2M  6,3G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   98G   59G   35G  63% /
tmpfs                               32G     0   32G   0% /dev/shm
tmpfs                              5,0M     0  5,0M   0% /run/lock
/dev/sda2                          2,0G  253M  1,6G  14% /boot
/dev/sda1                          1,1G  6,1M  1,1G   1% /boot/efi
tmpfs                              6,3G  4,0K  6,3G   1% /run/user/1000

所以我仍然无法使用磁盘空间(即使重新启动后)

相关内容