減少 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 大小和分區大小之前是否確實遇到問題的信息,將不勝感激。

相關內容