将 LUKS 分区与另一块硬盘上的分区合并

将 LUKS 分区与另一块硬盘上的分区合并

我刚刚购买了一块 2 TB 的硬盘,因为旧硬盘上的主分区几乎已满。

我想要做的是扩展硬盘 1 (sda2) 上的主分区,使其包含新硬盘 (sdb1) 上的所有空间。这乍一看似乎相当简单,但有一个问题。我的主分区是 LUKS 加密的。

如何扩展 sda2 以跨越 sdb1 并充当单个分区?我最初的想法是创建一个逻辑卷(合并 sda2 和 sdb1),但是我找不到与我自己的场景类似的指南。有什么想法吗?

fdisk -l 输出:

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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 identifier: 0x0c000236

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   204802047   102400000    7  HPFS/NTFS/exFAT
/dev/sda2       204802048  1953525167   874361560   83  Linux


Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes
81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x12e102fd

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  3907029167  1953513560   83  Linux

Disk /dev/mapper/sda2_crypt: 895.3 GB, 895345184768 bytes
255 heads, 63 sectors/track, 108852 cylinders, total 1748721064 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 identifier: 0x00000000

Disk /dev/mapper/sda2_crypt doesn't contain a valid partition table

答案1

相关内容