如何访问另一个发行版中全部属于 OpenSUSE 的多个加密 LVM 分区?

如何访问另一个发行版中全部属于 OpenSUSE 的多个加密 LVM 分区?

今天是个好日子。当我尝试删除 Fedora 37 时,我不小心删除了包含/boot和的分区。从那时起,我无法访问 OpenSUSE Tumbleweed 和 Windows 11。这些是我运行以下命令时的输出:/boot/efi

sudo fdisk -l

Disk /dev/sda: 931.51 GiB, 1000204885504 bytes, 1953525167 sectors
Disk model: Expansion HDD   
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: 950BB753-E2D3-05EF-44A5-AD62299E4108

Device         Start        End    Sectors   Size Type
/dev/sda1       2048  202337671  202335624  96.5G Microsoft basic data
/dev/sda2  202337672  202403207      65536    32M Microsoft basic data
/dev/sda3  202405888  546150399  343744512 163.9G Linux filesystem
/dev/sda4  546152448  796151807  249999360 119.2G Microsoft basic data
/dev/sda5  796153856 1953523711 1157369856 551.9G Linux filesystem


Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: INTEL SSDPEKNU512GZ                     
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: D4D24E91-6DA9-4FEC-9BD8-BBDD412F9D27

Device              Start        End   Sectors   Size Type
/dev/nvme0n1p1       2048     526335    524288   256M Linux LVM
/dev/nvme0n1p2  609458176  632897535  23439360  11.2G Linux swap
/dev/nvme0n1p3    2480128    2512895     32768    16M Linux LVM
/dev/nvme0n1p4  283641856  609458175 325816320 155.4G Linux filesystem
/dev/nvme0n1p5    3481600  283641855 280160256 133.6G Linux LVM
/dev/nvme0n1p6    2512896    3481599    968704   473M EFI System
/dev/nvme0n1p8  632897536  632930303     32768    16M Microsoft reserved
/dev/nvme0n1p9  632930304  998623231 365692928 174.4G Microsoft basic data
/dev/nvme0n1p10 998623232 1000212479   1589248   776M Windows recovery environment

Partition table entries are not in disk order.


Disk /dev/mapper/luks-069014fc-87ae-4213-89f9-da62a3fcbbc2: 155.36 GiB, 166815858688 bytes, 325812224 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/zram0: 5.7 GiB, 6115819520 bytes, 1493120 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram1: 5.7 GiB, 6115819520 bytes, 1493120 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

我想要访问的分区是/dev/nvme0n1p1/dev/nvme0n1p3/dev/nvme0n1p5。但是,当我运行时psv,它没有显示任何内容。我该怎么做才能再次访问系统中的文件?我不打算让它再次启动到 OpenSUSE,我只是希望能够访问那里的文件。

附加信息: neofetch

                     ./o.                  mitsuki@Zhaya 
                   ./sssso-                ------------- 
                 `:osssssss+-              OS: EndeavourOS Linux x86_64 
               `:+sssssssssso/.            Host: VivoBook_ASUSLaptop X515EA_X515EA 1.0 
             `-/ossssssssssssso/.          Kernel: 6.1.9-arch1-1 
           `-/+sssssssssssssssso+:`        Uptime: 1 hour, 6 mins 
         `-:/+sssssssssssssssssso+/.       Packages: 1179 (pacman), 11 (flatpak) 
       `.://osssssssssssssssssssso++-      Shell: fish 3.6.0 
      .://+ssssssssssssssssssssssso++:     Resolution: 1920x1080 
    .:///ossssssssssssssssssssssssso++:    WM: i3 
  `:////ssssssssssssssssssssssssssso+++.   Theme: Adwaita [GTK2], Arc-Darker [GTK3] 
`-////+ssssssssssssssssssssssssssso++++-   Icons: Adwaita [GTK2], Qogir [GTK3] 
 `..-+oosssssssssssssssssssssssso+++++/`   Terminal: xfce4-terminal 
   ./++++++++++++++++++++++++++++++/:.     Terminal Font: Source Code Pro 10 
  `:::::::::::::::::::::::::------``       CPU: 11th Gen Intel i3-1115G4 (4) @ 4.100GHz 
                                           GPU: Intel Tiger Lake-LP GT2 [UHD Graphics G4] 
                                           Memory: 5597MiB / 11665MiB 
                                                                                                                                     

答案1

我认为需要解锁包含加密内容的分区。这将提供另一个“虚拟”块设备,LVM 工具将能够访问该块设备。

运行lsblk -flsblk查看可用的“物理”磁盘设备及其分区。其中至少有一个可能会显示crypto在该FSTYPE列中。

然后尝试

cryptsetup luksOpen /dev/disk/by-uuid/feaf408d-3257-4850-b597-bbca1dc651df cr_my_lvm

这将要求输入密码,然后创建新的“虚拟”块设备。

lsblk -f再次检查lsblk它是否确实创建了一个cr_my_lvm东西。

根据可用的工具,LVM 可能已经处于活动状态。如果没有,请按照通常没有加密分区的方式进行操作。

相关内容