LUKS 생성 경고에서 LVM 크기 줄이기

LUKS 생성 경고에서 LVM 크기 줄이기

안녕하세요. 저는 이 유용한 가이드를 따라왔습니다(https://wiki.archlinux.org/title/Resizing_LVM-on-LUKS) Ubuntu 설치에 따라 Windows를 설치하기 위해 파티션 테이블에 약 100G의 여유 공간을 생성하기 위해 파일 시스템 및 파티션의 크기를 줄이는 방법에 대해 설명합니다.

수행 후 LVM 명령을 사용할 때 여러 가지 경고가 나타나는 것을 확인했으며 pvresize일부 명령이 GiB 대신 PiB로 보고된다는 경고를 표시하여 뭔가 잘못 계산했을 수도 있다고 생각합니다. 기계를 닦고 다시 시작해야 하는 위험을 줄이기 위해 하던 일을 중단했습니다. 필수 데이터는 백업되어 있지만 여전히 재구축을 수행하지 않는 것이 좋습니다.

오류 메시지는 다음과 같습니다

  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 크기 조정과 파티션 크기 조정을 계속하기 전에 이러한 명령 출력을 읽고 실제로 문제가 있는지 알려주는 데 도움을 주시면 매우 감사하겠습니다.

관련 정보