Debian - 检测并安装逻辑卷/softRAID 阵列

Debian - 检测并安装逻辑卷/softRAID 阵列

我有一台带有 B120i RAID 控制器的 HP Proliant ML10 v2 服务器。服务器有 5 个磁盘,2 个逻辑卷,通过 HP Smart Storage Administrator 配置(RAID 0 中的 4 个 3TB 驱动器是第一个逻辑卷,500GB 固态硬盘是第二个逻辑卷,其中安装了操作系统并启动 Debian 11)。

这台机器之前安装了 Windows 服务器,可以在 diskmgmt.msc 中看到逻辑卷是 1 个 12TB 的大磁盘。这是最初创建和使用该卷的地方。Windows 崩溃后,我决定切换到 Linux。

在 Debian 中,我只能看到单个驱动器,看不到逻辑卷。我整天都在阅读和排除故障,并了解到 Linux 可以“看透”逻辑卷来显示实际的磁盘,但我找到的所有解决方案都无法帮助我找到、识别、激活和安装我的 RAID 阵列。这些驱动器上有数据,所以我不会尝试擦除它们。

如您所见,这 4 个驱动器显示为“Microsoft Basic Data”格式。

我认为我的逻辑卷可能是 /dev/sdd1。尝试从其他卷挂载此卷时,它会给出唯一的输出。提示我需要“激活它并在 /dev/mapper 目录下映射其他设备”……但是 dmraid 命令似乎都不起作用。

我尝试过的事情:

  • 安装 lvm2 逻辑卷管理器(服务被屏蔽)。
  • 我的 /dev/mapper 目录是空的,只有一个名为“control”的文件
  • ‘sudo vgs’、‘sudo lvs’ 和 ‘sudo vgscan’ 运行但没有返回任何内容
  • ‘sudo dmraid -ay’ 返回“没有 raid 磁盘”。
  • 'sudo testdisk' 确实正确返回了所有 5 个磁盘
  • 启动 HP SSA raid 配置实用程序显示 2 个逻辑卷运行正常且正常运行

一些输出:

fdisk-l:

root@ORION:/home/matt# sudo fdisk -l
The primary GPT table is corrupt, but the backup appears OK, so that will be used.
Disk /dev/sda: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: WDC WD30EFRX-68E
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: 1376103F-A14B-4C50-8572-AC294E2226B3

Device     Start        End    Sectors  Size Type
/dev/sda1   2048 5860532223 5860530176  2.7T Microsoft basic data


Disk /dev/sde: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: MTFDDAK512TBN-1A
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: dos
Disk identifier: 0x76b94400

Device     Boot     Start        End   Sectors  Size Id Type
/dev/sde1  *         2048  998215679 998213632  476G 83 Linux
/dev/sde2       998217726 1000214527   1996802  975M  5 Extended
/dev/sde5       998217728 1000214527   1996800  975M 82 Linux swap / Solaris

Partition 2 does not start on physical sector boundary.


Disk /dev/sdb: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: ST3000DM001-1CH1
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: 959EC721-56CF-4EE0-AD2D-56D3EC83114D

Device     Start        End    Sectors  Size Type
/dev/sdb1     34      32767      32734   16M Microsoft reserved
/dev/sdb2  32768 5860530175 5860497408  2.7T Microsoft basic data

Partition 1 does not start on physical sector boundary.


Disk /dev/sdc: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: ST3000DM001-1CH1
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: BAD41F4C-CAE2-4679-AC01-6CCDF4E19996

Device     Start        End    Sectors  Size Type
/dev/sdc1     34      32767      32734   16M Microsoft reserved
/dev/sdc2  32768 5860530175 5860497408  2.7T Microsoft basic data

Partition 1 does not start on physical sector boundary.


Disk /dev/sdd: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: TOSHIBA DT01ACA3
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: dos
Disk identifier: 0x80fa0768

Device     Boot Start     End Sectors  Size Id Type
/dev/sdd1  *     2048 1126399 1124352  549M  7 HPFS/NTFS/exFAT

sudo blkid:

