LVM错位:lvcreate导致对齐不一致

LVM错位:lvcreate导致对齐不一致

使用以下命令创建逻辑卷时,内核日志告诉我存在一些未对齐情况:

$ sudo vgcreate shinymarengo --dataalignment 1M /dev/sda /dev/sdb /dev/sdc
  Volume group "shinymarengo" successfully created

$ sudo lvcreate --type raid5 -L 4T --nosync --stripesize 1M -n shinymarengo_data shinymarengo
  WARNING: New raid5 won't be synchronised. Don't read what you didn't write!
  Logical volume "shinymarengo_data" created.

起初你会认为一切都很好,但当查看时dmesg会出现一些警告:

[  +0.000052] device-mapper: table: 254:6: adding target device dm-3 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=512, start=0
[  +0.000010] device-mapper: table: 254:6: adding target device dm-5 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=0, start=0
[  +0.000010] device-mapper: table: 254:6: adding target device dm-3 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=512, start=0
[  +0.000008] device-mapper: table: 254:6: adding target device dm-5 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=0, start=0
[  +0.000290] device-mapper: table: 254:6: adding target device dm-3 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=512, start=0
[  +0.000009] device-mapper: table: 254:6: adding target device dm-5 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=0, start=0
[  +0.000008] device-mapper: table: 254:6: adding target device dm-3 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=512, start=0
[  +0.000008] device-mapper: table: 254:6: adding target device dm-5 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=0, start=0

似乎lsblk在讲述同一个故事:

$ lsblk -t
NAME                                      ALIGNMENT  MIN-IO  OPT-IO PHY-SEC LOG-SEC ROTA SCHED       RQ-SIZE   RA WSAME
sda                                               0    4096       0    4096     512    1 mq-deadline      58  128   32M
├─shinymarengo-shinymarengo_data_rmeta_0          0    4096       0    4096     512    1                 128  128   32M
│ └─shinymarengo-shinymarengo_data               -1 1048576 2097152    4096     512    1                 128 6144    0B
└─shinymarengo-shinymarengo_data_rimage_0         0    4096       0    4096     512    1                 128  128   32M
  └─shinymarengo-shinymarengo_data               -1 1048576 2097152    4096     512    1                 128 6144    0B
sdb                                               0    4096       0    4096     512    1 mq-deadline      58  128   32M
├─shinymarengo-shinymarengo_data_rmeta_1        512    4096       0    4096     512    1                 128  128   32M
│ └─shinymarengo-shinymarengo_data               -1 1048576 2097152    4096     512    1                 128 6144    0B
└─shinymarengo-shinymarengo_data_rimage_1       512    4096       0    4096     512    1                 128  128   32M
  └─shinymarengo-shinymarengo_data               -1 1048576 2097152    4096     512    1                 128 6144    0B
sdc                                               0    4096       0    4096     512    1 mq-deadline      58  128   32M
├─shinymarengo-shinymarengo_data_rmeta_2          0    4096       0    4096     512    1                 128  128   32M
│ └─shinymarengo-shinymarengo_data               -1 1048576 2097152    4096     512    1                 128 6144    0B
└─shinymarengo-shinymarengo_data_rimage_2         0    4096       0    4096     512    1                 128  128   32M
  └─shinymarengo-shinymarengo_data               -1 1048576 2097152    4096     512    1                 128 6144    0B

我可以采取不同的措施来消除错位,或者这可能只是一个错误?

编辑 - 平台详细信息:

  • 树莓派 4B 2GB
  • 树莓派克星
  • Linux 4.19.108
  • LVM 2.03.02(2)

相关内容