![创建新的 raid1 mdadm luks 设备会创建两个不需要的分区](https://linux22.com/image/216018/%E5%88%9B%E5%BB%BA%E6%96%B0%E7%9A%84%20raid1%20mdadm%20luks%20%E8%AE%BE%E5%A4%87%E4%BC%9A%E5%88%9B%E5%BB%BA%E4%B8%A4%E4%B8%AA%E4%B8%8D%E9%9C%80%E8%A6%81%E7%9A%84%E5%88%86%E5%8C%BA.png)
我正在尝试使用 创建 raid1 (带有mdadm
) 设备luks
。但是,它会创建两个分区,而不是一个,如下所示:
sde 8:64 0 3,6T 0 disk
`-sde1 8:65 0 3,6T 0 part
`-md0 9:0 0 3,6T 0 raid1
|-storage2 253:2 0 3,6T 0 crypt
|-md0p1 259:0 0 750,7G 0 part
`-md0p2 259:1 0 1,4T 0 part
sdf 8:80 0 3,6T 0 disk
`-sdf1 8:81 0 3,6T 0 part
`-md0 9:0 0 3,6T 0 raid1
|-storage2 253:2 0 3,6T 0 crypt
|-md0p1 259:0 0 750,7G 0 part
`-md0p2 259:1 0 1,4T 0 part
这是我使用的程序:
cfdisk /dev/sde
cfdisk /dev/sdf
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sde1 /dev/sdf1
cryptsetup -y -v luksFormat /dev/md0
cryptsetup luksOpen /dev/md0 storage2
mkfs.ext4 /dev/mapper/storage2
mkdir -p /media/storage2
mount /dev/mapper/storage2 /media/storage2
为什么使用我看到和lsblk
都有两个分区?我怎样才能避免它?sde
sdf
编辑:当使用 创建数组时mdadm
,我得到以下信息,也许这可能是问题的原因,但如何摆脱它?
$ mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sde1 /dev/sdf1
mdadm: /dev/sde1 appears to be part of a raid array:
level=raid1 devices=2 ctime=Mon Jan 23 20:01:19 2023
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
mdadm: /dev/sdf1 appears to be part of a raid array:
level=raid1 devices=2 ctime=Mon Jan 23 20:01:19 2023
mdadm: size set to 3906885440K
mdadm: automatically enabling write-intent bitmap on large array
Continue creating array?
答案1
问题解决了。像以前一样做一切,但然后:
fdisk /dev/md0
d
w
q
cryptsetup -y -v luksFormat /dev/md0
mkfs.ext4 /dev/mapper/storage2
mkdir -p /media/storage2
mount /dev/mapper/storage2 /media/storage2