减少 LUKS 上 LVM 的大小会产生警告

减少 LUKS 上 LVM 的大小会产生警告

你好我一直在关注这个有用的指南(https://wiki.archlinux.org/title/Resizing_LVM-on-LUKS) 关于如何减少我的文件系统和分区的大小以在分区表上生成大约 100G 的可用空间来安装 Windows 以及签署我的 Ubuntu 安装。

我注意到在使用 LVM 命令时会出现几个警告pvresize,并且还警告说有些命令以 PiB 而不是 GiB 进行报告,这让我觉得我可能计算错误了。我已停止正在执行的操作,以降低需要清除机器并重新启动的风险。基本数据已备份,但我仍然不想进行重建。

错误信息如下

  WARNING: Device /dev/mapper/cryptdisk has size of 762478592 sectors which is smaller than corresponding PV size of 799508162148352 sectors. Was device resized?
  WARNING: One or more devices used as PVs in VG vgubuntu have changed sizes.

以下是我所知道的各种诊断命令的输出,用于检查

> sudo fdisk -l

Disk /dev/nvme0n1: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WD_BLACK SN770 500GB                    
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: 71C114FE-3DBF-4E71-A422-6CE906592E52

Device           Start       End   Sectors   Size Type
/dev/nvme0n1p1    2048   1050623   1048576   512M EFI System
/dev/nvme0n1p2 1050624   4550655   3500032   1.7G Linux filesystem
/dev/nvme0n1p3 4550656 976771071 972220416 463.6G Linux filesystem
> sudo lvdisplay

  WARNING: Device /dev/mapper/cryptdisk has size of 762478592 sectors which is smaller than corresponding PV size of 799508162148352 sectors. Was device resized?
  WARNING: One or more devices used as PVs in VG vgubuntu have changed sizes.
  --- Logical volume ---
  LV Path                /dev/vgubuntu/root
  LV Name                root
  VG Name                vgubuntu
  LV UUID                hPTH7U-FRG1-VPcT-OgAk-S2lY-pD5O-hR8ixl
  LV Write Access        read/write
  LV Creation host, time ubuntu, 2023-07-23 19:58:39 +0000
  LV Status              NOT available
  LV Size                361.66 GiB
  Current LE             92586
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/vgubuntu/swap_1
  LV Name                swap_1
  VG Name                vgubuntu
  LV UUID                B5vW6H-cMcc-i0rt-CuEM-EC6a-tVQb-474jVv
  LV Write Access        read/write
  LV Creation host, time ubuntu, 2023-07-23 19:58:39 +0000
  LV Status              NOT available
  LV Size                1.91 GiB
  Current LE             489
  Segments               1
  Allocation             inherit
  Read ahead sectors     autosh
> sudo vgdisplay

  WARNING: Device /dev/mapper/cryptdisk has size of 762478592 sectors which is smaller than corresponding PV size of 799508162148352 sectors. Was device resized?
  WARNING: One or more devices used as PVs in VG vgubuntu have changed sizes.
  --- Volume group ---
  VG Name               vgubuntu
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               11.57 PiB
  PE Size               4.00 MiB
  Total PE              3106930687
  Alloc PE / Size       93075 / 363.57 GiB
  Free  PE / Size       3106837612 / 11.57 PiB
  VG UUID               oIyZSZ-Ibd3-8Tjm-RpSf-wVts-ru19-88uWCR
> sudo pvdisplay 

  WARNING: Device /dev/mapper/cryptdisk has size of 762478592 sectors which is smaller than corresponding PV size of 799508162148352 sectors. Was device resized?
  WARNING: One or more devices used as PVs in VG vgubuntu have changed sizes.
  --- Physical volume ---
  PV Name               /dev/mapper/cryptdisk
  VG Name               vgubuntu
  PV Size               363.57 PiB / not usable 352.00 PiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              3106930687
  Free PE               3106837612
  Allocated PE          93075
  PV UUID               XVxLuX-GtmB-CvcP-whyf-C1gN-n6yx-CXLzSA
> sudo pvs -v --segments /dev/mapper/cryptdisk
  
WARNING: Device /dev/mapper/cryptdisk has size of 762478592 sectors which is smaller than corresponding PV size of 799508162148352 sectors. Was device resized?
  WARNING: One or more devices used as PVs in VG vgubuntu have changed sizes.
  PV                    VG       Fmt  Attr PSize  PFree  Start  SSize      LV     Start Type   PE Ranges                          
  /dev/mapper/cryptdisk vgubuntu lvm2 a--  11.57p 11.57p      0      92586 root       0 linear /dev/mapper/cryptdisk:0-92585      
  /dev/mapper/cryptdisk vgubuntu lvm2 a--  11.57p 11.57p  92586      25600            0 free                                      
  /dev/mapper/cryptdisk vgubuntu lvm2 a--  11.57p 11.57p 118186        489 swap_1     0 linear /dev/mapper/cryptdisk:118186-118674
  /dev/mapper/cryptdisk vgubuntu lvm2 a--  11.57p 11.57p 118675 3106812012

我对这些命令的挑战是,我不确定某些统计数据的单位是什么,以及哪些值看起来正确,哪些值看起来不正确。然而,PV Size 363.57 PiB / not usable 352.00 PiB当我期望值约为 360GB 时,它们看起来不对劲。

在我继续调整 LUKS 和分区的大小之前,如果您能帮助我读取这些命令输出并让我知道我是否遇到了真正的问题,我将不胜感激。

相关内容