我的带有 LUKS 的 LVM 使用哪个分区?

我的带有 LUKS 的 LVM 使用哪个分区?

我正在尝试弄清楚 dm-X 在哪个分区上。它在 /dev/sdaX 上,但是哪个 X?我遗漏了什么?我知道那里是找出这个问题的一种方法。我需要增加物理卷,但直到我知道要触及哪个分区后才能这样做。以下是我迄今为止尝试过的方法:

root@debian:~# ls /dev/sda*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda5

root@debian:~# ls -l /dev/mapper/*
crw------- 1 root root 10, 59 Jan 24 15:33 /dev/mapper/control
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-home -> ../dm-6
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-root -> ../dm-1
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-swap_1 -> ../dm-4
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-tmp -> ../dm-5
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-usr -> ../dm-2
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-var -> ../dm-3
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/sda5_crypt -> ../dm-0

root@debian:~# pvs
  PV         VG     Fmt  Attr PSize PFree
  /dev/dm-0  debian lvm2 a-   7.76g    0 

root@debian:~# pvscan
  PV /dev/dm-0   VG debian   lvm2 [7.76 GiB / 0    free]
  Total: 1 [7.76 GiB] / in use: 1 [7.76 GiB] / in no VG: 0 [0   ]

root@debian:~# pvdisplay
  --- Physical volume ---
  PV Name               /dev/dm-0
  VG Name               debian
  PV Size               7.76 GiB / not usable 1020.00 KiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              1986
  Free PE               0
  Allocated PE          1986
  PV UUID               cR4fIF-sUtS-edOh-7bB2-eKgV-jf1H-oHy3Ml

答案1

您的列表/dev/mapper显示sda5_crypt指向/dev/dm-0,因此底层分区可能是/dev/sda5。如果您想确定,请检查/etc/crypttab。如果您想真的当然,使用dmsetup ls

相关内容