root@ORION:/dev/mapper# sudo blkid
/dev/sda: PTUUID="1376103f-a14b-4c50-8572-ac294e2226b3" PTTYPE="gpt"
/dev/sde1: UUID="557bf79c-82ba-4fee-b53e-ca895e66cb3b" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="76b94400-01"
/dev/sde5: UUID="cd0f4e38-e2f3-4c34-8b75-3f95f849c86c" TYPE="swap" PARTUUID="76b94400-05"
/dev/sdb1: PARTLABEL="Microsoft reserved partition" PARTUUID="a5de2645-8850-4914-b7b0-30f95d0fcd6e"
/dev/sdb2: PARTLABEL="Basic data partition" PARTUUID="98133779-1933-4284-b0ea-7bb73b22a14c"
/dev/sdc1: PARTLABEL="Microsoft reserved partition" PARTUUID="72d203c4-6b37-420d-986e-0d076321dd21"
/dev/sdc2: PARTLABEL="Basic data partition" PARTUUID="f428813b-52f4-4f27-bd18-8e0274840784"
/dev/sdd1: PARTUUID="80fa0768-01"

parted -l 报告:

root@ORION:/dev/mapper# sudo parted -l reports
Error: Invalid argument during seek for read on /dev/sda
Retry/Ignore/Cancel? Ignore                                               
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
OK/Cancel? OK                                                             
Model: ATA WDC WD30EFRX-68E (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags: 

Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  16.8MB  16.8MB               Microsoft reserved partition  msftres
 2      16.8MB  3001GB  3001GB               Basic data partition          msftdata


Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sdc: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  16.8MB  16.8MB               Microsoft reserved partition  msftres
 2      16.8MB  3001GB  3001GB               Basic data partition          msftdata


Model: ATA TOSHIBA DT01ACA3 (scsi)
Disk /dev/sdd: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  577MB  576MB  primary  ntfs         boot


Model: ATA MTFDDAK512TBN-1A (scsi)
Disk /dev/sde: 512GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  511GB  511GB   primary   ext4            boot
 2      511GB   512GB  1022MB  extended
 5      511GB   512GB  1022MB  logical   linux-swap(v1)

sudo mount -t /dev/sdd1 /mnt/dir:

root@ORION:/dev/mapper# sudo mount -t ntfs /dev/sdd1 /mnt/raid
ntfs_mst_post_read_fixup_warn: magic: 0x7338473b  size: 1024   usa_ofs: 36301  usa_count: 8638: Invalid argument
Record 0 has no FILE magic (0x7338473b)
Failed to load $MFT: Input/output error
Failed to mount '/dev/sdd1': Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.

答案1

在 Debian 中,我只能看到单个驱动器,看不到逻辑卷。我整天都在阅读和排除故障,并了解到 Linux 可以“看透”逻辑卷来显示实际的磁盘,

这是因为 Bxxx 系列“动态智能阵列”控制器基于软件“假 RAID” 控制器,而不是硬件 RAID,因此 Linux 并不是故意试图“看穿”逻辑卷,而是这是默认状态——操作系统负责配置首先是逻辑卷。控制器仅提供电池供电的写入缓存和存储阵列元数据的位置(可能还有一些加速),但没有太多其他功能。

正如 Bxxx 手册所述,控制器需要在安装时提供 Windows 驱动程序。同样,HP 为 Linux(RHEL 和Ubuntu)并且你应该加载hpvsa驱动程序禁用内置 SATA AHCI 驱动程序。(Reddit 声称 CentOS 8 内置了该驱动程序,但我并不指望在主流 Linux 中看到它,因为该驱动程序是 HP 所有专有“高级 RAID 算法”所在的地方。)

HP 不像 Dell 那样将阵列元数据存储在磁盘上,因此 mdadm 和 dmraid 都无法识别任何内容(并且 LVM 绝对不会在任何情况下识别非 LVM 阵列),尽管可以使用 dmraid 手动组装“原始” RAID 0 阵列(但不要问如何组装)。

我的建议是备份所有数据,将 B120i 切换到标准 SATA AHCI 模式,然后使用 mdadm(或使用 ZFS 或 Btrfs 的条带文件系统)创建新的软件 RAID 阵列。

相关内容